|
@@ -229,7 +229,7 @@
|
|
|
</avue-form>
|
|
|
</trade-card>
|
|
|
<goods-info ref="goodsInfo" :form="form" :data="data" :detailData="detailData" :orderFeesList.sync="orderFeesList"
|
|
|
- @formGoodstoFees="formGoodstoFees" @backToList="getDetail" @goodsoptionsfun="goodsoptionsfun"></goods-info>
|
|
|
+ @formGoodstoFees="formGoodstoFees" @backToList="getDetail" ></goods-info>
|
|
|
<!-- <trade-card title="商品信息">
|
|
|
<avue-crud ref="crud" :data="data" :option="tableOption" @row-del="rowDel"
|
|
|
@selection-change="goodsSelectionChange" @saveColumn="saveColumn" @resetColumn="resetColumn"
|
|
@@ -1229,6 +1229,8 @@ export default {
|
|
|
goodsInfo
|
|
|
},
|
|
|
async created() {
|
|
|
+ const pricebank = await getPricebankAll({ billType: "CG", statusTime: dateFormat(new Date(), "yyyy-MM-dd") })
|
|
|
+ this.goodsoptions = pricebank.data.data
|
|
|
// 获取运输方式数据
|
|
|
this.getDictionaryfun()
|
|
|
if (this.detailData.id) {
|
|
@@ -2184,10 +2186,6 @@ export default {
|
|
|
}
|
|
|
this.dialogVisible = !this.dialogVisible;
|
|
|
},
|
|
|
- // 获取商品列表数据 保存的时候循环使用
|
|
|
- goodsoptionsfun(list){
|
|
|
- this.goodsoptions = list
|
|
|
- },
|
|
|
getDetail(id) {
|
|
|
this.showBut = false;
|
|
|
this.pageLoading = true;
|
|
@@ -2298,6 +2296,10 @@ export default {
|
|
|
},
|
|
|
//修改提交触发
|
|
|
editCustomer(status) {
|
|
|
+ if (this.goodsoptions.length == 0) {
|
|
|
+ this.$message.warning('数据正在加载,请稍后重试!!');
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
@@ -2310,22 +2312,22 @@ export default {
|
|
|
if (this.data[i].corpId == null) {
|
|
|
return this.$message.error(`请输入第${i + 1}行的供应商`);
|
|
|
}
|
|
|
- // 复制的重新进行计算
|
|
|
- for (let item of this.goodsoptions) {
|
|
|
- if (item.itemId == this.data[i].itemId) {
|
|
|
- this.data[i].exchangeRate = this.form.exchangeRate,
|
|
|
- this.data[i].orderQuantity = 0
|
|
|
- this.data[i].partsPrice = 0
|
|
|
- this.data[i].purchaseCost = costCal(item.price, item.taxRate);
|
|
|
- this.data[i].purchaseAmount = item.purchaseAmount
|
|
|
- this.data[i].productPrice = productCal(item.purchaseAmount, 0, this.form.coefficient);
|
|
|
- this.data[i].outFactoryPrice = sellingCal(productCal(item.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
|
|
|
- this.data[i].totalValue = sellingCal(productCal(item.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
|
|
|
- this.data[i].price = sellingCal(productCal(item.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
|
|
|
- this.data[i].amount = sellingCal(productCal(item.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
|
|
|
- this.data[i].itemMargin = grossProfitCal(item.purchaseAmount, 0, sellingCal(productCal(item.purchaseAmount, 0, this
|
|
|
- .form.coefficient), this.form.exchangeRate), this.form.exchangeRate);
|
|
|
- }
|
|
|
+ if (this.detailData.status == 'copy') {
|
|
|
+ // 复制的重新进行计算
|
|
|
+ for (let item of this.goodsoptions) {
|
|
|
+ if (item.itemId == this.data[i].itemId) {
|
|
|
+ this.data[i].purchaseAmount = item.purchaseAmount
|
|
|
+ this.data[i].productPrice = productCal(item.purchaseAmount, 0, item.coefficient);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 处理金额
|
|
|
+ this.data[i].amount = amountCal(
|
|
|
+ this.data[i].price,
|
|
|
+ this.data[i].orderQuantity,
|
|
|
+ this.data[i].freight,
|
|
|
+ this.data[i].insurance,
|
|
|
+ this.data[i].discount
|
|
|
+ );
|
|
|
}
|
|
|
amountSum = _.add(
|
|
|
amountSum,
|