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

报价bug

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