7 changed files with 1611 additions and 60 deletions
-
3src/api/srm/srmPart.js
-
304src/views/modules/srmPart/com_part_Approval.vue
-
386src/views/modules/srmPart/com_part_Attachments.vue
-
232src/views/modules/srmPart/com_part_BasicInfo.vue
-
304src/views/modules/srmPart/com_part_SpecParams.vue
-
304src/views/modules/srmPart/com_part_Suppliers.vue
-
136src/views/modules/srmPart/partInfoList.vue
@ -0,0 +1,304 @@ |
|||||
|
<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:"> |
||||
|
<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="Start"> |
||||
|
</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="End"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" @click="searchTable()">Query</el-button> |
||||
|
<!-- <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> |
||||
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
||||
|
|
||||
|
import { |
||||
|
deleteSrmMaterialFamilySupplier, deleteSrmMaterialFamilySupplierShareList, |
||||
|
saveSrmMaterialFamilySupplierShare, |
||||
|
searchMaterialFamilySupplierData, |
||||
|
searchSrmMaterialFamilySupplierShare |
||||
|
} from '../../../api/srm/srmSupplier' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
Chooselist |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dataList: [], |
||||
|
searchData: { |
||||
|
site: '', |
||||
|
username: '', |
||||
|
periodMohu: '', |
||||
|
startDate: '', |
||||
|
supplierNo: '', |
||||
|
endDate: '', |
||||
|
materialFamilyNo: '', |
||||
|
materialFamilyDesc: '', |
||||
|
height:'300', |
||||
|
page: 1, |
||||
|
limit: 1000 |
||||
|
}, |
||||
|
dataListLoading: false, |
||||
|
currentRow:'', |
||||
|
columnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
], |
||||
|
modelList:[], |
||||
|
} |
||||
|
}, |
||||
|
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(){ |
||||
|
searchSrmMaterialFamilySupplierShare(this.searchData).then(({data}) => { |
||||
|
//区分请求成功和失败的状况 |
||||
|
if (data && data.code == 0) { |
||||
|
this.dataList = data.rows |
||||
|
console.log(this.dataList) |
||||
|
} else { |
||||
|
this.dataList = []; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
addModal(){ |
||||
|
this.modelSearchData={ |
||||
|
site:this.searchData.site, |
||||
|
materialFamilyNo:this.searchData.materialFamilyNo, |
||||
|
materialFamilyDesc:this.searchData.materialFamilyDesc, |
||||
|
period:'', |
||||
|
flag:0, |
||||
|
periodStartDate:'', |
||||
|
periodEndDate:'', |
||||
|
detailList:[], |
||||
|
} |
||||
|
this.searchMaterialFamilySupplier(); |
||||
|
this.modelFlag=true; |
||||
|
}, |
||||
|
searchMaterialFamilySupplier(){ |
||||
|
searchMaterialFamilySupplierData(this.modelSearchData).then(({data}) => { |
||||
|
//区分请求成功和失败的状况 |
||||
|
if (data && data.code == 0) { |
||||
|
this.modelList = data.rows |
||||
|
} else { |
||||
|
this.modelList = []; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
.rq .auto /deep/ .el-form-item__content{ |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
/deep/ .el-table__fixed-right-patch { |
||||
|
display: none !important; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,386 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<!-- 只有附件上传功能 --> |
||||
|
<el-form label-position="top" style="margin-top: -5px;"> |
||||
|
<el-row style="margin-top: 20px"> |
||||
|
<el-col :span="4"> |
||||
|
<el-button class="customer-bun-min" type="primary" @click="handleUpload">Upload</el-button> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<!-- 文件列表表格 --> |
||||
|
<el-table |
||||
|
:height="240" |
||||
|
:data="fileList" |
||||
|
ref="fileTableRef" |
||||
|
style="width: 100%; margin-top: 20px;"> |
||||
|
<el-table-column |
||||
|
prop="fileName" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="200" |
||||
|
label="File"> |
||||
|
</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" v-if="scope.row.id" @click="handleDownload(scope.row)">View |</a> |
||||
|
<a type="text" size="small" v-if="scope.row.id" @click="deleteFileReal(scope.row)"> delete</a> |
||||
|
<a type="text" size="small" v-else @click="deleteFile(scope.$index)"> delete</a> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-form> |
||||
|
|
||||
|
<!-- File Upload 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">Drag files here, or<em> click to upload</em></div> |
||||
|
</el-upload> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label="Remark" 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">Confirm</el-button> --> |
||||
|
<el-button type="primary" :loading="uploadLoading" @click="submitData">Confirm</el-button> |
||||
|
<el-button @click="ossVisible = false">Close</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { removeOssFile } from "../../../api/srm/srmSupplier"; |
||||
|
import { downLoadObjectFile } from "../../../api/supplierStock/supplierStockRequest"; |
||||
|
import { |
||||
|
ossUploadNoSaveOSSForYJY, |
||||
|
queryOssFilePlus, |
||||
|
previewOssFileById} from "../../../api/oss/oss"; |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
height: 200, |
||||
|
fileList: [], |
||||
|
fileList2: [], |
||||
|
ossVisible: false, |
||||
|
ossForm: { |
||||
|
remark: '', |
||||
|
}, |
||||
|
uploadLoading: false, |
||||
|
// staged files selected in upload dialog but not yet persisted |
||||
|
stagedFiles: [], |
||||
|
stagedFileRemark: '', |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = (window.innerHeight - 210) / 2; |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
// 获取基础数据列表S |
||||
|
getBaseList (val, 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(){ |
||||
|
queryOssFilePlus(this.searchData).then(({data}) => { |
||||
|
//区分请求成功和失败的状况 |
||||
|
if (data && data.code == 0) { |
||||
|
this.fileList = data.rows |
||||
|
} else { |
||||
|
this.fileList = []; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
// Upload dialog open |
||||
|
handleUpload() { |
||||
|
this.$nextTick(() => { |
||||
|
if (this.$refs.upload) { |
||||
|
this.$refs.upload.clearFiles(); |
||||
|
} |
||||
|
}) |
||||
|
this.fileList2 = []; |
||||
|
this.ossForm.remark = ''; |
||||
|
this.ossVisible = true; |
||||
|
}, |
||||
|
|
||||
|
onRemoveFile(file, fileList) { |
||||
|
this.fileList2 = fileList; |
||||
|
}, |
||||
|
|
||||
|
onChangeFile(file, fileList) { |
||||
|
this.fileList2 = fileList; |
||||
|
}, |
||||
|
|
||||
|
// Stage files on dialog confirm |
||||
|
handleUploadFiles() { |
||||
|
if (this.fileList2.length === 0) { |
||||
|
this.$message.error('Please select file(s)'); |
||||
|
return; |
||||
|
} |
||||
|
this.stagedFileRemark = this.ossForm.remark || ''; |
||||
|
for (let i = 0; i < this.fileList2.length; i++) { |
||||
|
const f = this.fileList2[i].raw; |
||||
|
this.stagedFiles.push(f); |
||||
|
this.fileList.push({ |
||||
|
fileName: f.name, |
||||
|
createdBy: this.$store.state.user.name, |
||||
|
createDate: (this.dayjs ? this.dayjs().format('YYYY-MM-DD HH:mm:ss') : new Date().toISOString()), |
||||
|
_staged: true, |
||||
|
raw: f |
||||
|
}); |
||||
|
} |
||||
|
this.fileList2 = []; |
||||
|
this.ossForm.remark = ''; |
||||
|
this.ossVisible = false; |
||||
|
this.$message.success('Files staged'); |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
// Preview/download |
||||
|
handleDownload(row) { |
||||
|
// 预览文件 |
||||
|
let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp']; |
||||
|
let video = ['mp4', 'avi', 'mov', 'wmv', 'flv']; |
||||
|
let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx']; |
||||
|
let txt = ['txt']; |
||||
|
let type = ''; |
||||
|
let pdf = ['pdf']; |
||||
|
|
||||
|
if (image.includes(row.fileType.toLowerCase())) { |
||||
|
type = 'image/' + row.fileType; |
||||
|
downLoadObjectFile(row).then(({ data }) => { |
||||
|
const blob = new Blob([data], { type: type }); |
||||
|
const fileURL = URL.createObjectURL(blob); |
||||
|
window.open(fileURL, '_blank'); |
||||
|
}); |
||||
|
} else if (video.includes(row.fileType.toLowerCase())) { |
||||
|
type = 'video/' + row.fileType; |
||||
|
downLoadObjectFile(row).then(({ data }) => { |
||||
|
const blob = new Blob([data], { type: type }); |
||||
|
const fileURL = URL.createObjectURL(blob); |
||||
|
window.open(fileURL, '_blank'); |
||||
|
}); |
||||
|
} else if (txt.includes(row.fileType.toLowerCase())) { |
||||
|
type = 'text/plain'; |
||||
|
downLoadObjectFile(row).then(({ data }) => { |
||||
|
const blob = new Blob([data], { type: type }); |
||||
|
const fileURL = URL.createObjectURL(blob); |
||||
|
window.open(fileURL, '_blank'); |
||||
|
}); |
||||
|
} else if (office.includes(row.fileType.toLowerCase())) { |
||||
|
if (row.fileType.toLowerCase() === 'doc' || row.fileType.toLowerCase() === 'docx') { |
||||
|
type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; |
||||
|
} else if (row.fileType.toLowerCase() === 'ppt' || row.fileType.toLowerCase() === 'pptx') { |
||||
|
type = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; |
||||
|
} else { |
||||
|
type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; |
||||
|
} |
||||
|
downLoadObjectFile(row).then(({ data }) => { |
||||
|
const blob = new Blob([data], { type: 'application/octet-stream;charset=utf-8' }); |
||||
|
const fileName = row.fileName; |
||||
|
const linkNode = document.createElement('a'); |
||||
|
linkNode.download = fileName; |
||||
|
linkNode.style.display = 'none'; |
||||
|
linkNode.href = URL.createObjectURL(blob); |
||||
|
document.body.appendChild(linkNode); |
||||
|
linkNode.click(); |
||||
|
URL.revokeObjectURL(linkNode.href); |
||||
|
document.body.removeChild(linkNode); |
||||
|
}); |
||||
|
} else if (pdf.includes(row.fileType.toLowerCase())) { |
||||
|
type = 'application/pdf'; |
||||
|
downLoadObjectFile(row).then(({ data }) => { |
||||
|
const blob = new Blob([data], { type: type }); |
||||
|
const fileURL = URL.createObjectURL(blob); |
||||
|
window.open(fileURL, '_blank'); |
||||
|
}); |
||||
|
} else { |
||||
|
this.$message({ |
||||
|
message: 'Unsupported file type', |
||||
|
type: 'warning' |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
submitData() { |
||||
|
// 确保 addModelData 存在 |
||||
|
if (!this.addModelData) { |
||||
|
this.addModelData = {}; |
||||
|
} |
||||
|
|
||||
|
// 检查是否有文件 |
||||
|
if (this.fileList2.length === 0) { |
||||
|
this.$message.error('请选择文件'); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
this.stagedFileRemark = this.ossForm.remark || ''; |
||||
|
this.uploadLoading = true; |
||||
|
|
||||
|
// 准备要上传的文件 |
||||
|
const stagedFiles = []; |
||||
|
for (let i = 0; i < this.fileList2.length; i++) { |
||||
|
stagedFiles.push(this.fileList2[i].raw); |
||||
|
} |
||||
|
|
||||
|
// 立即关闭弹窗 |
||||
|
this.ossVisible = false; |
||||
|
this.fileList2 = []; |
||||
|
this.ossForm.remark = ''; |
||||
|
|
||||
|
// 先上传文件 |
||||
|
const uploadStagedFiles = () => { |
||||
|
const formData = new FormData(); |
||||
|
for (let i = 0; i < stagedFiles.length; i++) { |
||||
|
formData.append('file', stagedFiles[i]); |
||||
|
} |
||||
|
formData.append('orderRef1', this.searchData.orderRef1); |
||||
|
formData.append('orderRef2', this.searchData.orderRef2 || ''); |
||||
|
formData.append('orderRef3', this.searchData.orderRef3); |
||||
|
formData.append('createdBy', this.$store.state.user.name); |
||||
|
formData.append('fileRemark', this.stagedFileRemark || ''); |
||||
|
formData.append('orderReftype', 'part'); |
||||
|
|
||||
|
return ossUploadNoSaveOSSForYJY(formData); |
||||
|
}; |
||||
|
|
||||
|
uploadStagedFiles() |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
// 移除临时文件,添加上传成功的文件 |
||||
|
this.fileList = this.fileList.filter(f => !f._staged); |
||||
|
for (let i = 0; i < data.rows.length; i++) { |
||||
|
this.fileList.push(data.rows[i]); |
||||
|
} |
||||
|
|
||||
|
// 确保 addModelData.fileList 存在后再操作 |
||||
|
if (!this.addModelData.fileList) { |
||||
|
this.addModelData.fileList = []; |
||||
|
} |
||||
|
this.addModelData.fileList = this.addModelData.fileList.concat(data.rows); |
||||
|
|
||||
|
// 清除暂存数据 |
||||
|
this.stagedFiles = []; |
||||
|
this.stagedFileRemark = ''; |
||||
|
this.uploadLoading = false; |
||||
|
|
||||
|
|
||||
|
} else { |
||||
|
this.uploadLoading = false; |
||||
|
this.$message.warning(data.msg || '文件上传失败'); |
||||
|
return Promise.reject(new Error(data ? data.msg : '上传失败')); |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
.catch(err => { |
||||
|
this.uploadLoading = false; |
||||
|
this.$message.error(err.message || err); |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
deleteFileReal(row) { |
||||
|
if (!row || !row.id) return; |
||||
|
this.$confirm('Are you sure you want to delete this file?', 'Delete Confirmation', { |
||||
|
confirmButtonText: 'OK', |
||||
|
cancelButtonText: 'Cancel', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
removeOssFile([row.id]).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
const idx = this.fileList.findIndex(f => f.id === row.id); |
||||
|
if (idx !== -1) this.fileList.splice(idx, 1); |
||||
|
this.$message.success(data.msg || 'File deleted'); |
||||
|
} else { |
||||
|
this.$message.warning(data.msg || 'Delete failed'); |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
this.$message.error('Delete failed:' + (err.message || err)); |
||||
|
}); |
||||
|
}).catch(() => { }); |
||||
|
}, |
||||
|
|
||||
|
deleteFile(index) { |
||||
|
const f = this.fileList[index]; |
||||
|
if (f && f._staged && f.raw) { |
||||
|
const idx = this.stagedFiles.findIndex(sf => sf.name === f.raw.name && sf.size === f.raw.size); |
||||
|
if (idx !== -1) this.stagedFiles.splice(idx, 1); |
||||
|
} |
||||
|
this.fileList.splice(index, 1); |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<!--当前页面的标签样式--> |
||||
|
<style scoped lang="scss"> |
||||
|
.rq .auto /deep/ .el-form-item__content { |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,232 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
|
||||
|
<div |
||||
|
:style="{ minHeight: searchData.height + 'px', padding: '20px' }" |
||||
|
v-loading="dataListLoading" |
||||
|
> |
||||
|
<!-- 产品信息 --> |
||||
|
<el-form |
||||
|
:model="currentpart" |
||||
|
ref="partForm" |
||||
|
label-position="top" |
||||
|
class="part-form" |
||||
|
> |
||||
|
<div class="form-section"> |
||||
|
<el-row :gutter="20"> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="产品编码" prop="partNo"> |
||||
|
<el-input v-model="currentpart.partNo" ></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="NPC货号" prop="npc"> |
||||
|
<el-input v-model="currentpart.npc"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="产品分类" prop="category"> |
||||
|
<el-input v-model="currentpart.category"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="计量单位" prop="unit"> |
||||
|
<el-input v-model="currentpart.unit"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-row :gutter="20"> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="产品名称" prop="partDesc"> |
||||
|
<el-input v-model="currentpart.partDesc"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="产品规格" prop="partSpec"> |
||||
|
<el-input v-model="currentpart.partSpec"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-section"> |
||||
|
<el-row :gutter="20"> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="采购员" prop="buyerName"> |
||||
|
<el-input v-model="currentpart.buyerName"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="sourcing专员" prop="sourcingName"> |
||||
|
<el-input v-model="currentpart.sourcingName"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="属性模板" prop="codeNo"> |
||||
|
<el-input v-model="currentpart.codeNo"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="状态"> |
||||
|
<el-select v-model="currentpart.status" placeholder="请选择" style="width: 100%"> |
||||
|
<el-option label="启用" value="N"></el-option> |
||||
|
<el-option label="停用" value="Y"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-section"> |
||||
|
<el-row :gutter="20"> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label="备注"> |
||||
|
<el-input |
||||
|
v-model="currentpart.remark" |
||||
|
type="textarea" |
||||
|
:rows="2" |
||||
|
resize="none" |
||||
|
></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</div> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { searchPartInfo } from '@/api/srm/srmPart.js' |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
searchData: { |
||||
|
site: '', |
||||
|
partNo:'', |
||||
|
partDesc:'', |
||||
|
height: 200 |
||||
|
}, |
||||
|
tagNo: '', |
||||
|
tagNo1: '', |
||||
|
dataListLoading: false, |
||||
|
currentpart: { |
||||
|
partNo: '', |
||||
|
npc: '', |
||||
|
partDesc: '', |
||||
|
partSpec: '', |
||||
|
buyerName: '', |
||||
|
sourcingName: '', |
||||
|
category: '', |
||||
|
unit: '', |
||||
|
status: '', |
||||
|
codeNo: '', |
||||
|
createBy: '', |
||||
|
remark: '', |
||||
|
site: '' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
// 状态显示转换 |
||||
|
statusText() { |
||||
|
return this.currentpart.status === 'N' ? '启用' : |
||||
|
this.currentpart.status === 'Y' ? '停用' : '' |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取基础数据列表 |
||||
|
getBaseList(val, type) { |
||||
|
this.tagNo = val |
||||
|
this.tagNo1 = type |
||||
|
this.$nextTick(() => { |
||||
|
let strVal = '' |
||||
|
this.$refs.baseList.init(val, strVal) |
||||
|
}) |
||||
|
}, |
||||
|
/* 列表方法的回调 */ |
||||
|
getBaseData(val) { |
||||
|
// 基础数据选择回调,可根据需要实现 |
||||
|
}, |
||||
|
// 初始化组件的参数 |
||||
|
init(inData) { |
||||
|
// 初始化参数 |
||||
|
this.searchData = JSON.parse(JSON.stringify(inData)) |
||||
|
// 查询数据 |
||||
|
this.getPartData() |
||||
|
}, |
||||
|
getPartData() { |
||||
|
if (!this.searchData.partNo) { |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
this.dataListLoading = true |
||||
|
|
||||
|
searchPartInfo(this.searchData) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0 && data.data) { |
||||
|
// 将查询到的数据赋值给currentpart对象 |
||||
|
this.currentpart = { |
||||
|
partNo: data.data.partNo || '', |
||||
|
npc: data.data.npc || '', |
||||
|
partDesc: data.data.partDesc || '', |
||||
|
partSpec: data.data.partSpec || '', |
||||
|
buyerName: data.data.buyerName || '', |
||||
|
sourcingName: data.data.sourcingName || '', |
||||
|
category: data.data.category || '', |
||||
|
unit: data.data.unit || '', |
||||
|
status: data.data.status || '', |
||||
|
codeNo: data.data.codeNo || '', |
||||
|
createBy: data.data.createBy || '', |
||||
|
remark: data.data.remark || '', |
||||
|
site: data.data.site || '' |
||||
|
} |
||||
|
} else { |
||||
|
this.$message.error('查询产品信息失败:' + (data ? data.msg : '网络错误')) |
||||
|
// 清空数据 |
||||
|
this.resetPartData() |
||||
|
} |
||||
|
this.dataListLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error('查询产品信息失败:' + error.message) |
||||
|
this.resetPartData() |
||||
|
this.dataListLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
// 重置产品数据 |
||||
|
resetPartData() { |
||||
|
this.currentpart = { |
||||
|
partNo: '', |
||||
|
npc: '', |
||||
|
partDesc: '', |
||||
|
partSpec: '', |
||||
|
buyerName: '', |
||||
|
sourcingName: '', |
||||
|
category: '', |
||||
|
unit: '', |
||||
|
status: '', |
||||
|
codeNo: '', |
||||
|
createBy: '', |
||||
|
remark: '', |
||||
|
site: '' |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.customer-css { |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.form-section { |
||||
|
margin-bottom: 20px; |
||||
|
} |
||||
|
|
||||
|
.part-form { |
||||
|
width: 100%; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,304 @@ |
|||||
|
<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:"> |
||||
|
<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="Start"> |
||||
|
</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="End"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" @click="searchTable()">Query</el-button> |
||||
|
<!-- <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> |
||||
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
||||
|
|
||||
|
import { |
||||
|
deleteSrmMaterialFamilySupplier, deleteSrmMaterialFamilySupplierShareList, |
||||
|
saveSrmMaterialFamilySupplierShare, |
||||
|
searchMaterialFamilySupplierData, |
||||
|
searchSrmMaterialFamilySupplierShare |
||||
|
} from '../../../api/srm/srmSupplier' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
Chooselist |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dataList: [], |
||||
|
searchData: { |
||||
|
site: '', |
||||
|
username: '', |
||||
|
periodMohu: '', |
||||
|
startDate: '', |
||||
|
supplierNo: '', |
||||
|
endDate: '', |
||||
|
materialFamilyNo: '', |
||||
|
materialFamilyDesc: '', |
||||
|
height:'300', |
||||
|
page: 1, |
||||
|
limit: 1000 |
||||
|
}, |
||||
|
dataListLoading: false, |
||||
|
currentRow:'', |
||||
|
columnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
], |
||||
|
modelList:[], |
||||
|
} |
||||
|
}, |
||||
|
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(){ |
||||
|
searchSrmMaterialFamilySupplierShare(this.searchData).then(({data}) => { |
||||
|
//区分请求成功和失败的状况 |
||||
|
if (data && data.code == 0) { |
||||
|
this.dataList = data.rows |
||||
|
console.log(this.dataList) |
||||
|
} else { |
||||
|
this.dataList = []; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
addModal(){ |
||||
|
this.modelSearchData={ |
||||
|
site:this.searchData.site, |
||||
|
materialFamilyNo:this.searchData.materialFamilyNo, |
||||
|
materialFamilyDesc:this.searchData.materialFamilyDesc, |
||||
|
period:'', |
||||
|
flag:0, |
||||
|
periodStartDate:'', |
||||
|
periodEndDate:'', |
||||
|
detailList:[], |
||||
|
} |
||||
|
this.searchMaterialFamilySupplier(); |
||||
|
this.modelFlag=true; |
||||
|
}, |
||||
|
searchMaterialFamilySupplier(){ |
||||
|
searchMaterialFamilySupplierData(this.modelSearchData).then(({data}) => { |
||||
|
//区分请求成功和失败的状况 |
||||
|
if (data && data.code == 0) { |
||||
|
this.modelList = data.rows |
||||
|
} else { |
||||
|
this.modelList = []; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
.rq .auto /deep/ .el-form-item__content{ |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
/deep/ .el-table__fixed-right-patch { |
||||
|
display: none !important; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,304 @@ |
|||||
|
<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:"> |
||||
|
<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="Start"> |
||||
|
</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="End"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" @click="searchTable()">Query</el-button> |
||||
|
<!-- <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> |
||||
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
||||
|
|
||||
|
import { |
||||
|
deleteSrmMaterialFamilySupplier, deleteSrmMaterialFamilySupplierShareList, |
||||
|
saveSrmMaterialFamilySupplierShare, |
||||
|
searchMaterialFamilySupplierData, |
||||
|
searchSrmMaterialFamilySupplierShare |
||||
|
} from '../../../api/srm/srmSupplier' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
Chooselist |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dataList: [], |
||||
|
searchData: { |
||||
|
site: '', |
||||
|
username: '', |
||||
|
periodMohu: '', |
||||
|
startDate: '', |
||||
|
supplierNo: '', |
||||
|
endDate: '', |
||||
|
materialFamilyNo: '', |
||||
|
materialFamilyDesc: '', |
||||
|
height:'300', |
||||
|
page: 1, |
||||
|
limit: 1000 |
||||
|
}, |
||||
|
dataListLoading: false, |
||||
|
currentRow:'', |
||||
|
columnList: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
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: false |
||||
|
}, |
||||
|
], |
||||
|
modelList:[], |
||||
|
} |
||||
|
}, |
||||
|
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(){ |
||||
|
searchSrmMaterialFamilySupplierShare(this.searchData).then(({data}) => { |
||||
|
//区分请求成功和失败的状况 |
||||
|
if (data && data.code == 0) { |
||||
|
this.dataList = data.rows |
||||
|
console.log(this.dataList) |
||||
|
} else { |
||||
|
this.dataList = []; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
addModal(){ |
||||
|
this.modelSearchData={ |
||||
|
site:this.searchData.site, |
||||
|
materialFamilyNo:this.searchData.materialFamilyNo, |
||||
|
materialFamilyDesc:this.searchData.materialFamilyDesc, |
||||
|
period:'', |
||||
|
flag:0, |
||||
|
periodStartDate:'', |
||||
|
periodEndDate:'', |
||||
|
detailList:[], |
||||
|
} |
||||
|
this.searchMaterialFamilySupplier(); |
||||
|
this.modelFlag=true; |
||||
|
}, |
||||
|
searchMaterialFamilySupplier(){ |
||||
|
searchMaterialFamilySupplierData(this.modelSearchData).then(({data}) => { |
||||
|
//区分请求成功和失败的状况 |
||||
|
if (data && data.code == 0) { |
||||
|
this.modelList = data.rows |
||||
|
} else { |
||||
|
this.modelList = []; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
.rq .auto /deep/ .el-form-item__content{ |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
/deep/ .el-table__fixed-right-patch { |
||||
|
display: none !important; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue