9 changed files with 981 additions and 29 deletions
-
5src/api/base/currency.js
-
5src/api/base/deliveryTerm.js
-
5src/api/base/paymentTerm.js
-
5src/api/base/tax.js
-
4src/api/supplier/purQuotation.js
-
9src/views/modules/supplier/com_inquiry_QuotationList.vue
-
1src/views/modules/supplier/purDetailList.vue
-
266src/views/modules/supplier/purHeaderList.vue
-
710src/views/modules/supplier/purReplyHistList.vue
@ -0,0 +1,5 @@ |
|||
import { createAPI } from '@/utils/httpRequest.js' |
|||
|
|||
|
|||
export const searchCurrencyList = (data) => createAPI(`/currency/getCurrencyList`, 'post', data) |
|||
|
|||
@ -0,0 +1,5 @@ |
|||
import { createAPI } from '@/utils/httpRequest.js' |
|||
|
|||
|
|||
export const searchDeliveryList = (data) => createAPI(`/deliveryTerm/getDeliveryList`, 'post', data) |
|||
|
|||
@ -0,0 +1,5 @@ |
|||
import { createAPI } from '@/utils/httpRequest.js' |
|||
|
|||
|
|||
export const searchPaymentList = (data) => createAPI(`/paymentTerm/getPaymentList`, 'post', data) |
|||
|
|||
@ -0,0 +1,5 @@ |
|||
import { createAPI } from '@/utils/httpRequest.js' |
|||
|
|||
|
|||
export const searchTaxList = (data) => createAPI(`/tax/getTaxList`, 'post', data) |
|||
|
|||
@ -0,0 +1,710 @@ |
|||
<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-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-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> |
|||
</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="openQuoteDialog(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> |
|||
|
|||
<!-- 报价信息新增弹出框 --> |
|||
<el-dialog |
|||
title="报价信息" |
|||
:visible.sync="quoteDialogVisible" |
|||
width="600px" |
|||
top="3vh" |
|||
:close-on-click-modal="false" |
|||
class="part-dialog"> |
|||
<div class="dialog-content"> |
|||
<el-form |
|||
:model="quoteForm" |
|||
:rules="quoteRules" |
|||
ref="quoteForm" |
|||
label-position="top" |
|||
class="part-form"> |
|||
|
|||
<!-- 基础信息 --> |
|||
<div class="form-section"> |
|||
<div class="section-title">基础信息</div> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="6"> |
|||
<el-form-item label="物料编码" prop="partNo"> |
|||
<el-input v-model="quoteForm.partNo" :disabled="true" placeholder="物料编码"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="物料名称" prop="partDesc"> |
|||
<el-input v-model="quoteForm.partDesc" :disabled="true" placeholder="物料名称"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="规格型号" prop="spec"> |
|||
<el-input v-model="quoteForm.spec" :disabled="true" placeholder="规格型号"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="询价数量" prop="qty"> |
|||
<el-input-number v-model="quoteForm.qty" :disabled="true" :min="0" style="width: 100%"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20"> |
|||
|
|||
<el-col :span="6"> |
|||
<el-form-item label="计量单位" prop="umid"> |
|||
<el-input v-model="quoteForm.umid" :disabled="true" placeholder="计量单位"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
|
|||
|
|||
</el-row> |
|||
|
|||
</div> |
|||
|
|||
<!-- 费用信息 --> |
|||
<div class="form-section"> |
|||
<div class="section-title">费用信息</div> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="6"> |
|||
<el-form-item label="材料费用" prop="materialCost"> |
|||
<el-input-number v-model="quoteForm.materialCost" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="加工费" prop="produceFee"> |
|||
<el-input-number v-model="quoteForm.produceFee" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="表面处理费" prop="surfaceFee"> |
|||
<el-input-number v-model="quoteForm.surfaceFee" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="利润" prop="profit"> |
|||
<el-input-number v-model="quoteForm.profit" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="6"> |
|||
<el-form-item label="模具费" prop="mouldFee"> |
|||
<el-input-number v-model="quoteForm.mouldFee" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="附加费用" prop="additionalCost"> |
|||
<el-input-number v-model="quoteForm.additionalCost" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="运费" prop="freight"> |
|||
<el-input-number v-model="quoteForm.freight" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="采购周期(天)" prop="purchaseCycle"> |
|||
<el-input-number v-model="quoteForm.purchaseCycle" :min="0" :precision="0" style="width: 100%"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20"> |
|||
|
|||
<el-col :span="6"> |
|||
<el-form-item label="关税" prop="duty"> |
|||
<el-input-number v-model="quoteForm.duty" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</div> |
|||
|
|||
<!-- 价格信息 --> |
|||
<div class="form-section"> |
|||
<div class="section-title">价格信息</div> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="8"> |
|||
<el-form-item label="未税单价" prop="price"> |
|||
<el-input-number v-model="quoteForm.price" :precision="4" :min="0" style="width: 100%" @change="calculateTax"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="税率(%)" prop="taxRate"> |
|||
<el-input-number v-model="quoteForm.taxRate" :precision="2" :min="0" :max="100" style="width: 100%" @change="calculateTax"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="含税单价" prop="tax"> |
|||
<el-input-number v-model="quoteForm.tax" :precision="4" :min="0" style="width: 100%"></el-input-number> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</div> |
|||
|
|||
<!-- 其他信息 --> |
|||
<div class="form-section"> |
|||
<div class="section-title">其他信息</div> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="24"> |
|||
<el-form-item label="其他要求" prop="otherCondition"> |
|||
<el-input v-model="quoteForm.otherCondition" type="textarea" :rows="1" placeholder="其他要求"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="24"> |
|||
<el-form-item label="特殊要求" prop="remark2"> |
|||
<el-input v-model="quoteForm.remark2" type="textarea" :rows="1" placeholder="请输入特殊要求"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="24"> |
|||
<el-form-item label="备注" prop="remark"> |
|||
<el-input v-model="quoteForm.remark" type="textarea" :rows="1" placeholder="请输入备注"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
|
|||
</div> |
|||
</el-form> |
|||
</div> |
|||
<div slot="footer" class="dialog-footer" style="margin-top: 20px; text-align: center;"> |
|||
<el-button type="primary" @click="submitQuote">提交报价</el-button> |
|||
<el-button @click="quoteDialogVisible = false">取消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import { |
|||
searchPurDetailList, |
|||
createPurPeplyHist |
|||
} 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: '', |
|||
startDate: '', |
|||
endDate: '', |
|||
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: 'orderDate', columnLabel: '询价日期', columnWidth: '100', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true }, |
|||
{ columnProp: 'wantReplyDate', columnLabel: '要求报价日期', columnWidth: '100', 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: '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: 'remark2', columnLabel: '特殊要求', columnWidth: '80', headerAlign: 'center', align: 'center', 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: 'buyer', columnLabel: '采购员', columnWidth: '120', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true }, |
|||
{ columnProp: 'paymentTermDesc', columnLabel: '付款方式', columnWidth: '80', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true }, |
|||
{ columnProp: 'deliveryTermDesc', columnLabel: '交易条款', columnWidth: '120', headerAlign: 'center', align: 'center', fixed: false, columnHidden: false, columnSortable: false, showOverflowTooltip: true }, |
|||
{ columnProp: 'otherCondition', columnLabel: '其他要求', columnWidth: '120', 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: 'remark', columnLabel: '备注', columnWidth: '150', headerAlign: 'center', align: 'left', 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 } |
|||
], |
|||
// 报价对话框相关 |
|||
quoteDialogVisible: false, |
|||
quoteForm: { |
|||
// 基础信息 |
|||
partNo: '', |
|||
partDesc: '', |
|||
spec: '', |
|||
qty: 0, |
|||
umid: '', |
|||
otherCondition: '', |
|||
// 费用信息 |
|||
materialCost: 0, |
|||
produceFee: 0, |
|||
surfaceFee: 0, |
|||
profit: 0, |
|||
mouldFee: 0, |
|||
additionalCost: 0, |
|||
freight: 0, |
|||
purchaseCycle: 0, |
|||
duty: 0, |
|||
// 价格信息 |
|||
price: 0, |
|||
taxRate: 13, |
|||
tax: 0, |
|||
// 其他信息 |
|||
remark2: '', |
|||
remark: '', |
|||
// 关联信息 |
|||
orderNo: '', |
|||
itemNo: '', |
|||
supplierId: '', |
|||
supplierName: '', |
|||
site: this.$store.state.user.site, |
|||
createdBy: this.$store.state.user.name |
|||
}, |
|||
quoteRules: { |
|||
price: [{ required: true, message: '请输入未税单价', trigger: 'blur' }], |
|||
taxRate: [{ 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: '', |
|||
startDate: '', |
|||
endDate: '', |
|||
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 |
|||
}) |
|||
} |
|||
} |
|||
}, |
|||
// 打开报价对话框 |
|||
openQuoteDialog(row) { |
|||
if (!row) { |
|||
this.$message.warning('请选择要报价的询价单') |
|||
return |
|||
} |
|||
// 填充表单数据 |
|||
this.quoteForm = { |
|||
// 基础信息 |
|||
partNo: row.partNo || '', |
|||
partDesc: row.partDesc || '', |
|||
spec: row.spec || '', |
|||
qty: row.qty || 0, |
|||
umid: row.umid || '', |
|||
otherCondition: row.otherCondition || '', |
|||
status: '已报价', |
|||
// 费用信息 |
|||
materialCost: row.materialCost || 0, |
|||
produceFee: row.produceFee || 0, |
|||
surfaceFee: row.surfaceFee || 0, |
|||
profit: row.profit || 0, |
|||
mouldFee: row.mouldFee || 0, |
|||
additionalCost: row.additionalCost || 0, |
|||
freight: row.freight || 0, |
|||
purchaseCycle: row.purchaseCycle || 0, |
|||
duty: row.duty || 0, |
|||
// 价格信息 |
|||
price: row.price || 0, |
|||
taxRate: row.taxRate || 0, |
|||
tax: row.tax || 0, |
|||
// 其他信息 |
|||
remark2: row.remark2 || '', |
|||
remark: row.remark || '', |
|||
// 关联信息 |
|||
orderNo: row.orderNo, |
|||
itemNo: row.itemNo, |
|||
supplierId: row.supplierId || this.$store.state.user.supplierId, |
|||
supplierName: row.supplierName || this.$store.state.user.supplierName, |
|||
site: this.$store.state.user.site, |
|||
createdBy: this.$store.state.user.name |
|||
} |
|||
// 计算含税单价 |
|||
this.calculateTax() |
|||
this.quoteDialogVisible = true |
|||
}, |
|||
// 计算含税单价 |
|||
calculateTax() { |
|||
if (this.quoteForm.price && this.quoteForm.taxRate) { |
|||
this.quoteForm.tax = this.quoteForm.price * (1 + this.quoteForm.taxRate / 100) |
|||
} |
|||
}, |
|||
// 提交报价 |
|||
submitQuote() { |
|||
this.$refs.quoteForm.validate((valid) => { |
|||
if (valid) { |
|||
// 计算总成本(可选) |
|||
const totalCost = this.quoteForm.materialCost + this.quoteForm.produceFee + |
|||
this.quoteForm.surfaceFee + this.quoteForm.profit + |
|||
this.quoteForm.mouldFee + this.quoteForm.additionalCost + |
|||
this.quoteForm.freight + this.quoteForm.duty |
|||
|
|||
const submitData = { |
|||
...this.quoteForm, |
|||
totalCost: totalCost |
|||
} |
|||
|
|||
createPurPeplyHist(submitData).then(({ data }) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success('报价提交成功') |
|||
this.quoteDialogVisible = false |
|||
// 刷新报价记录列表 |
|||
this.refreshCurrentTabTable() |
|||
// 刷新主列表状态 |
|||
this.getMainData() |
|||
} else { |
|||
this.$message.error(data.msg || '报价提交失败') |
|||
} |
|||
}).catch(error => { |
|||
this.$message.error('报价提交失败: ' + error.message) |
|||
}) |
|||
} else { |
|||
this.$message.warning('请填写必填字段') |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</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: 75vh; |
|||
overflow-y: auto; |
|||
min-height: 400px; |
|||
} |
|||
|
|||
.dialog-content { |
|||
width: 100%; |
|||
} |
|||
|
|||
/* 产品表单样式 */ |
|||
.part-form { |
|||
width: 100%; |
|||
} |
|||
|
|||
.part-form .el-form-item { |
|||
margin-bottom: 1px; |
|||
} |
|||
|
|||
.part-form .el-form-item__label { |
|||
font-weight: 500; |
|||
color: #303133; |
|||
line-height: 32px; |
|||
padding-right: 12px; |
|||
} |
|||
|
|||
.part-form .el-form-item__content { |
|||
line-height: normal; |
|||
} |
|||
|
|||
/* 表单分组样式 */ |
|||
.form-section { |
|||
margin-bottom: 5px; |
|||
font-size: 12px; |
|||
font-weight: 600; |
|||
color: #409EFF; |
|||
margin: 5px 0 5px 0; |
|||
} |
|||
|
|||
.form-section:last-child { |
|||
margin-bottom: 5px; |
|||
} |
|||
|
|||
/* 输入框样式 */ |
|||
.part-form .el-input, |
|||
.part-form .el-textarea, |
|||
.part-form .el-date-editor { |
|||
width: 100%; |
|||
} |
|||
|
|||
/* 文本域样式优化 */ |
|||
.part-form .el-textarea__inner { |
|||
resize: none; |
|||
font-family: inherit; |
|||
line-height: 1.5; |
|||
} |
|||
|
|||
/* 对话框底部按钮居中 */ |
|||
.dialog-footer-center { |
|||
text-align: center; |
|||
padding: 15px 0 5px 0; |
|||
border-top: 1px solid #E4E7ED; |
|||
margin-top: 15px; |
|||
} |
|||
|
|||
.dialog-footer-center .el-button { |
|||
margin: 0 10px; |
|||
min-width: 90px; |
|||
height: 36px; |
|||
padding: 0 20px; |
|||
font-size: 14px; |
|||
} |
|||
|
|||
/* 响应式调整 */ |
|||
@media (max-width: 1200px) { |
|||
.part-dialog { |
|||
width: 95% !important; |
|||
} |
|||
|
|||
.part-dialog .el-dialog__body { |
|||
padding: 20px 20px 15px 20px; |
|||
} |
|||
} |
|||
|
|||
@media (max-width: 768px) { |
|||
.part-form .el-col { |
|||
margin-bottom: 20px; |
|||
} |
|||
|
|||
.form-section { |
|||
margin-bottom: 35px; |
|||
} |
|||
|
|||
.part-form .el-form-item__label { |
|||
line-height: 28px; |
|||
height: 28px; |
|||
} |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue