|
|
@@ -49,11 +49,9 @@
|
|
|
size="mini"
|
|
|
v-model="form.exchangeRate"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
- @change="rateChange"
|
|
|
placeholder="请输入 汇率"
|
|
|
:disabled="detailData.status == 1"
|
|
|
- ><template slot="append">%</template></el-input
|
|
|
- >
|
|
|
+ />
|
|
|
</template>
|
|
|
<template slot="boxNumber">
|
|
|
<el-input
|
|
|
@@ -140,25 +138,17 @@
|
|
|
@saveColumn="saveColumn"
|
|
|
:summary-method="summaryMethod"
|
|
|
>
|
|
|
- <template slot="price" slot-scope="{ row }">
|
|
|
- <el-input
|
|
|
- v-if="row.$cellEdit"
|
|
|
- v-model="row.price"
|
|
|
- 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.price }}</span>
|
|
|
- </template>
|
|
|
- <template slot="orderQuantity" slot-scope="{ row }">
|
|
|
- <el-input
|
|
|
- v-if="row.$cellEdit"
|
|
|
- v-model="row.orderQuantity"
|
|
|
+ <template slot="cname" slot-scope="{ row, index }">
|
|
|
+ <el-button
|
|
|
size="small"
|
|
|
- oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
- @change="quantityChange(row)"
|
|
|
- ></el-input>
|
|
|
- <span v-else>{{ row.orderQuantity }}</span>
|
|
|
+ type="text"
|
|
|
+ @click="rePick(row, index)"
|
|
|
+ :disabled="disabled"
|
|
|
+ class="picker"
|
|
|
+ style="padding:4px 10px;float:left"
|
|
|
+ >选择</el-button
|
|
|
+ >
|
|
|
+ <span> {{ row.cname }}</span>
|
|
|
</template>
|
|
|
<template slot="itemType" slot-scope="{ row }">
|
|
|
<el-select
|
|
|
@@ -180,6 +170,106 @@
|
|
|
</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"
|
|
|
+ placeholder="请输入"
|
|
|
+ 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"
|
|
|
+ v-model="row.price"
|
|
|
+ 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.price | micrometerFormat }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="amount" slot-scope="{ row }">
|
|
|
+ <span>{{ row.amount | micrometerFormat }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="orderQuantity" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.orderQuantity"
|
|
|
+ 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.orderQuantity }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="orderQuantity" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.orderQuantity"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ @change="quantityChange(row)"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.orderQuantity }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="discount" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.discount"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ @change="discountChange(row)"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.discount | isDiscount }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="insurance" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ 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>
|
|
|
+ <template slot="freight" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ 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>
|
|
|
+ <template slot="taxRate" slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.taxRate"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ @change="rateChange(row)"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.taxRate | isPercentage }}</span>
|
|
|
+ </template>
|
|
|
<template slot="menuLeft">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@@ -338,6 +428,7 @@ import _ from "lodash";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
import { micrometerFormat } from "@/util/validate";
|
|
|
import { contrastObj, contrastList } from "@/util/contrastData";
|
|
|
+import customerDialog from "@/components/customer-dialog/main";
|
|
|
export default {
|
|
|
name: "detailsPageEdit",
|
|
|
data() {
|
|
|
@@ -350,10 +441,12 @@ export default {
|
|
|
dicData: []
|
|
|
},
|
|
|
switchDialog: false,
|
|
|
- form: {},
|
|
|
+ form: {
|
|
|
+ orderStatus: "录入"
|
|
|
+ },
|
|
|
disabled: false,
|
|
|
dialogVisible: false,
|
|
|
- tableOption: tableOption,
|
|
|
+ tableOption: {},
|
|
|
option: {
|
|
|
menuBtn: false,
|
|
|
labelWidth: 100,
|
|
|
@@ -649,7 +742,8 @@ export default {
|
|
|
orderFeesList: [],
|
|
|
orderFilesList: [],
|
|
|
orderItemIds: [],
|
|
|
- itemtypeList: []
|
|
|
+ itemtypeList: [],
|
|
|
+ reData: null
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
|
@@ -660,7 +754,8 @@ export default {
|
|
|
components: {
|
|
|
reportDialog,
|
|
|
feeInfo,
|
|
|
- uploadFile
|
|
|
+ uploadFile,
|
|
|
+ customerDialog
|
|
|
},
|
|
|
async created() {
|
|
|
this.tableOption = await this.getColumnData(
|
|
|
@@ -704,13 +799,22 @@ export default {
|
|
|
this.findObject(this.option.column, "portOfDestination").dicData =
|
|
|
res.data;
|
|
|
});
|
|
|
- // if (this.detailData.pageType == "new") {
|
|
|
- // getSysNo().then(res => {
|
|
|
- // this.form.sysNo = res.data.data;
|
|
|
- // });
|
|
|
- // }
|
|
|
+ this.getWorkDicts("product_properties").then(res => {
|
|
|
+ this.findObject(this.tableOption.column, "itemProp").dicData =
|
|
|
+ res.data.data;
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
+ getcorpId(row) {
|
|
|
+ this.data[row.index].corpId = row.id;
|
|
|
+ },
|
|
|
+ rePick(row, index) {
|
|
|
+ this.reData = {
|
|
|
+ ...row,
|
|
|
+ index: index
|
|
|
+ };
|
|
|
+ this.newDetails();
|
|
|
+ },
|
|
|
rowCell(row, index) {
|
|
|
if (row.$cellEdit == true) {
|
|
|
this.$set(row, "$cellEdit", false);
|
|
|
@@ -726,12 +830,24 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
priceChange(row) {
|
|
|
- console.log(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);
|
|
|
},
|
|
|
quantityChange(row) {
|
|
|
if (Number(row.orderQuantity) < Number(row.actualQuantity)) {
|
|
|
@@ -745,9 +861,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
rateChange(row) {
|
|
|
- if (row >= 100) {
|
|
|
- this.form.exchangeRate = 0;
|
|
|
- this.$message.error("汇率不能超过100%");
|
|
|
+ if (Number(row.taxRate)>= 100) {
|
|
|
+ row.taxRate = 0;
|
|
|
+ this.$message.error("税率不能超过100%");
|
|
|
}
|
|
|
},
|
|
|
grossProfitRateChange(row) {
|
|
|
@@ -784,31 +900,68 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
importGoods() {
|
|
|
- this.selectionList.forEach(e => {
|
|
|
- this.data.push({
|
|
|
- itemId: e.id,
|
|
|
- code: e.code,
|
|
|
- cname: e.cname,
|
|
|
- priceCategory: e.goodsTypeName,
|
|
|
- itemUrl: e.url,
|
|
|
- itemProp: null,
|
|
|
- itemDescription: null,
|
|
|
- itemType: null,
|
|
|
- orderQuantity: 0,
|
|
|
- tradeTerms: null,
|
|
|
- price: 0,
|
|
|
- amount: 0,
|
|
|
- taxRate: 0,
|
|
|
- unit: e.unit,
|
|
|
- remarks: null,
|
|
|
- $cellEdit: true
|
|
|
+ if (this.reData) {
|
|
|
+ console.log(this.reData);
|
|
|
+ if (this.selectionList.length != 1) {
|
|
|
+ return this.$message.error("重新选择的时候只能选择一条数据");
|
|
|
+ } else {
|
|
|
+ this.selectionList.forEach(e => {
|
|
|
+ this.data.forEach((item, index) => {
|
|
|
+ if (index == this.reData.index) {
|
|
|
+ item.itemId = e.id;
|
|
|
+ item.code = e.code;
|
|
|
+ item.cname = e.cname;
|
|
|
+ item.priceCategory = e.goodsTypeName;
|
|
|
+ item.itemUrl = e.url;
|
|
|
+ item.itemProp = this.reData.itemProp;
|
|
|
+ item.itemDescription = e.cnameDescription;
|
|
|
+ item.itemType = this.reData.itemType;
|
|
|
+ item.tradeTerms = this.reData.tradeTerms;
|
|
|
+ item.price = this.reData.price;
|
|
|
+ item.orderQuantity = this.reData.orderQuantity;
|
|
|
+ item.insurance = this.reData.insurance;
|
|
|
+ item.freight = this.reData.freight;
|
|
|
+ item.discount = this.reData.discount;
|
|
|
+ item.amount = this.reData.amount;
|
|
|
+ item.taxRate = this.reData.taxRate;
|
|
|
+ item.unit = e.unit;
|
|
|
+ item.remarks = this.reData.remarks;
|
|
|
+ item.$cellEdit = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.selectionList.forEach(e => {
|
|
|
+ this.data.push({
|
|
|
+ itemId: e.id,
|
|
|
+ code: e.code,
|
|
|
+ cname: e.cname,
|
|
|
+ priceCategory: e.goodsTypeName,
|
|
|
+ itemUrl: e.url,
|
|
|
+ itemProp: null,
|
|
|
+ itemDescription: e.cnameDescription,
|
|
|
+ itemType: null,
|
|
|
+ tradeTerms: null,
|
|
|
+ price: 0,
|
|
|
+ orderQuantity: 0,
|
|
|
+ insurance: 0,
|
|
|
+ freight: 0,
|
|
|
+ discount: null,
|
|
|
+ amount: 0,
|
|
|
+ taxRate: 0,
|
|
|
+ unit: e.unit,
|
|
|
+ remarks: null,
|
|
|
+ $cellEdit: true
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
this.dialogVisible = false;
|
|
|
},
|
|
|
closeGoods() {
|
|
|
this.selectionList = [];
|
|
|
this.treeDeptId = "";
|
|
|
+ this.reData = null;
|
|
|
},
|
|
|
goodsSelectionChange(list) {
|
|
|
this.orderItemIds = [];
|