|
@@ -226,6 +226,9 @@
|
|
|
<el-input type="age" v-else-if="item.prop === 'specialOfferOf'" v-model.trim="form[item.prop]" size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled || browse" v-input-limit="2">
|
|
|
<template slot="append">%</template>
|
|
|
</el-input>
|
|
|
+ <el-input type="age" v-else-if="item.prop === 'largeScale'" v-model.trim="form[item.prop]" size="small" autocomplete="off" placeholder="请输入" :disabled="detailData.seeDisabled || browse" v-input-limit="2">
|
|
|
+ <template slot="append">%</template>
|
|
|
+ </el-input>
|
|
|
<el-input
|
|
|
v-else-if="item.type == 'number'"
|
|
|
placeholder="请输入"
|
|
@@ -394,7 +397,7 @@
|
|
|
size="small"
|
|
|
:disabled="selection.length < 1 || detailData.seeDisabled || !form.status || form.status < 3"
|
|
|
@click="getShipmentD"
|
|
|
- v-show="goodsActives == 'goods'">生成客户确认
|
|
|
+ v-show="goodsActives == 'goods'">生成客户收货
|
|
|
</el-button>
|
|
|
<el-button type="info"
|
|
|
:size="size"
|
|
@@ -489,6 +492,16 @@
|
|
|
<el-tab-pane label="已选定数据" name="importStaging"/>
|
|
|
</el-tabs>
|
|
|
</template>
|
|
|
+ <template slot="orderQuantity" slot-scope="{row, index}">
|
|
|
+ <el-input-number
|
|
|
+ v-model="row.orderQuantity"
|
|
|
+ size="small"
|
|
|
+ :controls="false"
|
|
|
+ :precision="0"
|
|
|
+ @input="amountChange(row)"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
<template slot-scope="scope" slot="menu">
|
|
|
<el-button
|
|
|
type="text"
|
|
@@ -1189,7 +1202,11 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- },{
|
|
|
+ }, {
|
|
|
+ label: '大尺寸占比',
|
|
|
+ prop: 'largeScale',
|
|
|
+ disabled: false,
|
|
|
+ }, {
|
|
|
label: '单据状态',
|
|
|
prop: 'orderStatus',
|
|
|
disabled: true,
|
|
@@ -1621,7 +1638,9 @@ export default {
|
|
|
if (this.detailData.copyId) {
|
|
|
this.queryData(this.detailData.copyId, true)
|
|
|
}
|
|
|
- this.oldForm = Object.assign({}, this.form)
|
|
|
+ this.oldForm = Object.assign({}, this.form);
|
|
|
+ this.customerBuyFree.height = (window.innerHeight - 330) / 2;
|
|
|
+ this.optionPolicy.height = (window.innerHeight - 330) / 2;
|
|
|
},
|
|
|
methods: {
|
|
|
getGoodsRow(event,row) {
|
|
@@ -1992,7 +2011,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (this.$store.getters.inStatus) {
|
|
|
- this.$alert("客户确认存在,请保存客户确认再进行操作", "温馨提示", {
|
|
|
+ this.$alert("客户收货存在,请保存客户收货再进行操作", "温馨提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
type: "warning",
|
|
|
callback: action => {
|
|
@@ -2094,25 +2113,53 @@ export default {
|
|
|
this.applyPaymentList = [];
|
|
|
let arr = [];
|
|
|
this.billType = type
|
|
|
- this.billData = {
|
|
|
- belongCompany: this.form.belongCompany,
|
|
|
- srcOrderno:this.form.orgOrderNo,
|
|
|
- itemType:"销售",
|
|
|
- corpsName:this.form.corpName,
|
|
|
- corpId:this.form.corpId,
|
|
|
- srcParentId: this.form.id,
|
|
|
- currency: 'CNY',
|
|
|
- exchangeRate: '1',
|
|
|
- taxRate: '0',
|
|
|
- accDate: this.form.businesDate,
|
|
|
- srcType: 1,
|
|
|
- tradeType: 'GN',
|
|
|
- optionType: 'GN',
|
|
|
- chargeMember: this.form.chargeMember,
|
|
|
- amount: this.form.balanceAmount,
|
|
|
- costType: this.feesOption.find(e => e.cname == '货款').id
|
|
|
- }
|
|
|
- arr.push(this.billData)
|
|
|
+ const data = this.goodsActives === 'gift'? this.contactsData: this.goodsShowData
|
|
|
+ data.map(e => {
|
|
|
+ const form = {
|
|
|
+ belongCompany: this.form.belongCompany,
|
|
|
+ srcOrderno:this.form.orgOrderNo,
|
|
|
+ itemType:"销售",
|
|
|
+ corpsName:this.form.corpName,
|
|
|
+ corpId:this.form.corpId,
|
|
|
+ srcParentId: this.form.id,
|
|
|
+ currency: 'CNY',
|
|
|
+ exchangeRate: '1',
|
|
|
+ taxRate: '0',
|
|
|
+ accDate: this.form.businesDate,
|
|
|
+ srcType: 1,
|
|
|
+ tradeType: 'GN',
|
|
|
+ optionType: 'GN',
|
|
|
+ chargeMember: this.form.chargeMember,
|
|
|
+ amount: e.amount,
|
|
|
+ quantity: e.orderQuantity, // 数量
|
|
|
+ price: e.price,
|
|
|
+ unit: e.unit,
|
|
|
+ goodName: e.cname,
|
|
|
+ costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
|
|
|
+ }
|
|
|
+ arr.push(form)
|
|
|
+ })
|
|
|
+ // this.billData = {
|
|
|
+ // belongCompany: this.form.belongCompany,
|
|
|
+ // srcOrderno:this.form.orgOrderNo,
|
|
|
+ // itemType:"销售",
|
|
|
+ // corpsName:this.form.corpName,
|
|
|
+ // corpId:this.form.corpId,
|
|
|
+ // srcParentId: this.form.id,
|
|
|
+ // currency: 'CNY',
|
|
|
+ // exchangeRate: '1',
|
|
|
+ // taxRate: '0',
|
|
|
+ // accDate: this.form.businesDate,
|
|
|
+ // srcType: 1,
|
|
|
+ // tradeType: 'GN',
|
|
|
+ // optionType: 'GN',
|
|
|
+ // chargeMember: this.form.chargeMember,
|
|
|
+ // amount: this.form.balanceAmount,
|
|
|
+ // quantity: 0, // 数量
|
|
|
+ // price: 0,
|
|
|
+ // costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
|
|
|
+ // }
|
|
|
+ // arr.push(this.billData)
|
|
|
let getFeeList = this.$refs.feeInfo.submitData().filter(item => item.feesType == 1)
|
|
|
getFeeList.forEach(item => {
|
|
|
let form = {
|
|
@@ -2350,10 +2397,11 @@ export default {
|
|
|
this.goodsListSave[item].itemId = this.goodsListSave[item].id
|
|
|
this.$set(this.goodsListSave[item], 'corpName', this.goodsListSave[item].corpName)
|
|
|
this.$set(this.goodsListSave[item], 'itemType', this.goodsListSave[item].typeno)
|
|
|
- this.$set(this.goodsListSave[item], 'orderQuantity', 1)
|
|
|
+ // this.$set(this.goodsListSave[item], 'orderQuantity', 1)
|
|
|
this.$set(this.goodsListSave[item], 'actualQuantity', 0)
|
|
|
this.$set(this.goodsListSave[item], 'invoiceWeight', this.goodsListSave[item].cartonWeight)
|
|
|
this.$set(this.goodsListSave[item], 'shopQuality', 0)
|
|
|
+ this.$set(this.goodsListSave[item], 'inputMold', 0) // 判断是商品还是政策 商品 0 特价 1 买赠2
|
|
|
this.goodsListSave[item].amount = 0
|
|
|
if (this.goodsActives == "goods") {
|
|
|
this.$set(this.goodsListSave[item], 'goodType', 0)
|
|
@@ -2413,10 +2461,11 @@ export default {
|
|
|
this.tableData[item].itemId = this.tableData[item].id
|
|
|
this.$set(this.tableData[item], 'corpName', this.tableData[item].corpName)
|
|
|
this.$set(this.tableData[item], 'itemType', this.tableData[item].typeno)
|
|
|
- this.$set(this.tableData[item], 'orderQuantity', 1)
|
|
|
+ // this.$set(this.tableData[item], 'orderQuantity', 1)
|
|
|
this.$set(this.tableData[item], 'actualQuantity', 0)
|
|
|
this.$set(this.tableData[item], 'shopQuality', 0)
|
|
|
this.$set(this.tableData[item], 'invoiceWeight', this.tableData[item].cartonWeight)
|
|
|
+ this.$set(this.tableData[item], 'inputMold', 0)
|
|
|
this.tableData[item].amount = 0
|
|
|
if (this.goodsActives == "goods") {
|
|
|
this.$set(this.tableData[item], 'goodType', 0)
|
|
@@ -2547,6 +2596,7 @@ export default {
|
|
|
} else {
|
|
|
this.$set(list[item], 'price', list[item].specialOffer)
|
|
|
}
|
|
|
+ this.$set(list[item], 'inputMold', 1)
|
|
|
} else {
|
|
|
if (!list[item].salePrice) {
|
|
|
getMarketPrice({code: list[item].code, isFreight: this.form.isFreight, isLabel: this.form.isLabel}).then(response => {
|
|
@@ -2559,6 +2609,8 @@ export default {
|
|
|
} else {
|
|
|
this.$set(list[item], 'price', list[item].salePrice)
|
|
|
}
|
|
|
+ this.$set(list[item], 'inputMold', 2)
|
|
|
+ this.$set(buyFree[item], 'inputMold', 2)
|
|
|
this.$set(buyFree[item], 'price', '0')
|
|
|
this.$set(buyFree[item], 'orderQuantity', list[item].salesVolume)
|
|
|
this.$set(buyFree[item], 'itemType', list[item].typeno)
|
|
@@ -2710,7 +2762,7 @@ export default {
|
|
|
// this.policyLoading = true;
|
|
|
this.policyForm = {};
|
|
|
detailList(this.treePolicyId).then(res => {
|
|
|
- this.policyForm = res.data.data
|
|
|
+ this.policyForm = res.data.data;
|
|
|
//特价促销
|
|
|
if(res.data.data.specialItemList) {
|
|
|
this.dataPolicy = res.data.data.specialItemList
|
|
@@ -2801,7 +2853,6 @@ export default {
|
|
|
const length = this.goodsActives === 'gift'? this.contactsData.length: this.goodsShowData.length
|
|
|
for (let i = 0;i < length;i++) {
|
|
|
const data = this.goodsActives === 'gift'? this.contactsData: this.goodsShowData;
|
|
|
- console.log(data[i])
|
|
|
if (Number(data[i].orderQuantity) > Number(data[i].storageQuantity)) {
|
|
|
return this.$message.error('商品信息第' + (Number(i) + 1) + '行订货数量大于库存数量')
|
|
|
}
|
|
@@ -2813,7 +2864,16 @@ export default {
|
|
|
this.form.orderItemsList = this.goodsShowData.concat(this.giftData)
|
|
|
}
|
|
|
// 判断是否能保存
|
|
|
- let goodsData = this.goodsShowData.filter(item => item.goodType == 0)
|
|
|
+ let goodsData = this.form.orderItemsList.filter(item => item.goodType == 0)
|
|
|
+ // 计算特价占比
|
|
|
+ let allNum = 0; // 总数量
|
|
|
+ let specialNum = 0; // 特价数量
|
|
|
+ let sizeNum = 0; // 大尺寸数量
|
|
|
+ goodsData.forEach(item => allNum += Number(item.orderQuantity));
|
|
|
+ goodsData.filter(item => item.inputMold === 1).forEach(item => specialNum += Number(item.orderQuantity));
|
|
|
+ goodsData.filter(item => Number(item.size) >= 17).forEach(item => sizeNum += Number(item.orderQuantity));
|
|
|
+ this.$set(this.form, 'specialOfferOf', (specialNum / allNum * 100).toFixed(2));
|
|
|
+ this.$set(this.form, 'largeScale', (sizeNum / allNum * 100).toFixed(2));
|
|
|
for (let item in this.goodsData) {
|
|
|
if (Number(goodsData[item].orderQuantity) > Number(goodsData[item].storageQuantity)) {
|
|
|
return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能超过库存')
|
|
@@ -2841,7 +2901,7 @@ export default {
|
|
|
// 销售金额
|
|
|
this.form.orderAmount = 0;
|
|
|
// 计算销售金额
|
|
|
- this.goodsShowData.forEach(item => {
|
|
|
+ this.form.orderItemsList.forEach(item => {
|
|
|
if (item.goodType == 0) {
|
|
|
if (item.purchaseAmount) {
|
|
|
purchaseAmount += (Number(item.purchaseAmount) * Number(item.orderQuantity)).toFixed(2)
|
|
@@ -3378,6 +3438,16 @@ export default {
|
|
|
closeChangeApprove() {
|
|
|
this.changeApproveVis = false
|
|
|
},
|
|
|
+ // 商品信息价格计算
|
|
|
+ amountChange(row) {
|
|
|
+ if (!row.orderQuantity) {
|
|
|
+ row.orderQuantity = 0;
|
|
|
+ }
|
|
|
+ if (!row.price) {
|
|
|
+ row.price = 0;
|
|
|
+ }
|
|
|
+ row.amount = Number(row.price) * Number(row.orderQuantity)
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(["userInfo", "permission"])
|