3 changed files with 408 additions and 10 deletions
-
390src/views/modules/srmSupplier/com_supplierShare_share.vue
-
8src/views/modules/srmSupplier/com_supplierShare_supplierList.vue
-
20src/views/modules/srmSupplier/supplierShare.vue
@ -0,0 +1,390 @@ |
|||||
|
<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-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=" "> |
||||
|
<el-button type="primary" @click="addModal()">新增</el-button> |
||||
|
</el-form-item> |
||||
|
</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: '811031Table3Period', |
||||
|
tableId: "811031Table3", |
||||
|
tableName: "供应商份额", |
||||
|
columnProp: "period", |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: "Period", |
||||
|
columnWidth: '100', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: '811031Table1PeriodStartDate', |
||||
|
tableId: "811031Table3", |
||||
|
tableName: "供应商份额", |
||||
|
columnProp: "periodStartDate", |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: "Period Start Date", |
||||
|
columnWidth: '100', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: '811031Table1PeriodEndDate', |
||||
|
tableId: "811031Table3", |
||||
|
tableName: "供应商份额", |
||||
|
columnProp: "periodEndDate", |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: "Period End Date", |
||||
|
columnWidth: '100', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: '811031Table1SupplierNo', |
||||
|
tableId: "811031Table3", |
||||
|
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: "811031Table3", |
||||
|
tableName: "供应商份额", |
||||
|
columnProp: "supplierName", |
||||
|
headerAlign: "center", |
||||
|
align: "left", |
||||
|
columnLabel: "Supplier Name", |
||||
|
columnWidth: '200', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: '811031Table1EstimateShare', |
||||
|
tableId: "811031Table3", |
||||
|
tableName: "供应商份额", |
||||
|
columnProp: "estimateShare", |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: "Estimate Share", |
||||
|
columnWidth: '80', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: '811031Table1ActualShare', |
||||
|
tableId: "811031Table3", |
||||
|
tableName: "供应商份额", |
||||
|
columnProp: "actualShare", |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: "Actual Share", |
||||
|
columnWidth: '80', |
||||
|
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> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue