Browse Source

供应商等级审批

java8
rq 5 months ago
parent
commit
c4e81e0983
  1. 3
      src/api/oss/oss.js
  2. 3
      src/api/srm/srmSupplier.js
  3. 2
      src/utils/resizable.js
  4. 215
      src/views/demo/rqDemo.vue
  5. 396
      src/views/modules/srmSupplier/SupplierGroupReview.vue
  6. 694
      src/views/modules/srmSupplier/supplierGroupRequestList.vue
  7. 59
      src/views/modules/srmSupplier/supplierList.vue

3
src/api/oss/oss.js

@ -20,3 +20,6 @@ export const removeOss = (data) => createAPI(`/oss/remove`,'post',data)
export const previewOssFileById = (data) => createAPI(`/oss/${data.id}`,'post',777) export const previewOssFileById = (data) => createAPI(`/oss/${data.id}`,'post',777)
export const previewOssFileById2 = (data) => createAPI(`/oss/2/${data.id}`,'post',777) export const previewOssFileById2 = (data) => createAPI(`/oss/2/${data.id}`,'post',777)
export const ossUploadNoSaveOSS = (data) => createAPI(`/oss/ossUploadNoSaveOSS`,'post',data)

3
src/api/srm/srmSupplier.js

@ -3,3 +3,6 @@ import { createAPI } from '@/utils/httpRequest.js'
// 获取派工单的最新信息 // 获取派工单的最新信息
export const searchSrmSupplierList = data => createAPI('/srmSupplier/searchSrmSupplierList', 'POST', data) export const searchSrmSupplierList = data => createAPI('/srmSupplier/searchSrmSupplierList', 'POST', data)
export const searchSupplierGroupRequestList = data => createAPI('/srmSupplier/searchSupplierGroupRequestList', 'POST', data) export const searchSupplierGroupRequestList = data => createAPI('/srmSupplier/searchSupplierGroupRequestList', 'POST', data)
export const getSupplierGroupRequestList = data => createAPI('/srmSupplier/getSupplierGroupRequestList', 'POST', data)
export const createNewSupplierRequest = data => createAPI('/srmSupplier/createNewSupplierRequest', 'POST', data)
export const checkSrmSupplierList = data => createAPI('/srmSupplier/checkSrmSupplierList', 'POST', data)

2
src/utils/resizable.js

@ -1,6 +1,6 @@
// v-resizable.js // v-resizable.js
export default { export default {
bind(el) {
bind() {
const minWidth = 400; // 设置表格最小宽度 const minWidth = 400; // 设置表格最小宽度
const minHeight = 200; // 设置表格最小高度 const minHeight = 200; // 设置表格最小高度
let startX, startY, startWidth, startHeight; let startX, startY, startWidth, startHeight;

215
src/views/demo/rqDemo.vue

@ -0,0 +1,215 @@
<template>
<div class="customer-css" >
<!-- 查询时间和产品 -->
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;" >
<el-row>
<el-col :span="24" style="">
<el-form-item :label="'Supplier No:'">
<el-input v-model="searchData.supplierNo" style=""></el-input>
</el-form-item>
<el-form-item :label="'Supplier Name:'">
<el-input v-model="searchData.supplierName" style=""></el-input>
</el-form-item>
<el-form-item :label="' '" >
<el-button class="customer-bun-min" type="primary" @click="getMainData" style="">Query</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
:height="height"
:data="mainDataList"
border
ref="mainTable"
highlight-current-row
v-loading="dataListLoading"
style="margin-top: 0px; width: 100%;">
<!-- <el-table-column-->
<!-- fixed="left"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- width="220"-->
<!-- :label="'操作'">-->
<!-- <template slot-scope="scope">-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
v-for="(item,index) in columnArray1" :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"
:min-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>
<!-- 分页插件 -->
<el-pagination style="margin-top: 0px"
@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>
</div>
</template>
<script>
/*组件*/
import {
searchSrmSupplierList,
} from '@/api/srm/srmSupplier.js'
export default {
data() {
return {
functionId: this.$route.meta.menuId,
height: 200,
currentRow: {},
searchData:{
supplierNo:'',
supplierName:'',
site:this.$store.state.user.site,
page: 1,
limit: 10,
},
pageIndex: 1,
pageSize: 50,
totalPage: 0,
mainDataList:[],
dataListLoading: false,
columnArray1: [
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1SupplierNo',
tableId: "811001Table1",
tableName: "供应商信息",
columnProp: "supplierNo",
headerAlign: "center",
align: "left",
columnLabel: "Supplier No",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1SupplierName',
tableId: "811001Table1",
tableName: "供应商信息",
columnProp: "supplierName",
headerAlign: "center",
align: "left",
columnLabel: "Supplier Name",
columnWidth: '300',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1SupplierGroup',
tableId: "811001Table1",
tableName: "供应商信息",
columnProp: "supplierGroup",
headerAlign: "center",
align: "left",
columnLabel: "Supplier Group",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
],
}
},
/*组件*/
components: {
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 220;
})
},
methods: {
getMainData(){
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
searchSrmSupplierList(this.searchData).then(({data}) => {
if (data.code === 0) {
this.mainDataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getMainData()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getMainData()
},
},
created() {
//
this.getMainData();
},
}
</script>
<!--当前页面的标签样式-->
<style scoped lang="scss">
</style>

396
src/views/modules/srmSupplier/SupplierGroupReview.vue

@ -0,0 +1,396 @@
<template>
<div class="customer-css" >
<!-- 查询时间和产品 -->
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;" >
<el-row>
<el-col :span="24" style="">
<el-form-item :label="'Request Date'" >
<el-date-picker
style="width: 130px"
v-model="searchData.startDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="'To'" >
<el-date-picker
style="width: 130px"
v-model="searchData.endDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="'Status:'">
<el-select v-model="searchData.status" readonly style="width: 130px">
<el-option label="All" 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 >
<span style="cursor: pointer" slot="label" @click="getBaseList(1100)"><a herf="#">Supplier No</a></span>
<el-input v-model="searchData.supplierNo" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'Supplier Name:'">
<el-input v-model="searchData.supplierName" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'Request By:'">
<el-input v-model="searchData.requestBy" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'Request No:'">
<el-input v-model="searchData.requestNo" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="' '" >
<el-button class="customer-bun-min" type="primary" @click="getMainData" style="">Query</el-button>
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
:height="height"
:data="mainDataList"
border
ref="mainTable"
highlight-current-row
v-loading="dataListLoading"
style="margin-top: 0px; width: 100%;">
<!-- <el-table-column-->
<!-- fixed="left"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- width="220"-->
<!-- :label="'操作'">-->
<!-- <template slot-scope="scope">-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
v-for="(item,index) in columnList1" :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"
:min-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>
<!-- 分页插件 -->
<el-pagination style="margin-top: 0px"
@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>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
/*组件*/
import excel from "@/utils/excel-util.js";
import {
searchSrmSupplierList,getSupplierGroupRequestList
} from '@/api/srm/srmSupplier.js'
import Chooselist from '@/views/modules/common/Chooselist_eam'
export default {
data() {
return {
functionId: this.$route.meta.menuId,
height: 200,
currentRow: {},
searchData:{
startDate:'',
endDate:'',
status:'待审批',
supplierNo:'',
supplierName:'',
requestBy:'',
requestNo:'',
site:this.$store.state.user.site,
page: 1,
limit: 10,
},
exportName: '供应商等级变更申请'+this.dayjs().format('YYYYMMDDHHmmss'),
tagNo:'',
pageIndex: 1,
pageSize: 50,
totalPage: 0,
mainDataList:[],
dataListLoading: false,
columnList1: [
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1RequestNo',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "requestNo",
headerAlign: "center",
align: "left",
columnLabel: "Request No",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1RequestDate',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "requestDate",
headerAlign: "center",
align: "left",
columnLabel: "Request Date",
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1SupplierNo',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "supplierNo",
headerAlign: "center",
align: "left",
columnLabel: "Supplier No",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1SupplierName',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "supplierName",
headerAlign: "center",
align: "left",
columnLabel: "Supplier Name",
columnWidth: '240',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1OldSupplierGroup',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "oldSupplierGroup",
headerAlign: "center",
align: "left",
columnLabel: "Old Supplier Group",
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1NewSupplierGroup',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "newSupplierGroup",
headerAlign: "center",
align: "left",
columnLabel: "New Supplier Group",
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1Reason',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "reason",
headerAlign: "center",
align: "left",
columnLabel: "Reason",
columnWidth: '200',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1Status',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "status",
headerAlign: "center",
align: "center",
columnLabel: "Status",
columnWidth: '80',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1RequestBy',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "requestBy",
headerAlign: "center",
align: "left",
columnLabel: "Request By",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
],
}
},
/*组件*/
components: {
Chooselist,
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 220;
})
},
methods: {
// S
getBaseList(val, type) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
if (val === 1100) {
strVal = this.searchData.supplierNo
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData(val) {
if (this.tagNo === 1100) {
this.searchData.supplierNo = val.supplier_no
}
},
getMainData(){
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
getSupplierGroupRequestList(this.searchData).then(({data}) => {
if (data.code === 0) {
this.mainDataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getMainData()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getMainData()
},
async exportExcel() {
this.searchData.limit = -1
this.searchData.page = 1
excel.exportTable({
url: "/srmSupplier/getSupplierGroupRequestList",
columnMapping: this.columnList1,//table
mergeSetting: [],//
params: this.searchData,
fileName: this.exportName+".xlsx",
rowFetcher: res => res.data,
columnFormatter: [],
dropColumns: [],//dropColumns: ["netWeight"]
});
},
},
created() {
//
this.getMainData();
},
}
</script>
<!--当前页面的标签样式-->
<style scoped lang="scss">
</style>

694
src/views/modules/srmSupplier/supplierGroupRequestList.vue

@ -0,0 +1,694 @@
<template>
<div class="customer-css" >
<!-- 查询时间和产品 -->
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;" >
<el-row>
<el-col :span="24" style="">
<el-form-item :label="'Request Date'" >
<el-date-picker
style="width: 130px"
v-model="searchData.startDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="'To'" >
<el-date-picker
style="width: 130px"
v-model="searchData.endDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="'Status:'">
<el-select v-model="searchData.status" style="width: 130px">
<el-option label="All" 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 >
<span style="cursor: pointer" slot="label" @click="getBaseList(1100,1)"><a herf="#">Supplier No</a></span>
<el-input v-model="searchData.supplierNo" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'Supplier Name:'">
<el-input v-model="searchData.supplierName" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'Request By:'">
<el-input v-model="searchData.requestBy" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'Request No:'">
<el-input v-model="searchData.requestNo" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="' '" >
<el-button class="customer-bun-min" type="primary" @click="getMainData" style="">Query</el-button>
<el-button class="customer-bun-min" type="primary" @click="requestModel" style="">New Request</el-button>
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
:height="height"
:data="mainDataList"
border
ref="mainTable"
highlight-current-row
v-loading="dataListLoading"
style="margin-top: 0px; width: 100%;">
<!-- <el-table-column-->
<!-- fixed="left"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- width="220"-->
<!-- :label="'操作'">-->
<!-- <template slot-scope="scope">-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
v-for="(item,index) in columnList1" :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"
:min-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>
<!-- 分页插件 -->
<el-pagination style="margin-top: 0px"
@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="New Request" :close-on-click-modal="false" v-drag :visible.sync="requestModelFlag" width="600px">
<el-form label-position="top" style="margin-top: -5px;">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item >
<span style="cursor: pointer" slot="label" @click="getBaseList(1100,2)"><a herf="#">Supplier No</a></span>
<el-input v-model="requestModelData.supplierNo" @blur="supplierNoBlur" style="width: 130px" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'Supplier Name'" >
<el-input v-model="requestModelData.supplierName" disabled style="width: 130px"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'Request Date'" >
<el-date-picker
style="width: 130px"
v-model="requestModelData.requestDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'Supplier Group'" >
<el-select v-model="requestModelData.newSupplierGroup" style="width: 130px">
<el-option label="战略" value="战略"></el-option>
<el-option label="重要" value="重要"></el-option>
<el-option label="普通" value="普通"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="'Reason'" >
<el-input v-model="requestModelData.reason" ></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-button class="customer-bun-min" type="primary" @click="handleUpload" style="">Upload</el-button>
</el-col>
</el-row>
</el-form>
<el-table
:height="240"
:data="fileList"
ref="fileTableRef"
style="width: 100%;" >
<el-table-column
prop="fileName"
header-align="center"
align="left"
min-width="200"
label="File No">
</el-table-column>
<el-table-column
prop="createdBy"
header-align="center"
align="center"
min-width="100"
label="Upload By">
</el-table-column>
<el-table-column
prop="createDate"
header-align="center"
align="center"
min-width="100"
label="Upload Time">
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="100"
fixed="right"
label="Actions">
<template slot-scope="scope">
<a type="text" size="small" @click="handleDownload(scope.row)">View |</a>
<a type="text" size="small" @click="deleteFile(scope.$index)"> delete</a>
</template>
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="savePalletHeader()">Submit</el-button>
<el-button type="primary" @click="requestModelFlag=false">Cancel & Close</el-button>
</el-footer>
</el-dialog>
<el-dialog title="UpLoad" :visible.sync="ossVisible" v-drag width="400px" append-to-body :close-on-click-modal="false">
<el-form ref="form" class="rq" label-width="80px" label-position="top">
<el-row :gutter="10">
<slot></slot>
<el-col :span="24">
<el-form-item label=" " class="auto">
<el-upload drag :file-list="fileList2"
action="#" ref="upload"
:on-remove="onRemoveFile"
:on-change="onChangeFile"
multiple
:auto-upload="false">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" class="auto">
<el-input type="textarea" v-model="ossForm.remark" resize="none" :autosize="{minRows: 3, maxRows: 3}"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" :loading="uploadLoading" @click="handleUploadFiles">确定</el-button>
<el-button @click="ossVisible = false">关闭</el-button>
</span>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
/*组件*/
import excel from "@/utils/excel-util.js";
import {
createNewSupplierRequest,getSupplierGroupRequestList,checkSrmSupplierList
} from '@/api/srm/srmSupplier.js'
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {ossUploadNoSaveOSS, previewOssFileById} from "../../../api/oss/oss";
import {queryCustomerList} from "../../../api/customer/customer";
export default {
data() {
return {
functionId: this.$route.meta.menuId,
height: 200,
currentRow: {},
searchData:{
startDate:'',
endDate:'',
status:'',
supplierNo:'',
supplierName:'',
requestBy:'',
requestNo:'',
site:this.$store.state.user.site,
page: 1,
limit: 10,
},
uploadLoading:false,
exportName: '供应商等级变更申请'+this.dayjs().format('YYYYMMDDHHmmss'),
tagNo:'',
tagType:'',
pageIndex: 1,
pageSize: 50,
totalPage: 0,
mainDataList:[],
dataListLoading: false,
requestModelFlag: false,
requestModelData:{
site:'',
supplierNo:'',
supplierName:'',
requestDate:'',
createBy:'',
oldSupplierGroup:'',
newSupplierGroup:'',
reason:'',
fileList:[],
},
fileList:[],
fileList2:[],
ossVisible:false,
ossForm:{
remark:'',
},
columnList1: [
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1RequestNo',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "requestNo",
headerAlign: "center",
align: "left",
columnLabel: "Request No",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1RequestDate',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "requestDate",
headerAlign: "center",
align: "left",
columnLabel: "Request Date",
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1SupplierNo',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "supplierNo",
headerAlign: "center",
align: "left",
columnLabel: "Supplier No",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1SupplierName',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "supplierName",
headerAlign: "center",
align: "left",
columnLabel: "Supplier Name",
columnWidth: '240',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1OldSupplierGroup',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "oldSupplierGroup",
headerAlign: "center",
align: "left",
columnLabel: "Old Supplier Group",
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1NewSupplierGroup',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "newSupplierGroup",
headerAlign: "center",
align: "left",
columnLabel: "New Supplier Group",
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1Reason',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "reason",
headerAlign: "center",
align: "left",
columnLabel: "Reason",
columnWidth: '200',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1Status',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "status",
headerAlign: "center",
align: "center",
columnLabel: "Status",
columnWidth: '80',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811010Table1RequestBy',
tableId: "811010Table1",
tableName: "供应商等级变更申请",
columnProp: "requestBy",
headerAlign: "center",
align: "left",
columnLabel: "Request By",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
],
}
},
/*组件*/
components: {
Chooselist,
},
watch: {
requestModelData: {
deep: true,
handler: function (newV, oldV) {
this.requestModelData.supplierNo = this.requestModelData.supplierNo.toUpperCase()
}
},
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 220;
})
},
methods: {
// S
getBaseList(val, type) {
this.tagNo = val
this.tagType = type
this.$nextTick(() => {
let strVal = ''
if (val === 1100) {
if(type==1){
strVal = this.searchData.supplierNo
}
if(type==2){
strVal = this.requestModelData.supplierNo
}
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData(val) {
if (this.tagNo === 1100) {
if(this.tagType==1) {
this.searchData.supplierNo = val.supplier_no
}
if(this.tagType==2) {
this.requestModelData.supplierNo = val.supplier_no
this.requestModelData.supplierName = val.supplier_name
this.requestModelData.oldSupplierGroup = val.supplier_group
}
}
},
getMainData(){
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
getSupplierGroupRequestList(this.searchData).then(({data}) => {
if (data.code === 0) {
this.mainDataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getMainData()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getMainData()
},
async exportExcel() {
this.searchData.limit = -1
this.searchData.page = 1
excel.exportTable({
url: "/srmSupplier/getSupplierGroupRequestList",
columnMapping: this.columnList1,//table
mergeSetting: [],//
params: this.searchData,
fileName: this.exportName+".xlsx",
rowFetcher: res => res.data,
columnFormatter: [],
dropColumns: [],//dropColumns: ["netWeight"]
});
},
requestModel(){
this.requestModelData={
site:this.$store.state.user.site,
supplierNo:'',
supplierName:'',
requestDate:'',
oldSupplierGroup:'',
newSupplierGroup:'',
createBy:this.$store.state.user.name,
reason:'',
fileList:[],
}
this.fileList=[]
this.requestModelFlag=true
},
savePalletHeader(){
if(this.requestModelData.supplierNo==''||this.requestModelData.supplierNo==null){
this.$message.warning('未选择Supplier No!')
return false
}
if(this.requestModelData.requestDate==''||this.requestModelData.requestDate==null){
this.$message.warning('未选择Request Date!')
return false
}
if(this.requestModelData.newSupplierGroup==''||this.requestModelData.newSupplierGroup==null){
this.$message.warning('未选择Supplier Group!')
return false
}
if(this.requestModelData.oldSupplierGroup===this.requestModelData.newSupplierGroup){
this.$message.warning('新供应商等级与旧供应商等级相同!')
return false
}
this.requestModelData.fileList= this.fileList
createNewSupplierRequest( this.requestModelData).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.getMainData();
this.requestModelFlag=false
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error(error);
})
},
onRemoveFile(file, fileList){
this.fileList2 = fileList
},
onChangeFile(file, fileList){
this.fileList2 = fileList
},
handleUploadFiles(){
if (this.fileList2.length === 0){
this.$message.error('请选择文件');
return;
}
let formData = new FormData();
for (let i = 0; i < this.fileList2.length; i++) {
formData.append('file', this.fileList2[i].raw);
}
formData.append('orderRef1', '');
formData.append('orderRef2', '');
formData.append('createdBy', this.$store.state.user.name);
formData.append('fileRemark', this.ossForm.remark);
this.uploadLoading = true;
ossUploadNoSaveOSS(formData).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
for (let i = 0; i <data.rows.length ; i++) {
this.fileList.push(data.rows[i]);
}
this.ossVisible = false;
}else {
this.$message.warning(data.msg);
}
this.uploadLoading = false;
}).catch((error)=>{
this.$message.error(error);
this.uploadLoading = false;
})
},
handleUpload(){
this.$nextTick(()=>{
if (this.$refs.upload){
this.$refs.upload.clearFiles();
}
})
this.fileList2 = [];
this.ossForm.remark = '';
this.ossVisible = true
},
handleDownload(row){
// this.$refs.table.clearSelection()
let selectList = [];
selectList.push(row);
for (let i = 0; i < selectList.length; i++) {
let params = {
id:selectList[i].id,
}
previewOssFileById(params).then((response) => {
const blob = new Blob([response.data], { type: response.headers['content-type'] });
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.setAttribute('download', selectList[i].fileName);
link.target = '_blank'; //
link.click();
URL.revokeObjectURL(link.href);
});
}
},
deleteFile(index){
this.fileList.splice(index, 1);
},
supplierNoBlur(){
let params = {
supplierNo: this.requestModelData.supplierNo,
site: this.$store.state.user.site,
}
checkSrmSupplierList(params).then(({data}) => {
if (data && data.code === 0) {
if (data.rows.length >= 1){
this.requestModelData.supplierName = data.rows[0].supplierName
}else {
this.requestModelData.supplierName = ''
}
}else {
this.requestModelData.supplierName = ''
}
}).catch((error) => {
this.$message.error(error)
})
},
},
created() {
//
this.getMainData();
},
}
</script>
<!--当前页面的标签样式-->
<style scoped lang="scss">
.rq .auto /deep/ .el-form-item__content{
height: auto;
line-height: 1.5;
}
</style>

59
src/views/modules/srmSupplier/supplierList.vue

@ -4,14 +4,25 @@
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;" > <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;" >
<el-row> <el-row>
<el-col :span="24" style=""> <el-col :span="24" style="">
<el-form-item :label="'Supplier No:'">
<el-input v-model="searchData.supplierNo" style=""></el-input>
<el-form-item >
<span style="cursor: pointer" slot="label" @click="getBaseList(1100)"><a herf="#">Supplier No</a></span>
<el-input v-model="searchData.supplierNo" style="width: 130px"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="'Supplier Name:'"> <el-form-item :label="'Supplier Name:'">
<el-input v-model="searchData.supplierName" style=""></el-input>
<el-input v-model="searchData.supplierName" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'Status:'">
<el-select v-model="searchData.supplierGroup" style="width: 130px">
<el-option label="All" 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>
<el-form-item :label="' '" > <el-form-item :label="' '" >
<el-button class="customer-bun-min" type="primary" @click="getMainData" style="">Query</el-button> <el-button class="customer-bun-min" type="primary" @click="getMainData" style="">Query</el-button>
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -107,7 +118,7 @@
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div> </div>
</template> </template>
@ -117,8 +128,8 @@
import { import {
searchSupplierGroupRequestList,searchSrmSupplierList, searchSupplierGroupRequestList,searchSrmSupplierList,
} from '@/api/srm/srmSupplier.js' } from '@/api/srm/srmSupplier.js'
import excel from "@/utils/excel-util.js";
import Chooselist from '@/views/modules/common/Chooselist_eam'
export default { export default {
data() { data() {
return { return {
@ -128,6 +139,7 @@ export default {
searchData:{ searchData:{
supplierNo:'', supplierNo:'',
supplierName:'', supplierName:'',
supplierGroup:'',
site:this.$store.state.user.site, site:this.$store.state.user.site,
page: 1, page: 1,
limit: 10, limit: 10,
@ -135,6 +147,7 @@ export default {
pageIndex: 1, pageIndex: 1,
pageSize: 50, pageSize: 50,
totalPage: 0, totalPage: 0,
tagNo:'',
mainDataList:[], mainDataList:[],
supplierGroupRequestList:[], supplierGroupRequestList:[],
dataListLoading: false, dataListLoading: false,
@ -323,11 +336,12 @@ export default {
fixed: false fixed: false
}, },
], ],
exportName: '供应商信息'+this.dayjs().format('YYYYMMDDHHmmss'),
} }
}, },
/*组件*/ /*组件*/
components: { components: {
Chooselist,
}, },
@ -337,7 +351,23 @@ export default {
}) })
}, },
methods: { methods: {
getBaseList(val, type) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
if (val === 1100) {
strVal = this.searchData.supplierNo
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData(val) {
if (this.tagNo === 1100) {
this.searchData.supplierNo = val.supplier_no
}
},
getMainData(){ getMainData(){
this.searchData.limit = this.pageSize this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex this.searchData.page = this.pageIndex
@ -403,7 +433,20 @@ export default {
}); });
} }
}, },
async exportExcel() {
this.searchData.limit = -1
this.searchData.page = 1
excel.exportTable({
url: "/srmSupplier/searchSrmSupplierList",
columnMapping: this.columnArray1,//table
mergeSetting: [],//
params: this.searchData,
fileName: this.exportName+".xlsx",
rowFetcher: res => res.data,
columnFormatter: [],
dropColumns: [],//dropColumns: ["netWeight"]
});
},
}, },
created() { created() {
// //

Loading…
Cancel
Save