5 changed files with 961 additions and 6 deletions
-
12src/api/srm/srmSupplier.js
-
298src/views/modules/srmSupplier/com_srmSupplier_share.vue
-
289src/views/modules/srmSupplier/com_supplierShare_supplierList.vue
-
20src/views/modules/srmSupplier/supplierList.vue
-
346src/views/modules/srmSupplier/supplierShare.vue
@ -0,0 +1,298 @@ |
|||
<template> |
|||
<div class="customer-css"> |
|||
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;"> |
|||
<el-form :inline="true" label-position="top" style="margin-top: 0px"> |
|||
<el-button type="primary" @click="addModal()">新增</el-button> |
|||
</el-form> |
|||
</el-form> |
|||
<el-table |
|||
:data="dataList" |
|||
:height=searchData.height |
|||
border |
|||
v-loading="dataListLoading" |
|||
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" |
|||
: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-column |
|||
header-align="center" |
|||
align="center" |
|||
width="180" |
|||
fixed="right" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<a type="text" size="small" v-if="scope.row.needRenew=='Y'" @click="renewModew(scope.row)">Renew |</a> |
|||
<a type="text" size="small" @click="editModel(scope.row)">Edit |</a> |
|||
<a type="text" size="small" @click="deleteData(scope.row)"> Delete</a> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
|
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
createNewSupplierContract,getNewSupplierContract,deleteSupplierContract |
|||
} from '@/api/srm/srmSupplier.js' |
|||
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|||
import {ossUploadNoSaveOSS, previewOssFileById, queryOss} from "../../../api/oss/oss"; |
|||
|
|||
export default { |
|||
components: { |
|||
Chooselist |
|||
}, |
|||
data() { |
|||
return { |
|||
dataList: [], |
|||
searchData: { |
|||
site: '', |
|||
username: this.$store.state.user.name, |
|||
supplierNo: '', |
|||
height:'300', |
|||
page: 1, |
|||
limit: 1000 |
|||
}, |
|||
contractModelData:{ |
|||
id:'', |
|||
site:"", |
|||
contractId:'', |
|||
supplierNo:'', |
|||
supplierName:'', |
|||
contractDate:'', |
|||
validTo:'', |
|||
amout:'', |
|||
currency:'', |
|||
contractNo:'', |
|||
contractName:'', |
|||
contractDetail:'', |
|||
createdBy:'', |
|||
renewflag:'', |
|||
}, |
|||
contractModelFlag:false, |
|||
visible:false, |
|||
dataListLoading: false, |
|||
currentRow:'', |
|||
columnList: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 811001, |
|||
serialNumber: '811001Table5ContractNo', |
|||
tableId: '811001Table5', |
|||
tableName: '供应商合同', |
|||
columnProp: 'contractNo', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '合同编号', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 811001, |
|||
serialNumber: '811001Table5ContractName', |
|||
tableId: '811001Table5', |
|||
tableName: '供应商合同', |
|||
columnProp: 'contractName', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '合同名称', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 811001, |
|||
serialNumber: '811001Table5ContractDetail', |
|||
tableId: '811001Table5', |
|||
tableName: '供应商合同', |
|||
columnProp: 'contractDetail', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '合同描述', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 240 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 811001, |
|||
serialNumber: '811001Table5ContractDate', |
|||
tableId: '811001Table5', |
|||
tableName: '供应商合同', |
|||
columnProp: 'contractDate', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '合同日期', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 811001, |
|||
serialNumber: '811001Table5CreatedBy', |
|||
tableId: '811001Table5', |
|||
tableName: '供应商合同', |
|||
columnProp: 'createBy', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: 'CreatedBy', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 811001, |
|||
serialNumber: '811001Table5CreateDate', |
|||
tableId: '811001Table5', |
|||
tableName: '供应商合同', |
|||
columnProp: 'createDate', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: 'Created Time', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 811001, |
|||
serialNumber: '811001Table5ValidTo', |
|||
tableId: '811001Table5', |
|||
tableName: '供应商合同', |
|||
columnProp: 'validTo', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: 'Valid To', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
], |
|||
} |
|||
}, |
|||
methods: { |
|||
// 获取基础数据列表S |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.tagNo1 = type |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
// if (val === 1013) { |
|||
// if(type==1) { |
|||
// strVal = this.dataForm.partType |
|||
// } |
|||
// } |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
/* 列表方法的回调 */ |
|||
getBaseData (val) { |
|||
// if (this.tagNo === 1013) { |
|||
// if(this.tagNo1==1) { |
|||
// this.dataForm.partType = val.Base_id |
|||
// this.dataForm.partTypeDesc = val.Base_desc |
|||
// } |
|||
// } |
|||
}, |
|||
//初始化组件的参数 |
|||
init(inData) { |
|||
//初始化参数 |
|||
this.searchData = JSON.parse(JSON.stringify(inData)); |
|||
//刷新表格 |
|||
this.searchTable(); |
|||
|
|||
}, |
|||
searchTable(){ |
|||
getNewSupplierContract(this.searchData).then(({data}) => { |
|||
//区分请求成功和失败的状况 |
|||
if (data && data.code == 0) { |
|||
this.dataList = data.rows |
|||
console.log(this.dataList) |
|||
} else { |
|||
this.dataList = []; |
|||
} |
|||
}); |
|||
}, |
|||
addModal(){ |
|||
this.contractModelData={ |
|||
id:0, |
|||
site:this.$store.state.user.site, |
|||
contractId:'', |
|||
supplierNo:this.searchData.supplierNo, |
|||
supplierName:this.searchData.supplierName, |
|||
contractDate:new Date(), |
|||
validTo:'', |
|||
amout:'', |
|||
currency:'', |
|||
contractNo:'', |
|||
contractName:'', |
|||
contractDetail:'', |
|||
renewflag:'N', |
|||
createBy:this.$store.state.user.name, |
|||
} |
|||
this.fileList=[] |
|||
this.contractModelFlag=true; |
|||
}, |
|||
|
|||
|
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
.rq .auto /deep/ .el-form-item__content{ |
|||
height: auto; |
|||
line-height: 1.5; |
|||
} |
|||
|
|||
|
|||
</style> |
|||
@ -0,0 +1,289 @@ |
|||
<template> |
|||
<div class="customer-css"> |
|||
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;"> |
|||
<el-form :inline="true" label-position="top" style="margin-top: 0px"> |
|||
<el-button type="primary" @click="addModal()">新增</el-button> |
|||
</el-form> |
|||
</el-form> |
|||
<el-table |
|||
:data="dataList" |
|||
:height=searchData.height |
|||
border |
|||
v-loading="dataListLoading" |
|||
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" |
|||
: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-column |
|||
header-align="center" |
|||
align="center" |
|||
width="180" |
|||
fixed="right" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<a type="text" size="small" @click="deleteData(scope.row)"> Delete</a> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-dialog title="供应商" :visible.sync="addSupplierFlag" width="600px" style="margin-top: 7px" v-drag :close-on-click-modal="false"> |
|||
<el-form inline="inline" label-position="top" :model="searchSupplierData" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="Supplier No"> |
|||
<el-input v-model="searchSupplierData.supplierNo" clearable style="width: 151px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="Supplier Name"> |
|||
<el-input v-model="searchSupplierData.supplierName" clearable style="width: 151px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-button type="primary" style="padding: 3px 12px" @click="searchSupplierList()">查询</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
:height="300" |
|||
:data="supplierList" |
|||
stripe |
|||
border |
|||
@selection-change="selectionList" |
|||
style="width: 100%;"> |
|||
<el-table-column |
|||
header-align="center" |
|||
type="selection" |
|||
align="center" |
|||
width="55"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="supplierNo" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="100" |
|||
label="Supplier No"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="supplierName" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="200" |
|||
label="Supplier Name"> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-footer style="height:40px;margin-top: 25px;text-align:center"> |
|||
<el-button type="primary" @click="saveSelection()">确定</el-button> |
|||
<el-button @click="addSupplierFlag = false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
|
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
createNewSupplierContract,getNewSupplierContract,deleteSupplierContract |
|||
} from '@/api/srm/srmSupplier.js' |
|||
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|||
import {ossUploadNoSaveOSS, previewOssFileById, queryOss} from "../../../api/oss/oss"; |
|||
import { |
|||
deleteMaterialFamily, deleteSrmMaterialFamilySupplier, |
|||
saveOrUpdateFamily, saveSrmMaterialFamilySupplier, |
|||
searchMaterialFamilySupplierData, |
|||
searchMaterialFamilySupplierDataOther |
|||
} from '../../../api/srm/srmSupplier' |
|||
|
|||
export default { |
|||
components: { |
|||
Chooselist |
|||
}, |
|||
data() { |
|||
return { |
|||
dataList: [], |
|||
searchData: { |
|||
site: '', |
|||
username: this.$store.state.user.name, |
|||
materialFamilyNo: '', |
|||
materialFamilyDesc: '', |
|||
height:'300', |
|||
page: 1, |
|||
limit: 1000 |
|||
}, |
|||
searchSupplierData:{ |
|||
id:'', |
|||
site:"", |
|||
supplierNo:'', |
|||
supplierName:'', |
|||
materialFamilyNo:'', |
|||
|
|||
}, |
|||
dataListLoading: false, |
|||
addSupplierFlag: false, |
|||
currentRow:'', |
|||
columnList: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: this.functionId, |
|||
serialNumber: '811031Table1SupplierNo', |
|||
tableId: "811031Table1", |
|||
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: '811031Table1SupplierName', |
|||
tableId: "811031Table1", |
|||
tableName: "供应商信息", |
|||
columnProp: "supplierName", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "Supplier Name", |
|||
columnWidth: '300', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: false |
|||
}, |
|||
], |
|||
supplierList:[], |
|||
listSelection:[], |
|||
} |
|||
}, |
|||
methods: { |
|||
// 获取基础数据列表S |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.tagNo1 = type |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
// if (val === 1013) { |
|||
// if(type==1) { |
|||
// strVal = this.dataForm.partType |
|||
// } |
|||
// } |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
/* 列表方法的回调 */ |
|||
getBaseData (val) { |
|||
// if (this.tagNo === 1013) { |
|||
// if(this.tagNo1==1) { |
|||
// this.dataForm.partType = val.Base_id |
|||
// this.dataForm.partTypeDesc = val.Base_desc |
|||
// } |
|||
// } |
|||
}, |
|||
//初始化组件的参数 |
|||
init(inData) { |
|||
//初始化参数 |
|||
this.searchData = JSON.parse(JSON.stringify(inData)); |
|||
//刷新表格 |
|||
this.searchTable(); |
|||
|
|||
}, |
|||
searchTable(){ |
|||
searchMaterialFamilySupplierData(this.searchData).then(({data}) => { |
|||
//区分请求成功和失败的状况 |
|||
if (data && data.code == 0) { |
|||
this.dataList = data.rows |
|||
console.log(this.dataList) |
|||
} else { |
|||
this.dataList = []; |
|||
} |
|||
}); |
|||
}, |
|||
addModal(){ |
|||
this.searchSupplierData={ |
|||
site:this.searchData.site, |
|||
supplierNo:'', |
|||
supplierName:'', |
|||
materialFamilyNo:this.searchData.materialFamilyNo, |
|||
} |
|||
this.searchSupplierList(); |
|||
this.addSupplierFlag=true; |
|||
}, |
|||
searchSupplierList(){ |
|||
searchMaterialFamilySupplierDataOther(this.searchSupplierData).then(({data}) => { |
|||
//区分请求成功和失败的状况 |
|||
if (data && data.code == 0) { |
|||
this.supplierList = data.rows |
|||
console.log(this.dataList) |
|||
} else { |
|||
this.supplierList = []; |
|||
} |
|||
}); |
|||
}, |
|||
selectionList(val) { |
|||
this.listSelection = val |
|||
}, |
|||
saveSelection(){ |
|||
if(this.listSelection.length===0){ |
|||
this.$message.warning('请选择供应商'); |
|||
return false |
|||
} |
|||
saveSrmMaterialFamilySupplier( this.listSelection).then(({data})=>{ |
|||
if (data && data.code === 0){ |
|||
this.$message.success("保存成功"); |
|||
this.searchTable(); |
|||
this.addSupplierFlag=false |
|||
}else { |
|||
this.$message.warning(data.msg); |
|||
} |
|||
}).catch((error)=>{ |
|||
this.$message.error(error); |
|||
}) |
|||
}, |
|||
deleteData(row){ |
|||
this.$confirm('是否删除此供应商?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
deleteSrmMaterialFamilySupplier( row).then(({data})=>{ |
|||
if (data && data.code === 0){ |
|||
this.$message.success(data.msg); |
|||
this.searchTable(); |
|||
this.addModelFlag=false |
|||
}else { |
|||
this.$message.warning(data.msg); |
|||
} |
|||
}).catch((error)=>{ |
|||
this.$message.error(error); |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
.rq .auto /deep/ .el-form-item__content{ |
|||
height: auto; |
|||
line-height: 1.5; |
|||
} |
|||
|
|||
|
|||
</style> |
|||
@ -0,0 +1,346 @@ |
|||
<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="'Material Family No:'"> |
|||
|
|||
<el-input v-model="searchData.materialFamilyNo" style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'Material Family Desc:'"> |
|||
<el-input v-model="searchData.materialFamilyDesc" 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="openModelData" style="">New Family</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 |
|||
@row-click="changeData" |
|||
v-loading="dataListLoading" |
|||
style="margin-top: 0px; width: 100%;"> |
|||
<el-table-column |
|||
fixed="right" |
|||
header-align="center" |
|||
align="center" |
|||
width="220" |
|||
:label="'操作'"> |
|||
<template slot-scope="scope"> |
|||
<a class="customer-a" @click="openUpModel(scope.row)">Edit |</a> |
|||
<a class="customer-a" @click="deleteFamily(scope.row)">Delete</a> |
|||
</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-dialog title="Material Family" :close-on-click-modal="false" v-drag :visible.sync="addModelFlag" width="400px"> |
|||
<el-form label-position="top" style="margin-top: -5px;"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'Material Family No'" > |
|||
<el-input v-model="addModelData.materialFamilyNo" :disabled="addModelData.flag===1" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item :label="'Material Family Desc'" > |
|||
<el-input v-model="addModelData.materialFamilyDesc" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|||
<el-button type="primary" @click="submitData()">Submit</el-button> |
|||
<el-button type="primary" @click="addModelFlag=false">Cancel & Close</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
|
|||
<el-tabs v-model="activeName" style="margin-top: 0px; width: 99%;" @tab-click="tabClick" class="customer-tab" type="border-card"> |
|||
<el-tab-pane label="Approved Vendor List" name="vendorList" style=""> |
|||
<vendorList ref="vendorList"></vendorList> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="Documents" name="documents" style=""> |
|||
<documents ref="documents"></documents> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
|
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
|
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
/*组件*/ |
|||
|
|||
import { |
|||
searchMaterialFamilyData, |
|||
} from '@/api/srm/srmSupplier.js' |
|||
import excel from "@/utils/excel-util.js"; |
|||
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|||
import vendorList from './com_supplierShare_supplierList' |
|||
import share from './com_srmSupplier_share' |
|||
import documents from './com_srmSupplier_DocumentDefinition' |
|||
import {deleteMaterialFamily, saveOrUpdateFamily} from '../../../api/srm/srmSupplier' |
|||
export default { |
|||
data() { |
|||
return { |
|||
functionId: this.$route.meta.menuId, |
|||
height: 200, |
|||
currentRow: {}, |
|||
searchData:{ |
|||
materialFamilyNo:'', |
|||
materialFamilyDesc:'', |
|||
delFlag:'N', |
|||
site:this.$store.state.user.site, |
|||
}, |
|||
addModelData:{ |
|||
flag:'', |
|||
site:this.$store.state.user.site, |
|||
materialFamilyNo:'', |
|||
materialFamilyDesc:'', |
|||
delFlag:'N', |
|||
}, |
|||
tagNo:'', |
|||
mainDataList:[], |
|||
dataListLoading: false, |
|||
activeName: 'vendorList', |
|||
columnArray1: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: this.functionId, |
|||
serialNumber: '811031Table1MaterialFamilyNo', |
|||
tableId: "811031Table1", |
|||
tableName: "物料分类信息", |
|||
columnProp: "materialFamilyNo", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "Material Family 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: '811031Table1MaterialFamilyDesc', |
|||
tableId: "811031Table1", |
|||
tableName: "物料分类信息", |
|||
columnProp: "materialFamilyDesc", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "Material Family Desc", |
|||
columnWidth: '200', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: false |
|||
}, |
|||
], |
|||
addModelFlag:false, |
|||
exportName: '物料分类信息'+this.dayjs().format('YYYYMMDDHHmmss'), |
|||
} |
|||
}, |
|||
/*组件*/ |
|||
components: { |
|||
Chooselist, |
|||
documents, |
|||
vendorList, |
|||
}, |
|||
|
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.height = ( window.innerHeight - 210)/2; |
|||
}) |
|||
}, |
|||
watch: { |
|||
addModelData: { |
|||
deep: true, |
|||
handler: function (newV, oldV) { |
|||
this.addModelData.materialFamilyNo = this.addModelData.materialFamilyNo.toUpperCase() |
|||
} |
|||
}, |
|||
searchData: { |
|||
deep: true, |
|||
handler: function (newV, oldV) { |
|||
this.searchData.materialFamilyNo = this.searchData.materialFamilyNo.toUpperCase() |
|||
} |
|||
}, |
|||
}, |
|||
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(){ |
|||
this.searchData.limit = this.pageSize |
|||
this.searchData.page = this.pageIndex |
|||
searchMaterialFamilyData(this.searchData).then(({data}) => { |
|||
if (data.code === 0) { |
|||
this.mainDataList = data.rows |
|||
//判断是否全部存在数据 |
|||
if (this.mainDataList.length > 0) { |
|||
//设置选中行 |
|||
this.$refs.mainTable.setCurrentRow(this.mainDataList[0]) |
|||
this.changeData(this.mainDataList[0]) |
|||
|
|||
}else { |
|||
this.changeData(null) |
|||
} |
|||
} |
|||
this.dataListLoading = false |
|||
}) |
|||
}, |
|||
tabClick(tab, event){ |
|||
this.refreshCurrentTabTable() |
|||
}, |
|||
changeData(row){ |
|||
this.currentRow=JSON.parse(JSON.stringify(row)) |
|||
this.refreshCurrentTabTable (); |
|||
}, |
|||
refreshCurrentTabTable(){ |
|||
if(this.currentRow===''||this.currentRow===null){ |
|||
this.currentRow={site:'',supplierNo:''} |
|||
} |
|||
if(this.activeName==='share'){ |
|||
this.refreshShareTable(); |
|||
} |
|||
if(this.activeName==='vendorList'){ |
|||
this.refreshVendorListTable(); |
|||
} |
|||
}, |
|||
async exportExcel() { |
|||
excel.exportTable({ |
|||
url: "/srmSupplierShare/searchMaterialFamilyData", |
|||
columnMapping: this.columnArray1,//可以直接用table,不需要的列就剔除 |
|||
mergeSetting: [],//需要合并的列 |
|||
params: this.searchData, |
|||
fileName: this.exportName+".xlsx", |
|||
rowFetcher: res => res.data, |
|||
columnFormatter: [], |
|||
dropColumns: [],//需要剔除的列,例如dropColumns: ["netWeight"],即剔除净重列 |
|||
}); |
|||
}, |
|||
refreshVendorListTable(){ |
|||
let inData={ |
|||
site: this.currentRow.site, |
|||
materialFamilyNo: this.currentRow.materialFamilyNo, |
|||
materialFamilyDesc: this.currentRow.materialFamilyDesc, |
|||
height:Number(this.height) |
|||
} |
|||
this.$refs.vendorList.init(inData) |
|||
}, |
|||
openModelData(){ |
|||
this.addModelData={ |
|||
flag: 0, |
|||
site: this.$store.state.user.site, |
|||
materialFamilyNo: '', |
|||
materialFamilyDesc: '', |
|||
delFlag: 'N', |
|||
} |
|||
this.addModelFlag=true; |
|||
}, |
|||
openUpModel(row){ |
|||
this.addModelData={ |
|||
flag: 1, |
|||
site: row.site, |
|||
materialFamilyNo: row.materialFamilyNo, |
|||
materialFamilyDesc: row.materialFamilyDesc, |
|||
delFlag: row.delFlag, |
|||
} |
|||
this.addModelFlag=true; |
|||
}, |
|||
submitData(){ |
|||
saveOrUpdateFamily( this.addModelData).then(({data})=>{ |
|||
if (data && data.code === 0){ |
|||
this.$message.success(data.msg); |
|||
this.getMainData(); |
|||
this.addModelFlag=false |
|||
}else { |
|||
this.$message.warning(data.msg); |
|||
} |
|||
}).catch((error)=>{ |
|||
this.$message.error(error); |
|||
}) |
|||
}, |
|||
deleteFamily(row){ |
|||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
deleteMaterialFamily( row).then(({data})=>{ |
|||
if (data && data.code === 0){ |
|||
this.$message.success(data.msg); |
|||
this.getMainData(); |
|||
this.addModelFlag=false |
|||
}else { |
|||
this.$message.warning(data.msg); |
|||
} |
|||
}).catch((error)=>{ |
|||
this.$message.error(error); |
|||
}) |
|||
}) |
|||
}, |
|||
}, |
|||
created() { |
|||
//查询报表的类型 |
|||
this.getMainData(); |
|||
}, |
|||
|
|||
|
|||
} |
|||
</script> |
|||
|
|||
<!--当前页面的标签样式--> |
|||
<style scoped lang="scss"> |
|||
|
|||
/deep/ .customer-tab .el-tabs__content { |
|||
padding: 5px !important; |
|||
} |
|||
|
|||
|
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue