Browse Source

税率, 付款方式,交货条款,货币, 改用下拉框,选择供应商和物料的输入框,需要增加change事件

master
yanyan 4 days ago
parent
commit
e789693b11
  1. 5
      src/api/base/currency.js
  2. 5
      src/api/base/deliveryTerm.js
  3. 5
      src/api/base/paymentTerm.js
  4. 5
      src/api/base/tax.js
  5. 4
      src/api/supplier/purQuotation.js
  6. 9
      src/views/modules/supplier/com_inquiry_QuotationList.vue
  7. 1
      src/views/modules/supplier/purDetailList.vue
  8. 266
      src/views/modules/supplier/purHeaderList.vue
  9. 710
      src/views/modules/supplier/purReplyHistList.vue

5
src/api/base/currency.js

@ -0,0 +1,5 @@
import { createAPI } from '@/utils/httpRequest.js'
export const searchCurrencyList = (data) => createAPI(`/currency/getCurrencyList`, 'post', data)

5
src/api/base/deliveryTerm.js

@ -0,0 +1,5 @@
import { createAPI } from '@/utils/httpRequest.js'
export const searchDeliveryList = (data) => createAPI(`/deliveryTerm/getDeliveryList`, 'post', data)

5
src/api/base/paymentTerm.js

@ -0,0 +1,5 @@
import { createAPI } from '@/utils/httpRequest.js'
export const searchPaymentList = (data) => createAPI(`/paymentTerm/getPaymentList`, 'post', data)

5
src/api/base/tax.js

@ -0,0 +1,5 @@
import { createAPI } from '@/utils/httpRequest.js'
export const searchTaxList = (data) => createAPI(`/tax/getTaxList`, 'post', data)

4
src/api/supplier/purQuotation.js

@ -16,3 +16,7 @@ export const deleteMaterial = (data) => createAPI(`/supplier/delPurDetail`, 'pos
//询价查询接口
export const searchPurDetailList = (data) => createAPI(`/supplier/getPurDetailPage`, 'post', data)
//新增报价
export const createPurPeplyHist = (data) => createAPI(`/supplier/savePurReplyHist`, 'post', data)

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

@ -12,7 +12,7 @@
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="searchTable()">查询</el-button>
<el-button type="primary" @click="addModal()">新增</el-button>
<!-- <el-button type="primary" @click="addModal()" v-if="shouldShowButton">新增</el-button> -->
</el-form-item>
</el-form>
@ -201,6 +201,7 @@ export default {
page: 1,
limit: 1000
},
type: 'add', //
dialogVisible: false,
dialogTitle: '新增报价记录',
formData: {
@ -253,6 +254,12 @@ export default {
]
}
},
computed: {
shouldShowButton() {
//
return this.type === 'add';
}
},
methods: {
//
init(inData) {

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

@ -320,6 +320,7 @@ export default {
this.$refs.quotationList.init({
orderNo: this.currentRow.orderNo,
itemNo: this.currentRow.itemNo,
type: 'view',
height: this.tabHeight
})
}

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

@ -112,12 +112,12 @@
<el-col :span="12">
<el-form-item>
<span style="cursor: pointer" slot="label" @click="getBaseList(520)"><a href="javascript:void(0)">供应商编码</a></span>
<el-input v-model="form.supplierId" />
<el-input v-model="form.supplierId" @change="handleSupplierIdChange" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商名称" :required="true">
<el-input v-model="form.supplierName" />
<el-input v-model="form.supplierName"/>
</el-form-item>
</el-col>
</el-row>
@ -139,9 +139,30 @@
<el-input-number v-model="form.currencyRate" :precision="4" :step="0.1" style="width:100%" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="6">
<el-form-item label="税率(%)">
<el-input-number v-model="form.taxRate" :precision="2" :step="1" style="width:100%" />
<!-- <el-input-number v-model="form.taxRate" :precision="2" :step="1" style="width:100%" /> -->
<el-select v-model="taxForm.taxRate" placeholder="请选择" clearable>
<el-option
v-for = "t in taxList"
:key = "t.taxCode"
:label = "t.taxRate"
:value = "t.taxRate">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="货币">
<!-- <el-input-number v-model="form.taxRate" :precision="2" :step="1" style="width:100%" /> -->
<el-select v-model="currencyForm.currency" placeholder="请选择" clearable>
<el-option
v-for = "t in currencyList"
:key = "t.currency"
:label = "t.currencyDesc"
:value = "t.currency">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@ -154,19 +175,31 @@
</el-col>
<el-col :span="6">
<el-form-item label="付款方式">
<el-input v-model="form.paymentTermDesc" />
<!-- <el-input v-model="form.paymentTermDesc" /> -->
<el-select v-model="paymentForm.paymentTerm" placeholder="请选择" clearable>
<el-option
v-for = "t in paymentList"
:key = "t.paymentTermId"
:label = "t.paymentTerm"
:value = "t.paymentTermId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="12">
<el-form-item label="交易条款">
<el-input v-model="form.deliveryTermDesc" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="货币">
<el-input v-model="form.currency" />
<!-- <el-input v-model="form.deliveryTermDesc" /> -->
<el-select v-model="deliveryForm.deliveryTermId" placeholder="请选择" clearable style="width: 100%">
<el-option
v-for = "t in deliveryList"
:key = "t.deliveryTermId"
:label = "t.deliveryTerm"
:value = "t.deliveryTermId">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
@ -184,14 +217,7 @@
<el-input v-model="form.contact" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="状态">
<el-select v-model="form.status">
<el-option label="启用" value="Y" />
<el-option label="停用" value="N" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
@ -221,7 +247,7 @@
<el-col :span="12">
<el-form-item >
<span style="cursor: pointer" slot="label" @click="getBaseList(507)"><a href="#">物料编码</a></span>
<el-input v-model="materialForm.partNo" placeholder="请输入物料编码" />
<el-input v-model="materialForm.partNo" placeholder="请输入物料编码" @change="handlePartNoChange"/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -398,6 +424,29 @@ import {
downLoadObjectFile
} from "../../../api/oss/oss";
import {
searchTaxList
} from "@/api/base/tax.js";
import {
searchCurrencyList
} from "@/api/base/currency.js";
import {
searchPaymentList
} from "@/api/base/paymentTerm.js";
import {
searchDeliveryList
} from "@/api/base/deliveryTerm.js";
//
import {
searchPartInfo
} from '@/api/part/partInfo.js'
export default {
components: {
Chooselist
@ -411,6 +460,10 @@ export default {
submitLoading: false,
materialLoading: false,
materialSubmitLoading: false,
taxLoading: false,
currencyLoading: false,
pamentLoading: false,
deliveryLoading: false,
dataList: [],
pageIndex: 1,
pageSize: 20,
@ -422,10 +475,32 @@ export default {
supplierName: '',
status: ''
},
taxList: [],
taxForm: {
taxRate: '',
taxCode: null,
taxDesc: ''
},
currencyList: [],
currencyForm: {
currency: '',
currencyDesc: ''
},
paymentList: [],
paymentForm: {
paymentTermId: '',
paymentTerm: ''
},
deliveryList: [],
deliveryForm: {
deliveryTermId:'',
deliveryTerm:''
},
dialogVisible: false,
dialogTitle: '新增询价单',
editMode: false,
form: {
id: '',
paymentTermDesc: '',
deliveryTermDesc: '',
currency: '',
@ -493,6 +568,10 @@ export default {
// this.calcHeight()
// window.addEventListener('resize', this.calcHeight)
this.getList()
this.getTaxList()
this.getCurrencyList()
this.getPamentList()
this.getDeliveryList()
},
beforeDestroy() {
// window.removeEventListener('resize', this.calcHeight)
@ -539,12 +618,26 @@ export default {
this.materialForm.partNo = val.part_no
this.materialForm.partDesc = val.part_desc
this.materialForm.spec = val.part_spec
this.materialForm.umid = val.unit
this.getPartInfo()
}
if (this.tagNo === 510) {
this.materialForm.umid = val.UMID
}
},
//
handleSupplierIdChange(val) {
if (!val || val.trim() === '') {
return
}
//
const params = {
site: this.$store.state.user.site,
supplierNo: val.trim()
}
this.searchSupplierInfo()
},
searchSupplierInfo() {
const params = {
site: this.$store.state.user.site,
@ -557,13 +650,13 @@ export default {
this.form.phoneNo = data.row.phoneNo || this.form.phoneNo
this.form.faxNo = data.row.faxNo || this.form.faxNo
this.form.contact = data.row.contact || this.form.contact
this.form.taxRate = data.row.taxRate || this.form.taxRate
this.form.taxCode = data.row.taxCode || this.form.taxCode
this.form.paymentTerm = data.row.paymentTerm || this.form.paymentTerm
this.form.paymentTermDesc = data.row.paymentTermDesc || this.form.paymentTermDesc
this.form.deliveryTerm = data.row.deliveryTerm || this.form.deliveryTerm
this.form.deliveryTermDesc = data.row.deliveryTermDesc || this.form.deliveryTermDesc
this.form.currency = data.row.currency || this.form.currency
this.taxForm.taxRate = data.row.taxRate || this.taxForm.taxRate
this.taxForm.taxCode = data.row.taxCode || this.taxForm.taxCode
this.paymentForm.paymentTermId = data.row.paymentTerm || this.paymentForm.paymentTermId
this.paymentForm.paymentTerm = data.row.paymentTermDesc || this.paymentForm.paymentTerm
this.deliveryForm.deliveryTermId = data.row.deliveryTerm || this.deliveryForm.deliveryTermId
this.deliveryForm.deliveryTerm = data.row.deliveryTermDesc || this.deliveryForm.deliveryTerm
this.currencyForm.currency = data.row.currency || this.currencyForm.currency
} else {
this.$message.error((data && data.msg) || '获取列表失败')
}
@ -617,6 +710,84 @@ export default {
this.currentInquiry = row
this.loadMaterialList(row.orderNo)
},
//
getTaxList() {
this.taxLoading = true
searchTaxList({
site: this.$store.state.user.site
}).then(({data}) => {
if (data.code === 0) {
this.taxList = data.rows || []
} else {
this.taxList = []
}
this.taxLoading = false
}).catch(() => {
this.taxList = []
this.taxLoading = false
this.$message.error('获取税率列表失败')
})
},
//
getCurrencyList() {
this.currencyLoading = true
searchCurrencyList({
site: this.$store.state.user.site
}).then(({data}) => {
if (data.code === 0) {
this.currencyList = data.rows || []
} else {
this.currencyList = []
}
this.currencyLoading = false
}).catch(() => {
this.currencyList = []
this.currencyLoading = false
this.$message.error('获取货币列表失败')
})
},
//
getPamentList() {
this.pamentLoading = true
searchPaymentList({
site: this.$store.state.user.site
}).then(({data}) => {
if (data.code === 0) {
this.paymentList = data.rows || []
} else {
this.paymentList = []
}
this.pamentLoading = false
}).catch(() => {
this.paymentList = []
this.pamentLoading = false
this.$message.error('获取付款方式列表失败')
})
},
//
getDeliveryList() {
this.deliveryLoading = true
searchDeliveryList({
site: this.$store.state.user.site
}).then(({data}) => {
if (data.code === 0) {
this.deliveryList = data.rows || []
} else {
this.deliveryList = []
}
this.deliveryLoading = false
}).catch(() => {
this.deliveryList = []
this.deliveryLoading = false
this.$message.error('获取交易条款列表失败')
})
},
//
loadMaterialList(orderNo) {
this.materialLoading = true
@ -643,6 +814,7 @@ export default {
this.editMode = false
const today = this.getTodayDate()
this.form = {
id: '',
site: this.$store.state.user.site,
orderNo: '',
supplierId: '',
@ -698,6 +870,9 @@ export default {
this.submitLoading = false
})
},
handleDelete(row) {
this.$confirm('确定删除询价单: ' + row.orderNo + ' ?', '提示', { type: 'warning' }).then(() => {
deletePurHeader({ id: row.id }).then(({data}) => {
@ -757,6 +932,41 @@ export default {
}
this.materialDialogVisible = true
},
//
handlePartNoChange(val) {
if (!val || val.trim() === '') {
return
}
// getPartInfo
this.getPartInfo()
},
getPartInfo(){
//
const params = {
site: this.$store.state.user.site,
partNo: this.materialForm.partNo
}
searchPartInfo(params).then(({data}) => {
console.log(data)
if (data.code === 0) {
//
this.materialForm.partNo = data.data.partNo || val
this.materialForm.partDesc = data.data.partDesc || this.materialForm.partDesc
this.materialForm.spec = data.data.partSpec || this.materialForm.spec
this.materialForm.umid = data.data.unit || this.materialForm.umid
this.$message.success('已自动获取物料信息')
} else {
this.$message.warning('未找到该物料信息,请手动填写')
}
}).catch(() => {
this.$message.error('获取物料信息失败')
})
},
saveMaterial() {
if (!this.materialForm.partNo) {
this.$message.warning('物料编码不能为空')

710
src/views/modules/supplier/purReplyHistList.vue

@ -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>
Loading…
Cancel
Save