|
|
|
@ -2,7 +2,31 @@ |
|
|
|
<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-item label="Period:"> |
|
|
|
<el-input v-model="searchData.periodMohu" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="Period Date:"> |
|
|
|
<el-date-picker |
|
|
|
style="width: 120px" |
|
|
|
v-model="searchData.startDate" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="to:"> |
|
|
|
<el-date-picker |
|
|
|
style="width: 120px" |
|
|
|
v-model="searchData.endDate" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label=" "> |
|
|
|
<el-button type="primary" @click="searchTable()">查询</el-button> |
|
|
|
<!-- <el-button type="primary" @click="addModal()">新增</el-button>--> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
@ -27,31 +51,21 @@ |
|
|
|
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"; |
|
|
|
|
|
|
|
import { |
|
|
|
deleteSrmMaterialFamilySupplier, deleteSrmMaterialFamilySupplierShareList, |
|
|
|
saveSrmMaterialFamilySupplierShare, |
|
|
|
searchMaterialFamilySupplierData, |
|
|
|
searchSrmMaterialFamilySupplierShare |
|
|
|
} from '../../../api/srm/srmSupplier' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
@ -62,160 +76,148 @@ export default { |
|
|
|
dataList: [], |
|
|
|
searchData: { |
|
|
|
site: '', |
|
|
|
username: this.$store.state.user.name, |
|
|
|
username: '', |
|
|
|
periodMohu: '', |
|
|
|
startDate: '', |
|
|
|
supplierNo: '', |
|
|
|
endDate: '', |
|
|
|
materialFamilyNo: '', |
|
|
|
materialFamilyDesc: '', |
|
|
|
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: '合同编号', |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '811001Table8Period', |
|
|
|
tableId: "811001Table8", |
|
|
|
tableName: "供应商份额", |
|
|
|
columnProp: "period", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: "Period", |
|
|
|
columnWidth: '100', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 120 |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 811001, |
|
|
|
serialNumber: '811001Table5ContractName', |
|
|
|
tableId: '811001Table5', |
|
|
|
tableName: '供应商合同', |
|
|
|
columnProp: 'contractName', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
columnLabel: '合同名称', |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '811001Table1PeriodStartDate', |
|
|
|
tableId: "811001Table8", |
|
|
|
tableName: "供应商份额", |
|
|
|
columnProp: "periodStartDate", |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: "Period Start Date", |
|
|
|
columnWidth: '100', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 120 |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 811001, |
|
|
|
serialNumber: '811001Table5ContractDetail', |
|
|
|
tableId: '811001Table5', |
|
|
|
tableName: '供应商合同', |
|
|
|
columnProp: 'contractDetail', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
columnLabel: '合同描述', |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '811001Table1PeriodEndDate', |
|
|
|
tableId: "811001Table8", |
|
|
|
tableName: "供应商份额", |
|
|
|
columnProp: "periodEndDate", |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: "Period End Date", |
|
|
|
columnWidth: '100', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 240 |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 811001, |
|
|
|
serialNumber: '811001Table5ContractDate', |
|
|
|
tableId: '811001Table5', |
|
|
|
tableName: '供应商合同', |
|
|
|
columnProp: 'contractDate', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
columnLabel: '合同日期', |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '811001Table1MaterialFamilyNo', |
|
|
|
tableId: "811001Table8", |
|
|
|
tableName: "供应商份额", |
|
|
|
columnProp: "materialFamilyNo", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: "Material Family No", |
|
|
|
columnWidth: '100', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 120 |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 811001, |
|
|
|
serialNumber: '811001Table5CreatedBy', |
|
|
|
tableId: '811001Table5', |
|
|
|
tableName: '供应商合同', |
|
|
|
columnProp: 'createBy', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: 'CreatedBy', |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '811001Table1MaterialFamilyDesc', |
|
|
|
tableId: "811001Table8", |
|
|
|
tableName: "供应商份额", |
|
|
|
columnProp: "materialFamilyDesc", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: "Material Family Desc", |
|
|
|
columnWidth: '200', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 811001, |
|
|
|
serialNumber: '811001Table5CreateDate', |
|
|
|
tableId: '811001Table5', |
|
|
|
tableName: '供应商合同', |
|
|
|
columnProp: 'createDate', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: 'Created Time', |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '811001Table1EstimateShare', |
|
|
|
tableId: "811001Table8", |
|
|
|
tableName: "供应商份额", |
|
|
|
columnProp: "estimateShare", |
|
|
|
headerAlign: "center", |
|
|
|
align: "right", |
|
|
|
columnLabel: "Estimate Share", |
|
|
|
columnWidth: '80', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 120 |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 811001, |
|
|
|
serialNumber: '811001Table5ValidTo', |
|
|
|
tableId: '811001Table5', |
|
|
|
tableName: '供应商合同', |
|
|
|
columnProp: 'validTo', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: 'Valid To', |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '811001Table1ActualShare', |
|
|
|
tableId: "811001Table8", |
|
|
|
tableName: "供应商份额", |
|
|
|
columnProp: "actualShare", |
|
|
|
headerAlign: "center", |
|
|
|
align: "right", |
|
|
|
columnLabel: "Actual Share", |
|
|
|
columnWidth: '80', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
], |
|
|
|
modelList:[], |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@ -251,7 +253,7 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
searchTable(){ |
|
|
|
getNewSupplierContract(this.searchData).then(({data}) => { |
|
|
|
searchSrmMaterialFamilySupplierShare(this.searchData).then(({data}) => { |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code == 0) { |
|
|
|
this.dataList = data.rows |
|
|
|
@ -262,27 +264,132 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
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.modelSearchData={ |
|
|
|
site:this.searchData.site, |
|
|
|
materialFamilyNo:this.searchData.materialFamilyNo, |
|
|
|
materialFamilyDesc:this.searchData.materialFamilyDesc, |
|
|
|
period:'', |
|
|
|
flag:0, |
|
|
|
periodStartDate:'', |
|
|
|
periodEndDate:'', |
|
|
|
detailList:[], |
|
|
|
} |
|
|
|
this.fileList=[] |
|
|
|
this.contractModelFlag=true; |
|
|
|
this.searchMaterialFamilySupplier(); |
|
|
|
this.modelFlag=true; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
searchMaterialFamilySupplier(){ |
|
|
|
searchMaterialFamilySupplierData(this.modelSearchData).then(({data}) => { |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code == 0) { |
|
|
|
this.modelList = data.rows |
|
|
|
} else { |
|
|
|
this.modelList = []; |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
saveModelData(){ |
|
|
|
if(this.modelSearchData.period==''||this.modelSearchData.period==null){ |
|
|
|
this.$message.warning('请输入Period'); |
|
|
|
return false |
|
|
|
} |
|
|
|
if(this.modelSearchData.periodStartDate==''||this.modelSearchData.periodStartDate==null){ |
|
|
|
this.$message.warning('请选择Period Start Date'); |
|
|
|
return false |
|
|
|
} |
|
|
|
if(this.modelSearchData.periodEndDate==''||this.modelSearchData.periodEndDate==null){ |
|
|
|
this.$message.warning('请输入Period End Date'); |
|
|
|
return false |
|
|
|
} |
|
|
|
this.modelSearchData.detailList=this.modelList; |
|
|
|
debugger; |
|
|
|
let allNumber=0 |
|
|
|
for (let i = 0; i <this.modelList.length ; i++) { |
|
|
|
allNumber=Number(allNumber)+Number(this.modelList[i].estimateShare?this.modelList[i].estimateShare:0) |
|
|
|
} |
|
|
|
if(allNumber==0){ |
|
|
|
this.$message.warning('请至少输入一条Share!'); |
|
|
|
return false |
|
|
|
} |
|
|
|
if(allNumber>100){ |
|
|
|
this.$message.warning('输入Share的总和不得超过100!'); |
|
|
|
return false |
|
|
|
} |
|
|
|
console.log(allNumber) |
|
|
|
saveSrmMaterialFamilySupplierShare( this.modelSearchData).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.$message.success("保存成功"); |
|
|
|
this.searchTable(); |
|
|
|
this.modelFlag=false |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
}).catch((error)=>{ |
|
|
|
this.$message.error(error); |
|
|
|
}) |
|
|
|
}, |
|
|
|
updateModel(row){ |
|
|
|
this.modelSearchData={ |
|
|
|
site:row.site, |
|
|
|
materialFamilyNo:row.materialFamilyNo, |
|
|
|
materialFamilyDesc:row.materialFamilyDesc, |
|
|
|
period:row.period, |
|
|
|
flag:1, |
|
|
|
periodStartDate:row.periodStartDate, |
|
|
|
periodEndDate:row.periodEndDate, |
|
|
|
detailList:[], |
|
|
|
} |
|
|
|
searchSrmMaterialFamilySupplierShare(this.modelSearchData).then(({data}) => { |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code == 0) { |
|
|
|
this.modelList = data.rows |
|
|
|
console.log(this.dataList) |
|
|
|
} else { |
|
|
|
this.modelList = []; |
|
|
|
} |
|
|
|
}); |
|
|
|
this.modelFlag=true; |
|
|
|
}, |
|
|
|
deleteData(row){ |
|
|
|
this.modelSearchData={ |
|
|
|
site:row.site, |
|
|
|
materialFamilyNo:row.materialFamilyNo, |
|
|
|
materialFamilyDesc:row.materialFamilyDesc, |
|
|
|
period:row.period, |
|
|
|
flag:1, |
|
|
|
periodStartDate:row.periodStartDate, |
|
|
|
periodEndDate:row.periodEndDate, |
|
|
|
detailList:[], |
|
|
|
} |
|
|
|
searchSrmMaterialFamilySupplierShare(this.modelSearchData).then(({data}) => { |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code == 0) { |
|
|
|
this.modelList = data.rows |
|
|
|
console.log(this.dataList) |
|
|
|
} else { |
|
|
|
this.modelList = []; |
|
|
|
} |
|
|
|
}); |
|
|
|
this.delModelFlag=true; |
|
|
|
}, |
|
|
|
delModelData(){ |
|
|
|
this.$confirm('确定删除整个Share?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
deleteSrmMaterialFamilySupplierShareList(this.modelList).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success("保存成功"); |
|
|
|
this.searchTable(); |
|
|
|
this.delModelFlag = false |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
}).catch((error) => { |
|
|
|
this.$message.error(error); |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |
|
|
|
@ -293,6 +400,8 @@ export default { |
|
|
|
height: auto; |
|
|
|
line-height: 1.5; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-table__fixed-right-patch { |
|
|
|
display: none !important; |
|
|
|
} |
|
|
|
|
|
|
|
</style> |