Browse Source

产品附件上传功能,参数快捷方式,参数小写转大写

master
yanyan 1 month ago
parent
commit
ff59e8359b
  1. 3
      src/api/srm/srmPart.js
  2. 304
      src/views/modules/srmPart/com_part_Approval.vue
  3. 386
      src/views/modules/srmPart/com_part_Attachments.vue
  4. 232
      src/views/modules/srmPart/com_part_BasicInfo.vue
  5. 304
      src/views/modules/srmPart/com_part_SpecParams.vue
  6. 304
      src/views/modules/srmPart/com_part_Suppliers.vue
  7. 134
      src/views/modules/srmPart/partInfoList.vue

3
src/api/srm/srmPart.js

@ -4,4 +4,5 @@ import { createAPI } from '@/utils/httpRequest.js'
export const searchPartList = data => createAPI('/part/searchPartList', 'POST', data)
export const createPart = data => createAPI('/part/save', 'POST', data)
export const updatePart = data => createAPI('/part/save', 'POST', data)
export const deletePart = data => createAPI('/part/delete', 'POST', data)
export const searchPartInfo = data => createAPI('part/getPart','POST', data)
export const deletePart = id => createAPI('/part/delete', 'POST', { id: id })

304
src/views/modules/srmPart/com_part_Approval.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>

386
src/views/modules/srmPart/com_part_Attachments.vue

@ -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>

232
src/views/modules/srmPart/com_part_BasicInfo.vue

@ -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>

304
src/views/modules/srmPart/com_part_SpecParams.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>

304
src/views/modules/srmPart/com_part_Suppliers.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>

134
src/views/modules/srmPart/partInfoList.vue

@ -102,81 +102,71 @@
class="part-form">
<div class="form-section">
<el-row :gutter="24">
<el-col :span="8">
<el-col :span="6">
<el-form-item label="产品编码" prop="partNo">
<el-input v-model="currentpart.partNo" :disabled="!isAdd"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<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="8">
<el-form-item label="产品名称" prop="partDesc">
<el-input v-model="currentpart.partDesc"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="产品规格" prop="partSpec">
<el-input v-model="currentpart.partSpec"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item>
<span style="cursor: pointer" slot="label" @click="getBaseList(521)"><a href="#">产品分类</a></span>
<span style="cursor: pointer" slot="label" @click="getBaseList(526)"><a href="#">产品分类</a></span>
<el-input v-model="currentpart.category" style="width: 130px"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item>
<span style="cursor: pointer" slot="label" @click="getBaseList(525)"><a href="#">计量单位</a></span>
<span style="cursor: pointer" slot="label" @click="getBaseList(510)"><a href="#">计量单位</a></span>
<el-input v-model="currentpart.unit" style="width: 130px"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<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="24">
<el-col :span="8">
<el-form-item>
<el-col :span="6">
<el-form-item >
<span style="cursor: pointer" slot="label" @click="getBaseList(522)"><a href="#">采购员</a></span>
<el-input v-model="currentpart.buyerName" style="width: 130px"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-col :span="6">
<el-form-item >
<span style="cursor: pointer" slot="label" @click="getBaseList(523)"><a href="#">sourcing专员</a></span>
<el-input v-model="currentpart.sourcingName" style="width: 130px"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item>
<span style="cursor: pointer" slot="label" @click="getBaseList(524)"><a href="#">属性模板</a></span>
<el-input v-model="currentpart.codeNo" style="width: 130px"></el-input>
<span style="cursor: pointer" slot="label" @click="getBaseList(527)"><a href="#">属性模板</a></span>
<el-input v-model="currentpart.codeNo" ></el-input>
</el-form-item>
</el-col>
</el-row>
</div>
<div class="form-section">
<el-row :gutter="24">
<el-col :span="8">
<el-col :span="6">
<el-form-item label="状态">
<el-select v-model="currentpart.status" placeholder="请选择" style="width: 130px">
<el-select v-model="currentpart.status" placeholder="请选择" >
<el-option label="启用" value="N"></el-option>
<el-option label="停用" value="Y"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
</el-col>
</el-row>
</div>
@ -191,7 +181,7 @@
</div>
</el-form>
</div>
<div slot="footer" class="dialog-footer-center">
<div slot="footer" class="dialog-footer" style="margin-top: 20px">
<el-button type="primary" @click="savePart()">保存</el-button>
<el-button @click="partDialogVisible = false">取消</el-button>
</div>
@ -211,13 +201,39 @@ import {
} from '@/api/srm/srmPart.js'
import excel from '@/utils/excel-util.js'
import Chooselist from '@/views/modules/common/Chooselist_eam'
// import basicInfo from './com_part_BasicInfo'
// import specParams from './com_part_SpecParams'
// import suppliers from './com_part_Suppliers'
// import approval from './com_part_Approval'
// import attachments from './com_part_Attachments'
import basicInfo from './com_part_BasicInfo'
import specParams from './com_part_SpecParams'
import suppliers from './com_part_Suppliers'
import approval from './com_part_Approval'
import attachments from './com_part_Attachments'
export default {
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.partNo = this.searchData.partNo.toUpperCase()
this.searchData.npc = this.searchData.npc.toUpperCase()
this.searchData.category = this.searchData.category.toUpperCase()
this.searchData.unit = this.searchData.unit.toUpperCase()
this.searchData.codeNo = this.searchData.codeNo.toUpperCase()
this.searchData.partDesc = this.searchData.partDesc.toUpperCase()
this.searchData.partSpec = this.searchData.partSpec.toUpperCase()
}
},
currentpart: {
deep: true,
handler: function (newV, oldV) {
this.currentpart.partNo = this.currentpart.partNo.toUpperCase()
this.currentpart.npc = this.currentpart.npc.toUpperCase()
this.currentpart.category = this.currentpart.category.toUpperCase()
this.currentpart.unit = this.currentpart.unit.toUpperCase()
this.currentpart.codeNo = this.currentpart.codeNo.toUpperCase()
this.currentpart.partDesc = this.currentpart.partDesc.toUpperCase()
this.currentpart.partSpec = this.currentpart.partSpec.toUpperCase()
}
}
},
data () {
return {
functionId: this.$route.meta.menuId,
@ -459,7 +475,7 @@ export default {
sourcingName: '',
category: '',
unit: '',
status: 'active',
status: 'N',
codeNo: '',
createBy: '',
remark: '',
@ -478,11 +494,11 @@ export default {
/* 组件 */
components: {
Chooselist,
// basicInfo,
// specParams,
// suppliers,
// approval,
// attachments
basicInfo,
specParams,
suppliers,
approval,
attachments
},
created() {
@ -504,10 +520,11 @@ export default {
if (val === 1100) {
strVal = this.searchData.partNo
}
if (this.tagNo === 521) {
if (this.tagNo === 526) {
strVal = this.currentpart.category
}
if (this.tagNo === 525) {
if (this.tagNo === 510) {
strVal = this.currentpart.unit
}
if (val === 522) {
@ -516,7 +533,8 @@ export default {
if (val === 523) {
strVal = this.currentpart.sourcingName
}
if (val === 524) {
if (val === 527) {
strVal = this.currentpart.codeNo
}
@ -529,9 +547,10 @@ export default {
if (this.tagNo === 1100) {
this.searchData.partNo = val.part_no
}
if (this.tagNo === 521) {
if (this.tagNo === 526) {
this.currentpart.category = val.category_name
}
if (this.tagNo === 525) {
this.currentpart.unit = val.unit_code
}
@ -541,7 +560,8 @@ export default {
if (this.tagNo === 523) {
this.currentpart.sourcingName = val.sourcing_name
}
if (this.tagNo === 524) {
if (this.tagNo === 527) {
this.currentpart.codeNo = val.template_code
}
},
@ -665,9 +685,9 @@ export default {
refreshAttachments () {
let inData = {
site: this.currentRow.site,
objectNo: this.currentRow.partNo,
objectType: 'part',
orderRef1: this.currentRow.site,
orderRef2: this.currentRow.partNo,
orderRef3: this.currentRow.partDesc,
height: Number(this.height) - 20
}
this.$refs.attachments.init(inData)

Loading…
Cancel
Save