Commit ebe649fb authored by Facius's avatar Facius

feat: 通用账单复制

parent befaec7f
......@@ -620,9 +620,23 @@ export default {
}
},
copyBill() {
this.toCreatePage({
copyId: this.billId
}, 'redirectTo');
if (this.isCollection) {
this.$u.route({
url: '/pages/maintain-bill/normal-create',
type: 'redirectTo',
params: {
copyId: this.billId
}
});
} else {
this.$u.route({
url: 'pages/maintain-bill/create',
type: 'redirectTo',
params: {
copyId: this.billId
}
});
}
},
handleClickPreview(index) {
uni.previewImage({
......
......@@ -156,6 +156,8 @@
},
data() {
return {
copyId: '',
billId: '',
chooseMemberImage: billBaseUrl + 'tiaozhuantongxunlu@3x.png',
loading: false,
buttonLoading: false,
......@@ -216,13 +218,15 @@
onLoad(options) {
// 测试数据
// options.billId = '1550685581418168320'
if (options && options.copyId) {
this.copyId = options.copyId;
}
if (options && options.billId) {
this.billId = options.billId;
}
if (this.billId) {
this.repairDetail();
if (this.billId || this.copyId) {
this.repairDetail(this.billId || this.copyId);
}
// uni.$on('maintain-bill-detail', res => {
// this.repairDetail();
......@@ -247,10 +251,10 @@
this.form.customerPhone = item.phone;
this.showMember = false;
},
repairDetail() {
repairDetail(id) {
this.loading = true;
repairDetail({
id: this.billId
id: id
})
.then(res => {
if (res.data) {
......@@ -264,10 +268,10 @@
},
setForm(data) {
this.form = {
id: data.id,
actualAmount: data.actualAmount,
customerName: data.customerName,
customerPhone: data.customerPhone,
customerName: data.customer.name,
customerPhone: data.customer.phone,
remark: data.remark,
extend: {
collectionReason: data.extend.collectionReason,
collectionTime: data.extend.collectionTime,
......@@ -277,6 +281,13 @@
receivableAmount: data.receivableAmount,
type: data.type || 'collection', // 收据样式
};
if (this.billId) {
this.form.id = data.id
this.form.copyId = ''
} else if (this.copyId) {
this.form.id = ''
this.form.copyId = data.id
}
},
handleSelectType(name) {
this.form.extend.payType = name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment