|
@@ -56,6 +56,77 @@
|
|
|
><template slot="append">%</template></el-input
|
|
|
>
|
|
|
</template>
|
|
|
+ <template slot="boxNumber">
|
|
|
+ <el-input
|
|
|
+ size="mini"
|
|
|
+ v-model="form.boxNumber"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/,
|
|
|
+ "$1.$2")'
|
|
|
+ placeholder="请输入 起订量"
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template slot="minOrder">
|
|
|
+ <el-input
|
|
|
+ size="mini"
|
|
|
+ v-model="form.minOrder"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/,
|
|
|
+ "$1.$2")'
|
|
|
+ placeholder="请输入 起订量"
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template slot="predictOceanFreight">
|
|
|
+ <el-input
|
|
|
+ size="mini"
|
|
|
+ v-model="form.predictOceanFreight"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/,
|
|
|
+ "$1.$2")'
|
|
|
+ placeholder="请输入 预计海运费"
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template slot="referenceOceanFreight">
|
|
|
+ <el-input
|
|
|
+ size="mini"
|
|
|
+ v-model="form.referenceOceanFreight"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/,
|
|
|
+ "$1.$2")'
|
|
|
+ placeholder="请输入 参考海运费"
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template slot="oceanFreight">
|
|
|
+ <el-input
|
|
|
+ size="mini"
|
|
|
+ v-model="form.oceanFreight"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/,
|
|
|
+ "$1.$2")'
|
|
|
+ placeholder="请输入 实际海运费"
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template slot="grossProfit">
|
|
|
+ <el-input
|
|
|
+ size="mini"
|
|
|
+ v-model="form.grossProfit"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/,
|
|
|
+ "$1.$2")'
|
|
|
+ placeholder="请输入 毛利额"
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template slot="grossProfitRate">
|
|
|
+ <el-input
|
|
|
+ size="mini"
|
|
|
+ v-model="form.grossProfitRate"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ @change="grossProfitRateChange"
|
|
|
+ placeholder="请输入 毛利率"
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ ><template slot="append">%</template></el-input
|
|
|
+ >
|
|
|
+ </template>
|
|
|
</avue-form>
|
|
|
</basic-container>
|
|
|
<containerTitle title="商品信息"></containerTitle>
|
|
@@ -117,6 +188,48 @@
|
|
|
>删 除</el-button
|
|
|
>
|
|
|
</template>
|
|
|
+ <template slot="itemType" slot-scope="{ row }">
|
|
|
+ <el-select
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.itemType"
|
|
|
+ filterable
|
|
|
+ allow-create
|
|
|
+ default-first-option
|
|
|
+ placeholder="请输入"
|
|
|
+ size="small"
|
|
|
+ @focus="itemTypeFocus(row)"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in itemtypeList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <span v-else>{{ row.itemType }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="priorityReferrer" slot-scope="{ row }">
|
|
|
+ <el-checkbox :disabled="!row.$cellEdit" v-model="row.priorityReferrer" :true-label="1" :false-label="0" />
|
|
|
+ </template>
|
|
|
+ <template slot="corpId" slot-scope="{ row, index }">
|
|
|
+ <customer-dialog
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.corpName"
|
|
|
+ :cropIndex="index"
|
|
|
+ @getcorpId="getcorpId"
|
|
|
+ ></customer-dialog>
|
|
|
+ <span v-else>{{ row.corpName }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="purchaseAmount" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.purchaseAmount"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.purchaseAmount | micrometerFormat }}</span>
|
|
|
+ </template>
|
|
|
<template slot="price" slot-scope="{ row }">
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
@@ -136,7 +249,7 @@
|
|
|
v-model="row.orderQuantity"
|
|
|
size="small"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
- @change="quantityChange(row)"
|
|
|
+ @change="priceChange(row)"
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.orderQuantity }}</span>
|
|
|
</template>
|
|
@@ -156,6 +269,7 @@
|
|
|
v-model="row.insurance"
|
|
|
size="small"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ @change="priceChange(row)"
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.insurance | micrometerFormat }}</span>
|
|
|
</template>
|
|
@@ -165,6 +279,7 @@
|
|
|
v-model="row.freight"
|
|
|
size="small"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ @change="priceChange(row)"
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.freight | micrometerFormat }}</span>
|
|
|
</template>
|
|
@@ -178,26 +293,6 @@
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.taxRate | isPercentage }}</span>
|
|
|
</template>
|
|
|
- <template slot="itemType" slot-scope="{ row }">
|
|
|
- <el-select
|
|
|
- v-if="row.$cellEdit"
|
|
|
- v-model="row.itemType"
|
|
|
- filterable
|
|
|
- allow-create
|
|
|
- default-first-option
|
|
|
- placeholder="请输入"
|
|
|
- @focus="itemTypeFocus(row)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in itemtypeList"
|
|
|
- :key="index"
|
|
|
- :label="item.value"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <span v-else>{{ row.itemType }}</span>
|
|
|
- </template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
<fee-info
|
|
@@ -271,6 +366,7 @@
|
|
|
import tableOption from "./config/customerContact.json";
|
|
|
import goodsOption from "./config/commodity.json";
|
|
|
import feeInfo from "@/components/fee-info/main";
|
|
|
+import customerDialog from "@/components/customer-dialog/main";
|
|
|
import {
|
|
|
detail,
|
|
|
submit,
|
|
@@ -418,7 +514,7 @@ export default {
|
|
|
{
|
|
|
label: "订单日期",
|
|
|
prop: "businesDate",
|
|
|
- span: 6,
|
|
|
+ span: 8,
|
|
|
type: "date",
|
|
|
format: "yyyy-MM-dd",
|
|
|
valueFormat: "yyyy-MM-dd 00:00:00"
|
|
@@ -426,15 +522,16 @@ export default {
|
|
|
{
|
|
|
label: "有效日期",
|
|
|
prop: "dateValidity",
|
|
|
- span: 6,
|
|
|
+ span: 8,
|
|
|
type: "date",
|
|
|
format: "yyyy-MM-dd",
|
|
|
- valueFormat: "yyyy-MM-dd 00:00:00"
|
|
|
+ valueFormat: "yyyy-MM-dd 00:00:00",
|
|
|
+ row: true
|
|
|
},
|
|
|
{
|
|
|
label: "币别",
|
|
|
prop: "currency",
|
|
|
- span: 6,
|
|
|
+ span: 8,
|
|
|
type: "select",
|
|
|
dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
|
|
|
props: {
|
|
@@ -445,8 +542,9 @@ export default {
|
|
|
{
|
|
|
label: "汇率",
|
|
|
prop: "exchangeRate",
|
|
|
- span: 6,
|
|
|
- slot: true
|
|
|
+ span: 8,
|
|
|
+ slot: true,
|
|
|
+ row: true
|
|
|
},
|
|
|
{
|
|
|
label: "箱型",
|
|
@@ -479,6 +577,17 @@ export default {
|
|
|
span: 8
|
|
|
},
|
|
|
{
|
|
|
+ label: "毛利额",
|
|
|
+ prop: "grossProfit",
|
|
|
+ span: 8
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "毛利率",
|
|
|
+ prop: "grossProfitRate",
|
|
|
+ span: 8,
|
|
|
+ row: true
|
|
|
+ },
|
|
|
+ {
|
|
|
label: "备注",
|
|
|
prop: "orderRemark",
|
|
|
type: "textarea",
|
|
@@ -498,16 +607,6 @@ export default {
|
|
|
type: "textarea",
|
|
|
minRows: 2,
|
|
|
span: 8
|
|
|
- },
|
|
|
- {
|
|
|
- label: "毛利额",
|
|
|
- prop: "grossProfit",
|
|
|
- span: 8
|
|
|
- },
|
|
|
- {
|
|
|
- label: "毛利率",
|
|
|
- prop: "grossProfitRate",
|
|
|
- span: 8
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -560,7 +659,8 @@ export default {
|
|
|
},
|
|
|
components: {
|
|
|
reportDialog,
|
|
|
- feeInfo
|
|
|
+ feeInfo,
|
|
|
+ customerDialog
|
|
|
},
|
|
|
async created() {
|
|
|
this.tableOption = await this.getColumnData(
|
|
@@ -595,6 +695,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getcorpId(row) {
|
|
|
+ this.data[row.index].corpId = row.id;
|
|
|
+ },
|
|
|
rowCell(row, index) {
|
|
|
if (row.$cellEdit == true) {
|
|
|
this.$set(row, "$cellEdit", false);
|
|
@@ -610,17 +713,31 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
priceChange(row) {
|
|
|
- if (!row.price) {
|
|
|
- row.price = 0;
|
|
|
- } else {
|
|
|
- row.amount = _.multiply(row.price, row.orderQuantity).toFixed(2);
|
|
|
- }
|
|
|
+ const sum = _.multiply(
|
|
|
+ _.add(
|
|
|
+ Number(
|
|
|
+ _.multiply(
|
|
|
+ row.price ? row.price : 0,
|
|
|
+ row.orderQuantity ? row.orderQuantity : 0
|
|
|
+ )
|
|
|
+ ),
|
|
|
+ Number(
|
|
|
+ _.add(
|
|
|
+ Number(row.insurance ? row.insurance : 0),
|
|
|
+ Number(row.freight ? row.freight : 0)
|
|
|
+ )
|
|
|
+ )
|
|
|
+ ),
|
|
|
+ _.divide(row.discount ? row.discount : 10, 10)
|
|
|
+ );
|
|
|
+ row.amount = Number(sum ? sum : 0).toFixed(2);
|
|
|
},
|
|
|
discountChange(row) {
|
|
|
if (row.discount >= 10) {
|
|
|
- row.discount = 0;
|
|
|
+ row.discount = null;
|
|
|
this.$message.error("请正确输入折扣");
|
|
|
}
|
|
|
+ this.priceChange(row);
|
|
|
},
|
|
|
taxRateChange(row) {
|
|
|
if (row.taxRate > 100) {
|
|
@@ -628,11 +745,10 @@ export default {
|
|
|
this.$message.error("请正确输入税率");
|
|
|
}
|
|
|
},
|
|
|
- quantityChange(row) {
|
|
|
- if (!row.orderQuantity) {
|
|
|
- row.orderQuantity = 0;
|
|
|
- } else {
|
|
|
- row.amount = _.multiply(row.price, row.orderQuantity).toFixed(2);
|
|
|
+ grossProfitRateChange(row) {
|
|
|
+ if (row >= 100) {
|
|
|
+ this.form.grossProfitRate = 0;
|
|
|
+ this.$message.error("毛利率不能超过100%");
|
|
|
}
|
|
|
},
|
|
|
saveShipping() {
|
|
@@ -711,9 +827,12 @@ export default {
|
|
|
itemProp: null,
|
|
|
itemDescription: null,
|
|
|
itemType: null,
|
|
|
- orderQuantity: 0,
|
|
|
tradeTerms: null,
|
|
|
price: 0,
|
|
|
+ orderQuantity: 0,
|
|
|
+ insurance: 0,
|
|
|
+ freight: 0,
|
|
|
+ discount: null,
|
|
|
amount: 0,
|
|
|
taxRate: 0,
|
|
|
unit: e.unit,
|
|
@@ -782,7 +901,7 @@ export default {
|
|
|
return this.$message.error(`请输入第${i + 1}行的结算中心`);
|
|
|
}
|
|
|
if (orderFeesList[i].price == 0) {
|
|
|
- return this.$message.error(`请正确输入第${i + 1}行的价格`);
|
|
|
+ return this.$message.error(`请正确输入第${i + 1}行的销售价`);
|
|
|
}
|
|
|
if (orderFeesList[i].orderQuantity == 0) {
|
|
|
return this.$message.error(`请正确输入第${i + 1}行的数量`);
|