|
@@ -19,10 +19,17 @@
|
|
|
type="warning"
|
|
|
:disabled="detailData.seeDisabled"
|
|
|
size="small"
|
|
|
- @click="applySettlement"
|
|
|
+ @click="applySettlement('收费')"
|
|
|
>生成账单</el-button>
|
|
|
<el-button
|
|
|
class="el-button--small-yh"
|
|
|
+ type="warning"
|
|
|
+ :disabled="detailData.seeDisabled"
|
|
|
+ size="small"
|
|
|
+ @click="applySettlement('申请')"
|
|
|
+ >退款</el-button>
|
|
|
+ <el-button
|
|
|
+ class="el-button--small-yh"
|
|
|
type="primary"
|
|
|
:disabled="detailData.seeDisabled"
|
|
|
size="small"
|
|
@@ -1383,21 +1390,10 @@ export default {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
- }).then(() => {
|
|
|
- this.editCustomer(false)
|
|
|
+ }).then(async () => {
|
|
|
+ await this.editCustomer(false, '采购')
|
|
|
}).catch(() => {
|
|
|
this.$message.info('已取消')
|
|
|
- // this.$confirm("是否生成采购单?", {
|
|
|
- // confirmButtonText: "确定",
|
|
|
- // cancelButtonText: "取消",
|
|
|
- // type: "warning"
|
|
|
- // }).then(() => {
|
|
|
- // saveSell(this.form.id).then(res => {
|
|
|
- // if (res.data.code == 200) {
|
|
|
- // this.$message.success("生成成功");
|
|
|
- // }
|
|
|
- // });
|
|
|
- // });
|
|
|
})
|
|
|
} else {
|
|
|
this.$confirm("是否生成采购单?", {
|
|
@@ -1536,7 +1532,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//生成发货单
|
|
|
- generateShipmentD() {
|
|
|
+ async generateShipmentD() {
|
|
|
let lsit = []
|
|
|
if (contrastObj(this.form, this.oldForm) ||
|
|
|
contrastList(this.contactsData, this.oldGoodsList) ||
|
|
@@ -1548,29 +1544,14 @@ export default {
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
- this.editCustomer(false)
|
|
|
+ this.editCustomer(false, '发货')
|
|
|
}).catch(() => {
|
|
|
this.$message({
|
|
|
type: 'info',
|
|
|
message: '已取消'
|
|
|
});
|
|
|
- // this.selection.forEach(item => {
|
|
|
- // lsit.push(item.id)
|
|
|
- // })
|
|
|
- // let data = {
|
|
|
- // id: this.form.id,
|
|
|
- // orderItemIds: lsit
|
|
|
- // }
|
|
|
- // generateShipment(data).then(res => {
|
|
|
- // this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
|
|
|
- // this.$router.push({
|
|
|
- // path: "/businessManagement/deliveryNotice/index",
|
|
|
- // query: {form: JSON.stringify(res.data.data)},
|
|
|
- // });
|
|
|
- // })
|
|
|
})
|
|
|
} else {
|
|
|
- // lsit.push(this.selection[item].id)
|
|
|
this.selection.forEach(item => {
|
|
|
lsit.push(item.id)
|
|
|
})
|
|
@@ -1588,7 +1569,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 生成结算
|
|
|
- applySettlement() {
|
|
|
+ applySettlement(type) {
|
|
|
if (contrastObj(this.form, this.oldForm) ||
|
|
|
contrastList(this.contactsData, this.oldGoodsList) ||
|
|
|
contrastList(this.advantageProjectData, this.oldFeesList) ||
|
|
@@ -1603,12 +1584,13 @@ export default {
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
} else {
|
|
|
- this.beforeBillData(true)
|
|
|
+ this.beforeBillData(true,type)
|
|
|
this.applySettlementDialog = true;
|
|
|
}
|
|
|
},
|
|
|
//生成账单 拿到主表信息
|
|
|
- beforeBillData(type){
|
|
|
+ beforeBillData(bool,type){
|
|
|
+ this.billType = type
|
|
|
this.billData = {
|
|
|
srcOrderno:this.form.orgOrderNo,
|
|
|
itemType:"销售",
|
|
@@ -1620,7 +1602,7 @@ export default {
|
|
|
taxRate: '0',
|
|
|
accDate: this.form.businesDate,
|
|
|
}
|
|
|
- if(type){ //申请货款
|
|
|
+ if(bool){ //申请货款
|
|
|
this.billData.srcId = -1
|
|
|
}
|
|
|
},
|
|
@@ -2104,7 +2086,7 @@ export default {
|
|
|
done();
|
|
|
},
|
|
|
//修改提交触发
|
|
|
- editCustomer(isBack = false) {
|
|
|
+ editCustomer(isBack = false, type) {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
for (let item in this.contactsData) {
|
|
@@ -2116,7 +2098,6 @@ export default {
|
|
|
if (this.form.packageRemarks) {
|
|
|
packFee = this.advantageProjectData.findIndex(item => item.feeName == '包装费')
|
|
|
}
|
|
|
- console.log(packFee)
|
|
|
if (packFee == -1) {
|
|
|
return this.$message.error('费用明细未有包装费')
|
|
|
}
|
|
@@ -2151,6 +2132,35 @@ export default {
|
|
|
} else {
|
|
|
this.queryData(res.data.data.id)
|
|
|
}
|
|
|
+ if (type == '发货') {
|
|
|
+ let lsit = []
|
|
|
+ this.selection.forEach(item => {
|
|
|
+ lsit.push(item.id)
|
|
|
+ })
|
|
|
+ let data = {
|
|
|
+ id: this.form.id,
|
|
|
+ orderItemIds: lsit
|
|
|
+ }
|
|
|
+ generateShipment(data).then(res => {
|
|
|
+ this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
|
|
|
+ this.$router.push({
|
|
|
+ path: "/businessManagement/deliveryNotice/index",
|
|
|
+ query: {form: JSON.stringify(res.data.data)},
|
|
|
+ });
|
|
|
+ })
|
|
|
+ } else if (type == '采购') {
|
|
|
+ this.$confirm("是否生成采购单?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ saveSell(this.form.id).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.$message.success("生成成功");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
}).finally(() => {
|
|
|
this.saveLoading = false
|
|
|
})
|