Browse Source

询价查询界面

master
yanyan 1 week ago
parent
commit
5b21aacdd0
  1. 3
      src/api/supplier/purQuotation.js
  2. 386
      src/views/modules/supplier/com_inquiry_Attachments.vue
  3. 385
      src/views/modules/supplier/com_inquiry_QuotationList.vue
  4. 441
      src/views/modules/supplier/purDetailList.vue
  5. 4
      src/views/modules/supplier/purHeaderList.vue

3
src/api/supplier/purQuotation.js

@ -13,3 +13,6 @@ export const searchMaterialList = (data) => createAPI(`/supplier/getPurDetailLis
export const createMaterial = (data) => createAPI(`/supplier/savePurDetail`, 'post', data)
export const updateMaterial = (data) => createAPI(`/supplier/savePurDetail`, 'post', data)
export const deleteMaterial = (data) => createAPI(`/supplier/delPurDetail`, 'post', data)
//询价查询接口
export const searchPurDetailList = (data) => createAPI(`/supplier/getPurDetailPage`, 'post', data)

386
src/views/modules/supplier/com_inquiry_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: 10px">
<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: 10px;">
<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> -->
</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 {
ossUploadNoSaveOSSForYJY,
queryOssFilePlus,
removeOss,
downLoadObjectFile
} 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', 'purQuotationDetail');
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(() => {
removeOss([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>

385
src/views/modules/supplier/com_inquiry_QuotationList.vue

@ -0,0 +1,385 @@
<template>
<div class="customer-css">
<el-form :inline="true" label-position="top" :model="searchData">
<el-form-item label="物料编码">
<el-input v-model="searchData.partNo" clearable style="width: 150px"></el-input>
</el-form-item>
<el-form-item label="物料名称">
<el-input v-model="searchData.partDesc" clearable style="width: 150px"></el-input>
</el-form-item>
<el-form-item label="状态">
<el-input v-model="searchData.remark1" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="searchTable()">查询</el-button>
<el-button type="primary" @click="addModal()">新增</el-button>
</el-form-item>
</el-form>
<el-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>
</template>
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="180"
fixed="right"
label="Actions">
<template slot-scope="scope">
<a type="text" size="small" @click="editModel(scope.row)">Edit |</a>
<a type="text" size="small" @click="deleteData(scope.row)"> Delete</a>
</template>
</el-table-column>
</el-table>
<!-- 新增/编辑弹窗 -->
<el-dialog :title="dialogTitle" :close-on-click-modal="false" v-drag :visible.sync="dialogVisible" width="900px">
<div class="dialog-content">
<el-form label-position="top" :model="formData" :rules="formRules" ref="formRef">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="物料编码" prop="partNo">
<el-input v-model="formData.partNo" placeholder="请输入物料编码"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料名称" prop="partDesc">
<el-input v-model="formData.partDesc" placeholder="请输入物料名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计量单位" prop="umid">
<el-input v-model="formData.umid" placeholder="请输入计量单位"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="询价数量" prop="qty">
<el-input v-model="formData.qty" type="number" placeholder="请输入询价数量"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="状态" prop="remark1">
<el-select v-model="formData.remark1" placeholder="请选择状态" clearable style="width: 100%">
<el-option label="询价中" value="询价中"></el-option>
<el-option label="报价中" value="报价中"></el-option>
<el-option label="已完成" value="已完成"></el-option>
<el-option label="已取消" value="已取消"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="材料费用" prop="materialCost">
<el-input v-model="formData.materialCost" type="number" placeholder="请输入材料费用"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="加工费" prop="produceFee">
<el-input v-model="formData.produceFee" type="number" placeholder="请输入加工费"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="表面处理费" prop="surfaceFee">
<el-input v-model="formData.surfaceFee" type="number" placeholder="请输入表面处理费"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="利润" prop="profit">
<el-input v-model="formData.profit" type="number" placeholder="请输入利润"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="未税单价" prop="price">
<el-input v-model="formData.price" type="number" placeholder="请输入未税单价"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率(%)" prop="taxRate">
<el-input v-model="formData.taxRate" type="number" placeholder="请输入税率"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="含税单价" prop="tax">
<el-input v-model="formData.tax" type="number" placeholder="请输入含税单价"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="关税" prop="duty">
<el-input v-model="formData.duty" type="number" placeholder="请输入关税"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="采购周期(天)" prop="purchaseCycle">
<el-input v-model="formData.purchaseCycle" type="number" placeholder="请输入采购周期"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="模具费" prop="mouldFee">
<el-input v-model="formData.mouldFee" type="number" placeholder="请输入模具费"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="附加费用" prop="additionalCost">
<el-input v-model="formData.additionalCost" type="number" placeholder="请输入附加费用"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="运费" prop="freight">
<el-input v-model="formData.freight" type="number" placeholder="请输入运费"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报价日期" prop="createdDate">
<el-date-picker v-model="formData.createdDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" style="width: 100%"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input type="textarea" :rows="3" v-model="formData.remark" placeholder="请输入备注"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div slot="footer" class="dialog-footer" style="margin-top: 20px">
<el-button type="primary" @click="submitData()">保存</el-button>
<el-button @click="dialogVisible = false">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
// API
// import {
// searchQuotationList,
// createQuotation,
// updateQuotation,
// deleteQuotation
// } from '@/api/quote/quotation'
export default {
name: 'QuotationRecord',
data() {
return {
dataList: [],
dataListLoading: false,
searchData: {
partNo: '',
partDesc: '',
remark1: '',
height: '200',
page: 1,
limit: 1000
},
dialogVisible: false,
dialogTitle: '新增报价记录',
formData: {
id: '',
partNo: '',
partDesc: '',
umid: '',
qty: '',
remark1: '',
materialCost: '',
produceFee: '',
surfaceFee: '',
profit: '',
price: '',
taxRate: '',
tax: '',
duty: '',
purchaseCycle: '',
mouldFee: '',
additionalCost: '',
freight: '',
createdDate: '',
remark: '',
createdBy: ''
},
formRules: {
partNo: [{ required: true, message: '请输入物料编码', trigger: 'blur' }]
},
columnList: [
{ columnProp: 'partNo', headerAlign: 'center', align: 'left', columnLabel: '物料编码', columnWidth: 130, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'partDesc', headerAlign: 'center', align: 'left', columnLabel: '物料名称', columnWidth: 150, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'umid', headerAlign: 'center', align: 'center', columnLabel: '计量单位', columnWidth: 90, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'qty', headerAlign: 'center', align: 'right', columnLabel: '询价数量', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'remark1', headerAlign: 'center', align: 'center', columnLabel: '状态', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'materialCost', headerAlign: 'center', align: 'right', columnLabel: '材料费用', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'produceFee', headerAlign: 'center', align: 'right', columnLabel: '加工费', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'surfaceFee', headerAlign: 'center', align: 'right', columnLabel: '表面处理费', columnWidth: 110, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'profit', headerAlign: 'center', align: 'right', columnLabel: '利润', columnWidth: 90, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'price', headerAlign: 'center', align: 'right', columnLabel: '未税单价', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'taxRate', headerAlign: 'center', align: 'right', columnLabel: '税率', columnWidth: 80, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'tax', headerAlign: 'center', align: 'right', columnLabel: '含税单价', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'duty', headerAlign: 'center', align: 'right', columnLabel: '关税', columnWidth: 90, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'purchaseCycle', headerAlign: 'center', align: 'center', columnLabel: '采购周期', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'mouldFee', headerAlign: 'center', align: 'right', columnLabel: '模具费', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'additionalCost', headerAlign: 'center', align: 'right', columnLabel: '附加费用', columnWidth: 100, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'freight', headerAlign: 'center', align: 'right', columnLabel: '运费', columnWidth: 90, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'createdDate', headerAlign: 'center', align: 'center', columnLabel: '报价日期', columnWidth: 120, fixed: '', columnHidden: false, columnSortable: true },
{ columnProp: 'remark', headerAlign: 'center', align: 'left', columnLabel: '备注', columnWidth: 180, fixed: '', columnHidden: false, columnSortable: false },
{ columnProp: 'createdBy', headerAlign: 'center', align: 'center', columnLabel: '最近更改人', columnWidth: 120, fixed: '', columnHidden: false, columnSortable: false }
]
}
},
methods: {
//
init(inData) {
if (inData) {
this.searchData = { ...this.searchData, ...inData }
}
this.searchTable()
},
//
searchTable() {
this.dataListLoading = true
// TODO:
// searchQuotationList(this.searchData).then(({ data }) => {
// if (data && data.code === 0) {
// this.dataList = data.rows
// } else {
// this.dataList = []
// }
// this.dataListLoading = false
// })
// 使
setTimeout(() => {
this.dataList = []
this.dataListLoading = false
}, 500)
},
//
addModal() {
this.dialogTitle = '新增报价记录'
this.formData = {
id: '',
partNo: '',
partDesc: '',
umid: '',
qty: '',
remark1: '',
materialCost: '',
produceFee: '',
surfaceFee: '',
profit: '',
price: '',
taxRate: '',
tax: '',
duty: '',
purchaseCycle: '',
mouldFee: '',
additionalCost: '',
freight: '',
createdDate: '',
remark: '',
createdBy: (this.$store && this.$store.state && this.$store.state.user && this.$store.state.user.name) || ''
}
this.dialogVisible = true
this.$nextTick(() => {
if (this.$refs.formRef) {
this.$refs.formRef.clearValidate()
}
})
},
//
editModel(row) {
this.dialogTitle = '编辑报价记录'
this.formData = JSON.parse(JSON.stringify(row))
this.dialogVisible = true
this.$nextTick(() => {
if (this.$refs.formRef) {
this.$refs.formRef.clearValidate()
}
})
},
//
submitData() {
this.$refs.formRef.validate((valid) => {
if (!valid) return
// TODO:
// const api = this.formData.id ? updateQuotation : createQuotation
// api(this.formData).then(({ data }) => {
// if (data && data.code === 0) {
// this.$message.success(data.msg)
// this.dialogVisible = false
// this.searchTable()
// } else {
// this.$message.warning(data.msg)
// }
// })
// 使
this.$message.success('保存成功')
this.dialogVisible = false
this.searchTable()
})
},
//
deleteData(row) {
this.$confirm('确认删除该条报价记录吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// TODO:
// deleteQuotation(row.id).then(({ data }) => {
// if (data.code === 0) {
// this.$message.success('')
// this.searchTable()
// }
// })
// 使
this.$message.success('删除成功')
this.searchTable()
}).catch(() => {})
}
}
}
</script>
<style scoped lang="scss">
.dialog-content {
width: 100%;
max-height: 60vh;
overflow-y: auto;
padding-right: 10px;
}
.customer-css {
padding: 10px;
}
</style>

441
src/views/modules/supplier/purDetailList.vue

@ -0,0 +1,441 @@
<template>
<div class="customer-css">
<!-- 查询条件 -->
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
<el-row>
<el-col :span="24">
<el-form-item label="询价单号:">
<el-input v-model="searchData.orderNo" style="width: 150px" clearable></el-input>
</el-form-item>
<el-form-item label="物料编码:">
<el-input v-model="searchData.partNo" style="width: 150px" clearable></el-input>
</el-form-item>
<el-form-item label="供应商编码:">
<el-input v-model="searchData.supplierId" style="width: 150px" clearable></el-input>
</el-form-item>
<el-form-item label="供应商名称:">
<el-input v-model="searchData.supplierName" style="width: 150px" clearable></el-input>
</el-form-item>
<el-form-item :label="'询价时间'" >
<el-date-picker
style="width: 130px"
v-model="searchData.startDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="Start">
</el-date-picker>
</el-form-item>
<el-form-item :label="'To'" >
<el-date-picker
style="width: 130px"
v-model="searchData.endDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="End">
</el-date-picker>
</el-form-item>
<el-form-item label="状态:">
<el-select v-model="searchData.status" placeholder="请选择" clearable style="width: 120px">
<el-option label="全部" value=""></el-option>
<el-option label="进行中" value="进行中"></el-option>
<el-option label="已完成" value="已完成"></el-option>
<el-option label="已取消" value="已取消"></el-option>
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button class="customer-bun-min" type="primary" @click="getMainData">查询</el-button>
<el-button @click="resetSearch" style="margin-left: 2px">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 询价列表 -->
<el-table
:height="height"
:data="mainDataList"
border
ref="mainTable"
highlight-current-row
@row-click="changeData"
v-loading="dataListLoading"
style="margin-top: 0px; width: 100%;">
<el-table-column
v-for="(item, index) in columnArray1"
:key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<!-- <el-tag v-if="item.columnProp === 'uploadFlag' && scope.row[item.columnProp] === 'Y'" type="success" size="mini">已上传</el-tag>
<el-tag v-if="item.columnProp === 'uploadFlag' && scope.row[item.columnProp] === 'N'" type="info" size="mini">未上传</el-tag> -->
</template>
</el-table-column>
<!-- 操作列 -->
<el-table-column
fixed="right"
header-align="center"
align="center"
width="180"
label="Action">
<template slot-scope="scope">
<!-- <el-link style="cursor: pointer" @click="editInquiry(scope.row)">编辑 |</el-link>
<el-link style="cursor: pointer" @click="deleteInquiry(scope.row)">删除</el-link> -->
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 0px"
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 标签页 -->
<el-tabs v-model="activeName" style="margin-top: 0px; width: 99%;" @tab-click="tabClick" class="customer-tab" type="border-card">
<el-tab-pane label="报价记录" name="quotationList">
<quotationList ref="quotationList" :height="tabHeight"></quotationList>
</el-tab-pane>
<el-tab-pane label="附件" name="attachments">
<attachments ref="attachments" :height="tabHeight"></attachments>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import {
searchPurDetailList
} from '@/api/supplier/purQuotation.js'
import quotationList from './com_inquiry_QuotationList'
import attachments from './com_inquiry_Attachments'
export default {
name: 'InquiryQuery',
components: {
quotationList,
attachments
},
data() {
return {
height: 200,
tabHeight: 300,
dataListLoading: false,
mainDataList: [],
pageIndex: 1,
pageSize: 20,
totalPage: 0,
activeName: 'quotationList',
currentRow: {},
searchData: {
orderNo: '',
partNo: '',
supplierId: '',
supplierName: '',
status: '',
site: this.$store.state.user.site,
page: 1,
limit: 20
},
//
columnArray1: [
{ columnProp: 'orderNo', columnLabel: '询价单号', columnWidth: '120', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'itemNo', columnLabel: '序号', columnWidth: '60', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'uploadFlag', columnLabel: '是否上传', columnWidth: '80', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'supplierId', columnLabel: '供应商编码', columnWidth: '120', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'supplierName', columnLabel: '供应商名称', columnWidth: '150', headerAlign: 'center', align: 'left', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'partNo', columnLabel: '物料编码', columnWidth: '120', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'partDesc', columnLabel: '物料名称', columnWidth: '150', headerAlign: 'center', align: 'left', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'umid', columnLabel: '计量单位', columnWidth: '80', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'spec', columnLabel: '规格型号', columnWidth: '150', headerAlign: 'center', align: 'left', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'qty', columnLabel: '询价数量', columnWidth: '100', headerAlign: 'center', align: 'right', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'status', columnLabel: '状态', columnWidth: '80', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'materialCost', columnLabel: '材料费用', columnWidth: '100', headerAlign: 'center', align: 'right', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'produceFee', columnLabel: '加工费', columnWidth: '100', headerAlign: 'center', align: 'right', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'surfaceFee', columnLabel: '表面处理费', columnWidth: '100', headerAlign: 'center', align: 'right', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'profit', columnLabel: '利润', columnWidth: '100', headerAlign: 'center', align: 'right', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'price', columnLabel: '未税单价', columnWidth: '100', headerAlign: 'center', align: 'right', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'taxRate', columnLabel: '税率(%)', columnWidth: '80', headerAlign: 'center', align: 'right', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'tax', columnLabel: '含税单价', columnWidth: '100', headerAlign: 'center', align: 'right', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'duty', columnLabel: '关税', columnWidth: '80', headerAlign: 'center', align: 'right', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'purchaseCycle', columnLabel: '采购周期', columnWidth: '90', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'mouldFee', columnLabel: '模具费', columnWidth: '100', headerAlign: 'center', align: 'right', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'additionalCost', columnLabel: '附加费用', columnWidth: '100', headerAlign: 'center', align: 'right', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'freight', columnLabel: '运费', columnWidth: '100', headerAlign: 'center', align: 'right', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'orderDate', columnLabel: '询价日期', columnWidth: '100', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'remark', columnLabel: '备注', columnWidth: '150', headerAlign: 'center', align: 'left', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true },
{ columnProp: 'lastUpdateBy', columnLabel: '最近更改人', columnWidth: '100', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true }
],
//
inquiryDialogVisible: false,
isAdd: true,
currentInquiry: {
orderNo: '',
itemNo: '',
uploadFlag: 'N',
supplierId: '',
supplierName: '',
partNo: '',
partDesc: '',
umid: '',
spec: '',
qty: 0,
remark2: '',
status: '进行中',
materialCost: 0,
produceFee: 0,
surfaceFee: 0,
profit: 0,
price: 0,
taxRate: 13,
tax: 0,
duty: 0,
purchaseCycle: 0,
mouldFee: 0,
additionalCost: 0,
freight: 0,
orderDate: '',
remark: '',
lastUpdateBy: '',
site: this.$store.state.user.site
},
inquiryRules: {
orderNo: [{ required: true, message: '请输入询价单号', trigger: 'blur' }],
supplierId: [{ required: true, message: '请输入供应商编码', trigger: 'blur' }],
partNo: [{ required: true, message: '请输入物料编码', trigger: 'blur' }]
}
}
},
created() {
this.getMainData()
},
mounted() {
this.$nextTick(() => {
this.height = (window.innerHeight - 280) / 2
this.tabHeight = this.height - 50
})
window.addEventListener('resize', this.handleResize)
},
beforeDestroy() {
window.removeEventListener('resize', this.handleResize)
},
methods: {
handleResize() {
this.height = (window.innerHeight - 280) / 2
this.tabHeight = this.height - 50
this.refreshCurrentTabTable()
},
resetSearch() {
this.searchData = {
orderNo: '',
partNo: '',
supplierId: '',
supplierName: '',
status: '',
site: this.$store.state.user.site,
page: 1,
limit: this.pageSize
}
this.getMainData()
},
getMainData() {
this.dataListLoading = true
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
searchPurDetailList(this.searchData).then(({ data }) => {
if (data.code === 0) {
this.mainDataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
if (this.mainDataList.length > 0) {
this.$refs.mainTable.setCurrentRow(this.mainDataList[0])
this.changeData(this.mainDataList[0])
} else {
this.changeData(null)
}
}
this.dataListLoading = false
}).catch(() => {
this.dataListLoading = false
})
},
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getMainData()
},
currentChangeHandle(val) {
this.pageIndex = val
this.getMainData()
},
changeData(row) {
this.currentRow = row ? JSON.parse(JSON.stringify(row)) : { site: '', orderNo: '', itemNo: '' }
this.refreshCurrentTabTable()
},
tabClick() {
this.refreshCurrentTabTable()
},
refreshCurrentTabTable() {
// - 使
if (!this.currentRow || !this.currentRow.orderNo) {
if (this.activeName === 'quotationList') {
if (this.$refs.quotationList) {
this.$refs.quotationList.init({ orderNo: '', itemNo: '', height: this.tabHeight })
}
} else if (this.activeName === 'attachments') {
if (this.$refs.attachments) {
this.$refs.attachments.init({
orderRef1: this.$store.state.user.site,
orderRef2: this.searchData.orderNo,
orderRef3: this.searchData.partNo,
orderReftype: 'purQuotationDetail',
height: this.tabHeight
})
}
}
return
}
if (this.activeName === 'quotationList') {
if (this.$refs.quotationList) {
this.$refs.quotationList.init({
orderNo: this.currentRow.orderNo,
itemNo: this.currentRow.itemNo,
height: this.tabHeight
})
}
} else if (this.activeName === 'attachments') {
if (this.$refs.attachments) {
this.$refs.attachments.init({
orderRef1: this.currentRow.site,
orderRef2: this.currentRow.orderNo,
orderRef3: this.currentRow.partNo,
orderReftype: 'purQuotationDetail',
height: this.tabHeight
})
}
}
},
//
addInquiry() {
this.isAdd = true
this.currentInquiry = {
orderNo: '',
itemNo: '',
uploadFlag: 'N',
supplierId: '',
supplierName: '',
partNo: '',
partDesc: '',
umid: '',
spec: '',
qty: 0,
remark2: '',
status: '进行中',
materialCost: 0,
produceFee: 0,
surfaceFee: 0,
profit: 0,
price: 0,
taxRate: 13,
tax: 0,
duty: 0,
purchaseCycle: 0,
mouldFee: 0,
additionalCost: 0,
freight: 0,
orderDate: this.$dayjs().format('YYYY-MM-DD'),
remark: '',
lastUpdateBy: this.$store.state.user.name,
site: this.$store.state.user.site
}
this.inquiryDialogVisible = true
}
}
}
</script>
<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content {
padding: 5px !important;
}
.part-dialog {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.part-dialog .el-dialog {
margin-top: 5vh !important;
margin-bottom: 5vh !important;
}
.part-dialog .el-dialog__header {
padding: 20px 25px 15px 25px;
border-bottom: 1px solid #E4E7ED;
}
.part-dialog .el-dialog__body {
padding: 25px 25px 25px 25px;
max-height: 70vh;
overflow-y: auto;
}
.dialog-content {
width: 100%;
}
.part-form {
width: 100%;
}
.part-form .el-form-item {
margin-bottom: 15px;
}
.part-form .el-form-item__label {
font-weight: 500;
color: #303133;
line-height: 32px;
padding-right: 12px;
}
.form-section {
margin-bottom: 5px;
}
.part-form .el-input-number {
width: 100%;
}
@media (max-width: 1200px) {
.part-dialog {
width: 95% !important;
}
}
@media (max-width: 768px) {
.part-form .el-col {
margin-bottom: 10px;
}
}
</style>

4
src/views/modules/supplier/purHeaderList.vue

@ -820,8 +820,8 @@ export default {
this.uploadDialogTitle = '上传附件'
this.searchParams = {
orderRef1: this.$store.state.user.site,
orderRef2: row.partNo,
orderRef3: row.partDesc,
orderRef2: row.orderNo,
orderRef3: row.partNo,
orderReftype: 'purQuotationDetail'
}

Loading…
Cancel
Save