|
@@ -8,9 +8,9 @@
|
|
|
<el-row>
|
|
|
<el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印
|
|
|
</el-button>
|
|
|
-<!-- <el-button type="warning" icon="el-icon-plus" size="small"-->
|
|
|
-<!-- :disabled="detailData.status == 1 || orderItemIds.length == 0" @click="getInvoice">生成发货单-->
|
|
|
-<!-- </el-button>-->
|
|
|
+ <!-- <el-button type="warning" icon="el-icon-plus" size="small"-->
|
|
|
+ <!-- :disabled="detailData.status == 1 || orderItemIds.length == 0" @click="getInvoice">生成发货单-->
|
|
|
+ <!-- </el-button>-->
|
|
|
<el-button type="primary" size="small" @click="cnameData">刷新基础资料</el-button>
|
|
|
<el-button type="success" size="small" @click="calculate(1)" :disabled="detailData.status == 1"
|
|
|
:loading="calculateLoading">分摊国内费用
|
|
@@ -18,51 +18,63 @@
|
|
|
<el-button type="success" size="small" @click="calculate(2)" :disabled="detailData.status == 1"
|
|
|
:loading="calculateLoading">分摊海运费
|
|
|
</el-button>
|
|
|
- <el-button :type="form.fudaPurchaseStatus?'success':'warning'" size="small" :disabled="!form.id" @click.native="dialog = true;fudaSatus = 1">通知采购</el-button>
|
|
|
- <el-button :type="form.documentaryStatus?'primary':'warning'" size="small" :disabled="!form.id" @click.native="dialog = true;fudaSatus = 2">通知跟单</el-button>
|
|
|
-<!-- <el-button type="primary" size="small" :disabled="form.status > 0 || (!form.status && form.status !== 0)" @click.native="pleaseCheck">请核数据</el-button>-->
|
|
|
+ <el-button :type="form.fudaPurchaseStatus ? 'success' : 'warning'" size="small" :disabled="!form.id"
|
|
|
+ @click.native="dialog = true; fudaSatus = 1">通知采购</el-button>
|
|
|
+ <el-button :type="form.documentaryStatus ? 'primary' : 'warning'" size="small" :disabled="!form.id"
|
|
|
+ @click.native="dialog = true; fudaSatus = 2">通知跟单</el-button>
|
|
|
+ <el-popover placement="top" width="160" v-model="visible">
|
|
|
+ <div style="text-align: center;">
|
|
|
+ <el-input-number v-model="priceAD" size="small" controls-position="right"></el-input-number>
|
|
|
+ </div>
|
|
|
+ <div style="text-align: right; margin: 0">
|
|
|
+ <el-button size="mini" type="text" @click="visible = false">取消</el-button>
|
|
|
+ <el-button size="mini" type="text" @click="submitPriceAD">确定</el-button>
|
|
|
+ </div>
|
|
|
+ <el-button type="info" size="small" slot="reference" :disabled="detailData.status == 1">调整出厂价</el-button>
|
|
|
+ </el-popover>
|
|
|
+ <!-- <el-button type="primary" size="small" :disabled="form.status > 0 || (!form.status && form.status !== 0)" @click.native="pleaseCheck">请核数据</el-button>-->
|
|
|
</el-row>
|
|
|
</template>
|
|
|
<template slot="headerSerial">
|
|
|
- <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
|
|
|
- :disabled="detailData.status == 1" circle></el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow" :disabled="detailData.status == 1"
|
|
|
+ circle></el-button>
|
|
|
</template>
|
|
|
<template slot="codeHeader" slot-scope="{column}">
|
|
|
<span style="color: #409EFF;cursor: pointer" @click.stop="khEdit('cname')">{{ column.label }}</span>
|
|
|
</template>
|
|
|
<template slot="orderQuantity" slot-scope="{row}">
|
|
|
- {{ row.orderQuantity|decimalFormat2 }}
|
|
|
- </template>
|
|
|
- <template slot="amount" slot-scope="{row}">
|
|
|
- {{ row.amount|decimalFormat2 }}
|
|
|
- </template>
|
|
|
- <template slot="partsCost" slot-scope="{row}">
|
|
|
- {{ row.partsCost|decimalFormat2 }}
|
|
|
- </template>
|
|
|
- <template slot="partsPrice" slot-scope="{row}">
|
|
|
- {{ row.partsPrice|decimalFormat2 }}
|
|
|
- </template>
|
|
|
- <template slot="productPrice" slot-scope="{row}">
|
|
|
- {{ row.productPrice|decimalFormat2 }}
|
|
|
- </template>
|
|
|
- <template slot="outFactoryPrice" slot-scope="{row}">
|
|
|
- {{ row.outFactoryPrice|decimalFormat2 }}
|
|
|
- </template>
|
|
|
- <template slot="shareAmount" slot-scope="{row}">
|
|
|
- {{ row.shareAmount|decimalFormat2 }}
|
|
|
- </template>
|
|
|
- <template slot="internationalAmount" slot-scope="{row}">
|
|
|
- {{ row.internationalAmount|decimalFormat2 }}
|
|
|
- </template>
|
|
|
- <template slot="price" slot-scope="{row}">
|
|
|
- {{ row.price|decimalFormat2 }}
|
|
|
- </template>
|
|
|
- <template slot="purchaseCost" slot-scope="{row}">
|
|
|
- {{ row.purchaseCost|decimalFormat2 }}
|
|
|
- </template>
|
|
|
- <template slot="purchaseAmount" slot-scope="{row}">
|
|
|
- {{ row.purchaseAmount|decimalFormat2 }}
|
|
|
- </template>
|
|
|
+ {{ row.orderQuantity | decimalFormat2 }}
|
|
|
+ </template>
|
|
|
+ <template slot="amount" slot-scope="{row}">
|
|
|
+ {{ row.amount | decimalFormat2 }}
|
|
|
+ </template>
|
|
|
+ <template slot="partsCost" slot-scope="{row}">
|
|
|
+ {{ row.partsCost | decimalFormat2 }}
|
|
|
+ </template>
|
|
|
+ <template slot="partsPrice" slot-scope="{row}">
|
|
|
+ {{ row.partsPrice | decimalFormat2 }}
|
|
|
+ </template>
|
|
|
+ <template slot="productPrice" slot-scope="{row}">
|
|
|
+ {{ row.productPrice | decimalFormat2 }}
|
|
|
+ </template>
|
|
|
+ <template slot="outFactoryPrice" slot-scope="{row}">
|
|
|
+ {{ row.outFactoryPrice | decimalFormat2 }}
|
|
|
+ </template>
|
|
|
+ <template slot="shareAmount" slot-scope="{row}">
|
|
|
+ {{ row.shareAmount | decimalFormat2 }}
|
|
|
+ </template>
|
|
|
+ <template slot="internationalAmount" slot-scope="{row}">
|
|
|
+ {{ row.internationalAmount | decimalFormat2 }}
|
|
|
+ </template>
|
|
|
+ <template slot="price" slot-scope="{row}">
|
|
|
+ {{ row.price | decimalFormat2 }}
|
|
|
+ </template>
|
|
|
+ <template slot="purchaseCost" slot-scope="{row}">
|
|
|
+ {{ row.purchaseCost | decimalFormat2 }}
|
|
|
+ </template>
|
|
|
+ <template slot="purchaseAmount" slot-scope="{row}">
|
|
|
+ {{ row.purchaseAmount | decimalFormat2 }}
|
|
|
+ </template>
|
|
|
//操作栏
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
<div style="display:flex;justify-content: center;">
|
|
@@ -73,8 +85,8 @@
|
|
|
<div v-if="!goodsEditShow"
|
|
|
style="display:flex;flex-direction: column;justify-content: center;margin-left: 10px;">
|
|
|
<el-tooltip effect="dark" content="向上移动" placement="top">
|
|
|
- <i v-if="index != 0" :disabled="detailData.status == 1" class="el-icon-arrow-up"
|
|
|
- @click="moveUp(row, index)" style="color:#409EFF;"></i>
|
|
|
+ <i v-if="index != 0" :disabled="detailData.status == 1" class="el-icon-arrow-up" @click="moveUp(row, index)"
|
|
|
+ style="color:#409EFF;"></i>
|
|
|
</el-tooltip>
|
|
|
<el-tooltip effect="dark" content="向下移动" placement="bottom"> <i v-if="index != (data.length - 1)"
|
|
|
:disabled="detailData.status == 1" class="el-icon-arrow-down" @click="moveDown(row, index)"
|
|
@@ -186,8 +198,8 @@
|
|
|
<template slot="partsAuthenticationNameForm" slot-scope="{type,disabled}">
|
|
|
<div style="display:flex;">
|
|
|
<el-input v-model="goodsForm.partsAuthenticationName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{ goodsForm.partsAuthenticationSalePrice ? goodsForm.partsAuthenticationSalePrice : 0 }}</template>
|
|
|
+ <template slot="append">{{ goodsForm.partsAuthenticationSalePrice ? goodsForm.partsAuthenticationSalePrice : 0
|
|
|
+ }}</template>
|
|
|
</el-input>
|
|
|
<el-button icon="el-icon-edit" size="mini" @click="openpart(5, goodsForm.partsAuthenticationValue)"
|
|
|
:disabled="disabled"></el-button>
|
|
@@ -207,7 +219,7 @@
|
|
|
<template slot="partsDescribeForm" slot-scope="{type,disabled}">
|
|
|
<el-input type="textarea" :rows="2" v-model="goodsForm.partsDescribe" size="small" placeholder=""
|
|
|
@change="editChange(goodsForm)">
|
|
|
- </el-input>
|
|
|
+ </el-input>outFactoryPrice
|
|
|
</template>
|
|
|
//英文名称
|
|
|
<template slot="enameForm" slot-scope="{type,disabled}">
|
|
@@ -233,8 +245,8 @@
|
|
|
</template>
|
|
|
//分摊金额
|
|
|
<template slot="shareAmountForm" slot-scope="{type,disabled}">
|
|
|
- <el-input-number v-model="goodsForm.shareAmount" size="small" style="width:100%"
|
|
|
- @change="priceChange(goodsForm)" :controls="false" :precision="10"></el-input-number>
|
|
|
+ <el-input-number v-model="goodsForm.shareAmount" size="small" style="width:100%" @change="priceChange(goodsForm)"
|
|
|
+ :controls="false" :precision="10"></el-input-number>
|
|
|
</template>
|
|
|
//分摊金额
|
|
|
<template slot="internationalAmountForm" slot-scope="{type,disabled}">
|
|
@@ -267,11 +279,11 @@
|
|
|
//产品型号
|
|
|
<template slot="itemTypeForm" slot-scope="{type,disabled}">
|
|
|
<el-input v-model="goodsForm.itemType" placeholder="请输入内容"></el-input>
|
|
|
-<!-- <el-select v-model="goodsForm.itemType" filterable allow-create default-first-option placeholder="请输入"-->
|
|
|
-<!-- size="small" @focus="itemTypeFocus(goodsForm)">-->
|
|
|
-<!-- <el-option v-for="(item, index) in itemtypeList" :key="index" :label="item.value" :value="item.value">-->
|
|
|
-<!-- </el-option>-->
|
|
|
-<!-- </el-select>-->
|
|
|
+ <!-- <el-select v-model="goodsForm.itemType" filterable allow-create default-first-option placeholder="请输入"-->
|
|
|
+ <!-- size="small" @focus="itemTypeFocus(goodsForm)">-->
|
|
|
+ <!-- <el-option v-for="(item, index) in itemtypeList" :key="index" :label="item.value" :value="item.value">-->
|
|
|
+ <!-- </el-option>-->
|
|
|
+ <!-- </el-select>-->
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
<!-- <el-dialog title="导入商品" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
|
|
@@ -307,21 +319,11 @@
|
|
|
</report-dialog>
|
|
|
<part-library ref="partLibrary" @importPart="importPart"></part-library>
|
|
|
<price-library ref="library" @importLibray="importLibray" />
|
|
|
- <el-dialog
|
|
|
- title="选择日期"
|
|
|
- :visible.sync="dialog"
|
|
|
- v-if="dialog"
|
|
|
- width="30%"
|
|
|
- append-to-body>
|
|
|
+ <el-dialog title="选择日期" :visible.sync="dialog" v-if="dialog" width="30%" append-to-body>
|
|
|
<span>
|
|
|
- <el-date-picker
|
|
|
- v-model="pickerValue"
|
|
|
- type="date"
|
|
|
- style="width: 100%;"
|
|
|
- size="small"
|
|
|
- value-format="yyyy-MM-dd HH:ss:mm"
|
|
|
- placeholder="选择日期">
|
|
|
- </el-date-picker>
|
|
|
+ <el-date-picker v-model="pickerValue" type="date" style="width: 100%;" size="small"
|
|
|
+ value-format="yyyy-MM-dd HH:ss:mm" placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
</span>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialog = false">取 消</el-button>
|
|
@@ -360,18 +362,21 @@ import {
|
|
|
grossProfitCal,
|
|
|
costCal,
|
|
|
addPrice,
|
|
|
- divide
|
|
|
+ divide,
|
|
|
+ priceaAjustment
|
|
|
} from "@/util/calculate";
|
|
|
import _ from "lodash";
|
|
|
-import {getPricebankAll} from "@/api/basicData/customerInquiry";
|
|
|
+import { getPricebankAll } from "@/api/basicData/customerInquiry";
|
|
|
import { micrometerFormat2, decimalFormat2 } from "@/util/validate";
|
|
|
export default {
|
|
|
name: "customerInformation",
|
|
|
data() {
|
|
|
return {
|
|
|
- fudaSatus:null,
|
|
|
- pickerValue:"",
|
|
|
- dialog:false,
|
|
|
+ priceAD: 0,
|
|
|
+ visible: false,
|
|
|
+ fudaSatus: null,
|
|
|
+ pickerValue: "",
|
|
|
+ dialog: false,
|
|
|
calculateLoading: false,
|
|
|
switchDialog: false,
|
|
|
loading: false,
|
|
@@ -444,10 +449,10 @@ export default {
|
|
|
reportDialog
|
|
|
},
|
|
|
filters: {
|
|
|
- decimalFormat2(num) {
|
|
|
- return decimalFormat2(num);
|
|
|
- }
|
|
|
- },
|
|
|
+ decimalFormat2(num) {
|
|
|
+ return decimalFormat2(num);
|
|
|
+ }
|
|
|
+ },
|
|
|
async created() {
|
|
|
this.tableOption = await this.getColumnData(
|
|
|
this.getColumnName(5),
|
|
@@ -457,21 +462,21 @@ export default {
|
|
|
this.getColumnName(28),
|
|
|
goodsOption
|
|
|
);
|
|
|
- if (localStorage.getItem("roleName").indexOf('贸易') == -1 && localStorage.getItem("roleName").indexOf('运营') == -1) {
|
|
|
- this.findObject(this.tableOption.column, "purchaseCost").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "purchaseCost").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "partsPrice").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "partsPrice").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "partsCost").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "partsCost").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "purchaseAmount").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "purchaseAmount").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "corpName").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "corpName").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "productPrice").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "productPrice").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "productPrice").display = true;
|
|
|
- }
|
|
|
+ if (localStorage.getItem("roleName").indexOf('贸易') == -1 && localStorage.getItem("roleName").indexOf('运营') == -1) {
|
|
|
+ this.findObject(this.tableOption.column, "purchaseCost").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "purchaseCost").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsPrice").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "partsPrice").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsCost").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "partsCost").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "purchaseAmount").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "purchaseAmount").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "corpName").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "corpName").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "productPrice").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "productPrice").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "productPrice").display = true;
|
|
|
+ }
|
|
|
this.getWorkDicts("Thread").then(res => {
|
|
|
this.ThreadList = res.data.data;
|
|
|
});
|
|
@@ -487,7 +492,7 @@ export default {
|
|
|
this.getWorkDicts("unit").then(res => {
|
|
|
this.findObject(this.tableOption.column, "unit").dicData = res.data.data;
|
|
|
});
|
|
|
- getPricebankAll({ billType: "CG", statusTime: dateFormat(new Date(), "yyyy-MM-dd") }).then(res=>{
|
|
|
+ getPricebankAll({ billType: "CG", statusTime: dateFormat(new Date(), "yyyy-MM-dd") }).then(res => {
|
|
|
this.goodsoptions = res.data.data
|
|
|
})
|
|
|
// getPricebank(1, 10, {
|
|
@@ -521,7 +526,7 @@ export default {
|
|
|
},
|
|
|
pickGoods() {
|
|
|
// this.dialogVisible = !this.dialogVisible;
|
|
|
- this.$refs.library.search = {}
|
|
|
+ this.$refs.library.search = {}
|
|
|
this.$refs.library.init(false);
|
|
|
},
|
|
|
nodeClick(data) {
|
|
@@ -688,15 +693,15 @@ export default {
|
|
|
row.itemMargin = grossProfitCal(e.purchaseAmount, 0, sellingCal(productCal(e.purchaseAmount, 0, this
|
|
|
.form.coefficient), this.form.exchangeRate), this.form.exchangeRate);
|
|
|
// 处理单品毛利率是 -00.00 的问题
|
|
|
- if (Number(row.itemMargin) === 0) {
|
|
|
- row.itemMargin = Number(row.itemMargin) + ''
|
|
|
- }
|
|
|
+ if (Number(row.itemMargin) === 0) {
|
|
|
+ row.itemMargin = Number(row.itemMargin) + ''
|
|
|
+ }
|
|
|
row.partsDescribe = null;
|
|
|
row.remarks = null;
|
|
|
row.exchangeRate = this.form.exchangeRate;
|
|
|
row.productRemark = e.ename;
|
|
|
row.attributeList = this.getAttribute(e.goodsSpecificationList),
|
|
|
- row.referrerReason = e.referrerReason
|
|
|
+ row.referrerReason = e.referrerReason
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -796,7 +801,7 @@ export default {
|
|
|
exchangeRate: this.form.exchangeRate,
|
|
|
productRemark: e.ename,
|
|
|
attributeList: this.getAttribute(e.goodsSpecificationList),
|
|
|
- referrerReason:e.referrerReason
|
|
|
+ referrerReason: e.referrerReason
|
|
|
}
|
|
|
});
|
|
|
this.$refs.crud.rowAdd()
|
|
@@ -820,10 +825,10 @@ export default {
|
|
|
this.switchDialog = val;
|
|
|
},
|
|
|
inInvoice() {
|
|
|
- if (!this.pickerValue)return this.$message.error("请选择日期")
|
|
|
+ if (!this.pickerValue) return this.$message.error("请选择日期")
|
|
|
const data = {
|
|
|
id: this.form.id,
|
|
|
- documentaryDate:this.pickerValue
|
|
|
+ documentaryDate: this.pickerValue
|
|
|
};
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
@@ -837,9 +842,9 @@ export default {
|
|
|
this.dialog = false
|
|
|
this.pickerValue = ''
|
|
|
loading.close()
|
|
|
- this.$emit("backToList",this.form.id)
|
|
|
+ this.$emit("backToList", this.form.id)
|
|
|
}
|
|
|
- }).catch(()=>{
|
|
|
+ }).catch(() => {
|
|
|
loading.close()
|
|
|
this.pickerValue = ''
|
|
|
this.dialog = false
|
|
@@ -850,7 +855,7 @@ export default {
|
|
|
if (!this.form.id) {
|
|
|
return this.$message.error("此单据没有提交记录,请先提交");
|
|
|
}
|
|
|
- if (!this.form.buyerId){
|
|
|
+ if (!this.form.buyerId) {
|
|
|
return this.$message.error("采购员必填");
|
|
|
}
|
|
|
const loading = this.$loading({
|
|
@@ -859,15 +864,15 @@ export default {
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
- generatePurchaseNews(this.form.id,this.pickerValue).then(res => {
|
|
|
+ generatePurchaseNews(this.form.id, this.pickerValue).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
this.$message.success("生成成功");
|
|
|
this.dialog = false
|
|
|
this.pickerValue = ''
|
|
|
loading.close()
|
|
|
- this.$emit("backToList",this.form.id)
|
|
|
+ this.$emit("backToList", this.form.id)
|
|
|
}
|
|
|
- }).catch(()=>{
|
|
|
+ }).catch(() => {
|
|
|
this.pickerValue = ''
|
|
|
this.dialog = false
|
|
|
loading.close()
|
|
@@ -901,9 +906,9 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- pleaseCheck(){
|
|
|
- this.$parent.pleaseCheck()
|
|
|
- },
|
|
|
+ pleaseCheck() {
|
|
|
+ this.$parent.pleaseCheck()
|
|
|
+ },
|
|
|
calculate(val) {
|
|
|
this.form.totalValue = 0
|
|
|
this.data.forEach((e, index) => {
|
|
@@ -1019,6 +1024,36 @@ export default {
|
|
|
moveDown(row, index) {
|
|
|
this.data[index] = this.data.splice(index + 1, 1, row)[0]
|
|
|
},
|
|
|
+ submitPriceAD() {
|
|
|
+ this.visible = false;
|
|
|
+ this.data.forEach(e => {
|
|
|
+ e.outFactoryPrice = priceaAjustment(e.outFactoryPrice, this.priceAD)
|
|
|
+ e.totalValue = multiply(e.outFactoryPrice, e.orderQuantity)
|
|
|
+ e.price = addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount)
|
|
|
+ e.amount = amountCal(
|
|
|
+ addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount),
|
|
|
+ e.orderQuantity,
|
|
|
+ e.freight,
|
|
|
+ e.insurance,
|
|
|
+ e.discount
|
|
|
+ );
|
|
|
+ e.itemMargin = grossProfitCal(
|
|
|
+ e.purchaseAmount,
|
|
|
+ e.partsPrice,
|
|
|
+ e.outFactoryPrice,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ // 处理单品毛利率是 -00.00 的问题
|
|
|
+ if (Number(e.itemMargin) === 0) {
|
|
|
+ e.itemMargin = Number(e.itemMargin) + ''
|
|
|
+ }
|
|
|
+ // 出厂价格为零,单品毛利润为零
|
|
|
+ if (e.outFactoryPrice == 0) {
|
|
|
+ e.itemMargin = 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.priceAD=0
|
|
|
+ },
|
|
|
purchaseAmountChange(row) {
|
|
|
row.productPrice = productCal(
|
|
|
row.purchaseAmount,
|
|
@@ -1046,10 +1081,10 @@ export default {
|
|
|
this.form.exchangeRate
|
|
|
);
|
|
|
},
|
|
|
- outFactoryPriceInput(row){
|
|
|
- console.log(row,1005)
|
|
|
- this.$set(row,'outFactoryChange',true)
|
|
|
- },
|
|
|
+ outFactoryPriceInput(row) {
|
|
|
+ console.log(row, 1005)
|
|
|
+ this.$set(row, 'outFactoryChange', true)
|
|
|
+ },
|
|
|
priceChange(row) {
|
|
|
row.totalValue = multiply(row.outFactoryPrice, row.orderQuantity)
|
|
|
row.price = addPrice(row.outFactoryPrice, row.shareAmount, row.internationalAmount)
|
|
@@ -1060,24 +1095,24 @@ export default {
|
|
|
row.insurance,
|
|
|
row.discount
|
|
|
);
|
|
|
- console.log(row.purchaseAmount,'purchaseAmount')
|
|
|
- console.log(row.partsPrice,'partsPrice')
|
|
|
- console.log(row.outFactoryPrice,'outFactoryPrice')
|
|
|
- console.log(this.form.exchangeRate,'exchangeRate')
|
|
|
- // this.$set(row,'outFactoryChange',true)
|
|
|
+ console.log(row.purchaseAmount, 'purchaseAmount')
|
|
|
+ console.log(row.partsPrice, 'partsPrice')
|
|
|
+ console.log(row.outFactoryPrice, 'outFactoryPrice')
|
|
|
+ console.log(this.form.exchangeRate, 'exchangeRate')
|
|
|
+ // this.$set(row,'outFactoryChange',true)
|
|
|
row.itemMargin = grossProfitCal(
|
|
|
row.purchaseAmount,
|
|
|
row.partsPrice,
|
|
|
row.outFactoryPrice,
|
|
|
this.form.exchangeRate
|
|
|
);
|
|
|
- // 处理单品毛利率是 -00.00 的问题
|
|
|
- if (Number(row.itemMargin) === 0) {
|
|
|
- row.itemMargin = Number(row.itemMargin) + ''
|
|
|
- }
|
|
|
+ // 处理单品毛利率是 -00.00 的问题
|
|
|
+ if (Number(row.itemMargin) === 0) {
|
|
|
+ row.itemMargin = Number(row.itemMargin) + ''
|
|
|
+ }
|
|
|
// 出厂价格为零,单品毛利润为零
|
|
|
- if(row.outFactoryPrice == 0) {
|
|
|
- row.itemMargin = 0
|
|
|
+ if (row.outFactoryPrice == 0) {
|
|
|
+ row.itemMargin = 0
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -1357,63 +1392,63 @@ export default {
|
|
|
done()
|
|
|
},
|
|
|
handleRowUpdate(row, index, done, loading) {
|
|
|
- this.$set(this.data,index,row)
|
|
|
+ this.$set(this.data, index, row)
|
|
|
loading()
|
|
|
done()
|
|
|
},
|
|
|
summaryMethod({ columns, data }) {
|
|
|
- const sums = [];
|
|
|
- if (columns.length > 0) {
|
|
|
- columns.forEach((column, index) => {
|
|
|
- let prop = column.property
|
|
|
- if (['orderQuantity', 'amount', 'partsCost', 'partsPrice', 'productPrice','actualQuantity'].includes(prop)) {
|
|
|
- let values = this.data.map(item => Number(item[prop] || 0));
|
|
|
- let all = values.length !== 0 ? sums[index] = values.reduce((a, b) => {
|
|
|
- return a + b;
|
|
|
- }) : 0
|
|
|
- if (prop == 'orderQuantity') {
|
|
|
- sums[index] = micrometerFormat2(all)
|
|
|
- }
|
|
|
- if (prop == 'amount') {
|
|
|
- sums[index] = micrometerFormat2(all)
|
|
|
- }
|
|
|
- if (prop == 'partsCost') {
|
|
|
- sums[index] = micrometerFormat2(all)
|
|
|
- }
|
|
|
- if (prop == 'partsPrice') {
|
|
|
- sums[index] = micrometerFormat2(all)
|
|
|
- }
|
|
|
- if (prop == 'productPrice') {
|
|
|
- sums[index] = micrometerFormat2(all)
|
|
|
- }
|
|
|
- if (prop == 'actualQuantity') {
|
|
|
- sums[index] = micrometerFormat2(all)
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ const sums = [];
|
|
|
+ if (columns.length > 0) {
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ let prop = column.property
|
|
|
+ if (['orderQuantity', 'amount', 'partsCost', 'partsPrice', 'productPrice', 'actualQuantity'].includes(prop)) {
|
|
|
+ let values = this.data.map(item => Number(item[prop] || 0));
|
|
|
+ let all = values.length !== 0 ? sums[index] = values.reduce((a, b) => {
|
|
|
+ return a + b;
|
|
|
+ }) : 0
|
|
|
+ if (prop == 'orderQuantity') {
|
|
|
+ sums[index] = micrometerFormat2(all)
|
|
|
}
|
|
|
- return sums;
|
|
|
- },
|
|
|
+ if (prop == 'amount') {
|
|
|
+ sums[index] = micrometerFormat2(all)
|
|
|
+ }
|
|
|
+ if (prop == 'partsCost') {
|
|
|
+ sums[index] = micrometerFormat2(all)
|
|
|
+ }
|
|
|
+ if (prop == 'partsPrice') {
|
|
|
+ sums[index] = micrometerFormat2(all)
|
|
|
+ }
|
|
|
+ if (prop == 'productPrice') {
|
|
|
+ sums[index] = micrometerFormat2(all)
|
|
|
+ }
|
|
|
+ if (prop == 'actualQuantity') {
|
|
|
+ sums[index] = micrometerFormat2(all)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
async saveColumn() {
|
|
|
const inSave = await this.saveColumnData(
|
|
|
this.getColumnName(5),
|
|
|
this.tableOption
|
|
|
);
|
|
|
- if (localStorage.getItem("roleName").indexOf('贸易') == -1 && localStorage.getItem("roleName").indexOf('运营') == -1) {
|
|
|
- this.findObject(this.tableOption.column, "purchaseCost").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "purchaseCost").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "partsPrice").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "partsPrice").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "partsCost").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "partsCost").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "purchaseAmount").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "purchaseAmount").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "corpName").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "corpName").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "productPrice").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "productPrice").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "productPrice").display = true;
|
|
|
- }
|
|
|
+ if (localStorage.getItem("roleName").indexOf('贸易') == -1 && localStorage.getItem("roleName").indexOf('运营') == -1) {
|
|
|
+ this.findObject(this.tableOption.column, "purchaseCost").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "purchaseCost").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsPrice").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "partsPrice").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsCost").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "partsCost").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "purchaseAmount").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "purchaseAmount").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "corpName").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "corpName").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "productPrice").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "productPrice").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "productPrice").display = true;
|
|
|
+ }
|
|
|
if (inSave) {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.crud.doLayout();
|
|
@@ -1437,21 +1472,21 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.crud.doLayout();
|
|
|
});
|
|
|
- if (localStorage.getItem("roleName").indexOf('贸易') == -1 && localStorage.getItem("roleName").indexOf('运营') == -1) {
|
|
|
- this.findObject(this.tableOption.column, "purchaseCost").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "purchaseCost").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "partsPrice").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "partsPrice").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "partsCost").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "partsCost").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "purchaseAmount").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "purchaseAmount").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "corpName").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "corpName").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "productPrice").hide = false;
|
|
|
- this.findObject(this.tableOption.column, "productPrice").showColumn = true;
|
|
|
- this.findObject(this.tableOption.column, "productPrice").display = true;
|
|
|
- }
|
|
|
+ if (localStorage.getItem("roleName").indexOf('贸易') == -1 && localStorage.getItem("roleName").indexOf('运营') == -1) {
|
|
|
+ this.findObject(this.tableOption.column, "purchaseCost").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "purchaseCost").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsPrice").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "partsPrice").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsCost").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "partsCost").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "purchaseAmount").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "purchaseAmount").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "corpName").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "corpName").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "productPrice").hide = false;
|
|
|
+ this.findObject(this.tableOption.column, "productPrice").showColumn = true;
|
|
|
+ this.findObject(this.tableOption.column, "productPrice").display = true;
|
|
|
+ }
|
|
|
this.$message.success("重置成功");
|
|
|
//关闭窗口
|
|
|
setTimeout(() => {
|
|
@@ -1493,7 +1528,7 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
dialog(newVla, oldVal) {
|
|
|
- if (newVla){
|
|
|
+ if (newVla) {
|
|
|
this.pickerValue = dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
|
|
|
}
|
|
|
}
|