|
@@ -208,6 +208,7 @@
|
|
|
@selection-change="productSelection"
|
|
|
@row-del="rowDel"
|
|
|
@saveColumn="saveColumn('goods')"
|
|
|
+ @resetColumn="resetColumn"
|
|
|
:summary-method="summaryMethod"
|
|
|
:table-loading="goodsLoading"
|
|
|
>
|
|
@@ -1520,6 +1521,8 @@ export default {
|
|
|
this.$set(this.form, 'convertIntegral' , 0)
|
|
|
this.$set(this.form, 'profit' , 0)
|
|
|
this.$set(this.form, 'paymentType', '预付')
|
|
|
+ this.$set(this.form, 'thisUsedProfit' , 0)
|
|
|
+ this.$set(this.form, 'createProfit' , 0)
|
|
|
let date = new Date();
|
|
|
let year = date.getFullYear();
|
|
|
let month = date.getMonth() + 1;
|
|
@@ -2658,9 +2661,17 @@ export default {
|
|
|
editCustomer(isBack = false, type) {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- for (let item in this.contactsData) {
|
|
|
- if (Number(this.contactsData[item].orderQuantity) < Number(this.contactsData[item].actualQuantity)) {
|
|
|
- return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能小于发货数量')
|
|
|
+ //商品信息
|
|
|
+ if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
|
|
|
+ this.form.orderItemsList = this.goodsShowData.concat(this.contactsData)
|
|
|
+ } else {
|
|
|
+ this.form.orderItemsList = this.goodsShowData.concat(this.giftData)
|
|
|
+ }
|
|
|
+ // 判断是否能保存
|
|
|
+ let goodsData = this.goodsShowData.filter(item => item.goodType == 0)
|
|
|
+ for (let item in this.goodsData) {
|
|
|
+ if (Number(goodsData[item].orderQuantity) > Number(goodsData[item].storageQuantity)) {
|
|
|
+ return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能超过库存')
|
|
|
}
|
|
|
}
|
|
|
this.form.orderFeesList = this.$refs.feeInfo.submitData()
|
|
@@ -2672,6 +2683,9 @@ export default {
|
|
|
if (packFee == -1) {
|
|
|
return this.$message.error('费用明细未有包装费')
|
|
|
}
|
|
|
+ // 产生返利、本次使用返利为空 默认为0
|
|
|
+ this.form.createProfit = this.form.createProfit? this.form.createProfit: 0
|
|
|
+ this.form.thisUsedProfit = this.form.thisUsedProfit? this.form.thisUsedProfit: 0
|
|
|
// 计算毛利额
|
|
|
this.$set(this.form, 'orderAmount', 0)
|
|
|
// 成本价
|
|
@@ -2679,12 +2693,6 @@ export default {
|
|
|
if (this.form.orderAmount && this.form.settlmentAmount) {
|
|
|
this.$set(this.form, "balanceAmount", (Number(this.form.orderAmount) - Number(this.form.settlmentAmount)).toFixed(2));
|
|
|
}
|
|
|
- //商品信息
|
|
|
- if (this.goodsShowData.findIndex(item => item.goodType == 0) == -1) {
|
|
|
- this.form.orderItemsList = this.goodsShowData.concat(this.contactsData)
|
|
|
- } else {
|
|
|
- this.form.orderItemsList = this.goodsShowData.concat(this.giftData)
|
|
|
- }
|
|
|
// 销售金额
|
|
|
this.form.orderAmount = 0;
|
|
|
// 计算销售金额
|
|
@@ -2867,11 +2875,6 @@ export default {
|
|
|
},
|
|
|
// 保存列设置
|
|
|
async saveColumn(name) {
|
|
|
- /**
|
|
|
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
- */
|
|
|
if (name == 'goods') {
|
|
|
const inSave = await this.saveColumnData(
|
|
|
this.getColumnName(15),
|
|
@@ -2901,7 +2904,6 @@ export default {
|
|
|
);
|
|
|
if (inSave) {
|
|
|
this.$message.success("重置成功");
|
|
|
- this.option = option;
|
|
|
//关闭窗口
|
|
|
this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
}
|