Commit 974fc4e8 authored by 仇晓婷's avatar 仇晓婷

报价bug

parent f94fa56e
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
:mask-closable="false" :mask-closable="false"
fullscreen fullscreen
footer-hide footer-hide
@on-cancel="cancel"
> >
<Form :model="formItem" :label-width="80"> <Form :model="formItem" :label-width="80">
<Row type="flex" justify="space-between"> <Row type="flex" justify="space-between">
...@@ -70,12 +71,12 @@ ...@@ -70,12 +71,12 @@
</template> </template>
<script> <script>
import PhotosensitiveGeneration from '../components/photosensitiveGeneration.vue' //生成报价单弹框 import PhotosensitiveGeneration from "../components/photosensitiveGeneration.vue"; //生成报价单弹框
export default { export default {
components: { components: {
PhotosensitiveGeneration PhotosensitiveGeneration
}, },
name: '', name: "",
props: { props: {
gmData: Array gmData: Array
}, },
...@@ -85,98 +86,98 @@ export default { ...@@ -85,98 +86,98 @@ export default {
result: [] result: []
}, },
row: {}, row: {},
index: '', index: "",
newList: [], newList: [],
formItem: { formItem: {
postCompany: '', postCompany: "",
contactUser: '', contactUser: "",
contactTel: '', contactTel: "",
quotationType: '光敏树脂', quotationType: "光敏树脂",
remark: '' remark: ""
}, },
values1: '', values1: "",
values2: '', values2: "",
values3: '', values3: "",
modalShow: false, modalShow: false,
columns: [ columns: [
{ {
title: '序号', title: "序号",
type: 'index', type: "index",
width: 50, width: 50,
align: 'center' align: "center"
}, },
{ {
title: '订单编号', title: "订单编号",
key: 'mesCode', key: "mesCode",
align: 'center', align: "center",
minWidth: 120 minWidth: 120
}, },
{ {
title: '产品名称', title: "产品名称",
key: 'productName', key: "productName",
align: 'center', align: "center",
minWidth: 80 minWidth: 80
}, },
{ {
title: '重量(g)', title: "重量(g)",
key: 'materialWeight', key: "materialWeight",
align: 'center', align: "center",
minWidth: 80, minWidth: 80,
slot: 'slot1' slot: "slot1"
}, },
{ {
title: '单价(元/g)', title: "单价(元/g)",
key: 'materialUnitPrice', key: "materialUnitPrice",
align: 'center', align: "center",
minWidth: 80, minWidth: 80,
slot: 'slot2' slot: "slot2"
}, },
{ {
title: '3D打印费', title: "3D打印费",
align: 'center', align: "center",
key: 'printPrice', key: "printPrice",
minWidth: 60, minWidth: 60,
slot: 'slot3' slot: "slot3"
}, },
{ {
title: '尺寸检测费', title: "尺寸检测费",
key: 'sizeCheckPrice', key: "sizeCheckPrice",
align: 'center', align: "center",
minWidth: 60, minWidth: 60,
slot: 'slot4' slot: "slot4"
}, },
{ {
title: '单价(元)', title: "单价(元)",
key: 'unitPrice', key: "unitPrice",
align: 'center', align: "center",
minWidth: 60, minWidth: 60,
slot: 'slot6' slot: "slot6"
}, },
{ {
title: '数量', title: "数量",
key: 'num', key: "num",
align: 'center', align: "center",
minWidth: 70 minWidth: 70
}, },
{ {
title: '价格(元)', title: "价格(元)",
key: 'price', key: "price",
align: 'center', align: "center",
minWidth: 80, minWidth: 80,
slot: 'slot7' slot: "slot7"
}, },
{ {
title: '备注', title: "备注",
key: 'remark1', key: "remark1",
align: 'center', align: "center",
minWidth: 200, minWidth: 200,
slot: 'slot5', slot: "slot5",
tooltip: true tooltip: true
} }
] ]
} };
}, },
// watch: { // watch: {
// row: { // row: {
...@@ -195,102 +196,105 @@ export default { ...@@ -195,102 +196,105 @@ export default {
//计算3D打印费=重量(g)*单价(元/g) //计算3D打印费=重量(g)*单价(元/g)
return (this.row.printPrice = return (this.row.printPrice =
parseInt(this.row.materialWeight) * parseInt(this.row.materialWeight) *
parseInt(this.row.materialUnitPrice)) parseInt(this.row.materialUnitPrice));
}, },
unitPrices() { unitPrices() {
//单价=3D打印费+尺寸检测费 //单价=3D打印费+尺寸检测费
return (this.row.unitPrice = return (this.row.unitPrice =
parseInt(this.row.printPrice) + parseInt(this.row.sizeCheckPrice)) parseInt(this.row.printPrice) + parseInt(this.row.sizeCheckPrice));
}, },
prices() { prices() {
// 价格=单价*数量 // 价格=单价*数量
return (this.row.price = return (this.row.price =
parseInt(this.row.unitPrice) * parseInt(this.row.num)) parseInt(this.row.unitPrice) * parseInt(this.row.num));
} }
}, },
methods: { methods: {
previousStep() { previousStep() {
this.modalShow = false this.modalShow = false;
}, },
quotationBox() { quotationBox() {
//订单报价 //订单报价
let item = [] let item = [];
let quotationMain = {} let quotationMain = {};
let data = { let data = {
quotationMain: this.formItem, quotationMain: this.formItem,
item: this.gmData item: this.gmData
} };
var url = `${PlanUrl}/quotationmain/createorupdate` var url = `${PlanUrl}/quotationmain/createorupdate`;
this.$api this.$api
.post(url, data) .post(url, data)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.$Message.success('保存成功') this.$Message.success("保存成功");
this.$refs.photosensitive.modalShow = true this.$refs.photosensitive.modalShow = true;
let id = res.result.id let id = res.result.id;
this.$http.quotation this.$http.quotation
.orderList({ .orderList({
id: id id: id
}) })
.then((res) => { .then(res => {
console.log(res) console.log(res);
res.result.forEach((data, index) => { res.result.forEach((data, index) => {
res.result[index].quotationId = id res.result[index].quotationId = id;
}) });
this.zPhotosensitive.result = res.result this.zPhotosensitive.result = res.result;
})
.catch((error) => {
this.$Message.error('请求失败')
}) })
.catch(error => {
this.$Message.error("请求失败");
});
} }
}) })
.catch((error) => { .catch(error => {
this.$Message.error('保存失败') this.$Message.error("保存失败");
}) });
}, },
close() { close() {
this.modalShow = false this.modalShow = false;
this.$emit('update') this.$emit("update");
}, },
show1(row, index) { show1(row, index) {
this.row = row this.row = row;
this.gmData.forEach((data, index) => { this.gmData.forEach((data, index) => {
if (this.gmData[index].mesCode === row.mesCode) { if (this.gmData[index].mesCode === row.mesCode) {
this.gmData[index] = row this.gmData[index] = row;
} }
}) });
}, },
show2(row, index) { show2(row, index) {
this.row = row this.row = row;
this.gmData.forEach((data, index) => { this.gmData.forEach((data, index) => {
if (this.gmData[index].mesCode === row.mesCode) { if (this.gmData[index].mesCode === row.mesCode) {
this.gmData[index] = row this.gmData[index] = row;
} }
}) });
}, },
show3(row, index) { show3(row, index) {
this.row = row this.row = row;
this.gmData.forEach((data, index) => { this.gmData.forEach((data, index) => {
if (this.gmData[index].mesCode === row.mesCode) { if (this.gmData[index].mesCode === row.mesCode) {
this.gmData[index] = row this.gmData[index] = row;
} }
}) });
}, },
//备注 //备注
show4(row, index) { show4(row, index) {
this.row = row this.row = row;
this.gmData.forEach((data, index) => { this.gmData.forEach((data, index) => {
if (this.gmData[index].mesCode === row.mesCode) { if (this.gmData[index].mesCode === row.mesCode) {
this.gmData[index] = row this.gmData[index] = row;
} }
}) });
},
cancel() {
this.$emit("update");
} }
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.footers { .footers {
......
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
<!-- 高级搜索弹框 --> <!-- 高级搜索弹框 -->
<Search-Box ref="searchBox" @heightSearch="gSearch"></Search-Box> <Search-Box ref="searchBox" @heightSearch="gSearch"></Search-Box>
<!-- 订单报价 --> <!-- 订单报价 -->
<Quotation-Box ref="quotationBox" :bjData="newJsData"></Quotation-Box> <Quotation-Box ref="quotationBox" :bjData="newJsData" @update="update"></Quotation-Box>
<Metal-Quotation ref="metalQuotation" :gmData="newJsData" @update="update"></Metal-Quotation> <Metal-Quotation ref="metalQuotation" :gmData="newJsData" @update="update"></Metal-Quotation>
<Photosensitive ref="photosensitive" :gmData="newJsData" @update="update"></Photosensitive> <Photosensitive ref="photosensitive" :gmData="newJsData" @update="update"></Photosensitive>
<Metal-Details ref="metalDetail" :resultDetils="resultDetils"></Metal-Details> <Metal-Details ref="metalDetail" :resultDetils="resultDetils"></Metal-Details>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment