Commit af94cf8d authored by 刘文虎's avatar 刘文虎

修改刷新逻辑

parent f8c19950
Pipeline #3950 canceled with stages
...@@ -195,6 +195,7 @@ export default { ...@@ -195,6 +195,7 @@ export default {
async handleClickConfirm() { async handleClickConfirm() {
try { try {
let { data } = await updateOfferTemplate({ id: this.id,deleteFlag:true }); let { data } = await updateOfferTemplate({ id: this.id,deleteFlag:true });
uni.$emit("on-custom-price-delete",{id: this.id})
this.$u.route({ this.$u.route({
type: 'back' type: 'back'
}); });
......
...@@ -84,6 +84,12 @@ export default { ...@@ -84,6 +84,12 @@ export default {
}); });
}, },
toEdit(item) { toEdit(item) {
uni.$once("on-custom-price-delete",(res)=>{
if(res&&this.id===res.id){
uni.$emit('update-custom-id',this.list[0])
this.$store.dispatch("Save_custom_id",this.list[0].id)
}
})
this.$u.route({ this.$u.route({
url: '/pages/bill/quoted-price/create/edit', url: '/pages/bill/quoted-price/create/edit',
params: { params: {
...@@ -149,19 +155,13 @@ export default { ...@@ -149,19 +155,13 @@ export default {
}, },
handleCancel() {}, handleCancel() {},
async onDelete() { async onDelete() {
try { try {
let params = { let params = {
id: this.readyDeleteItem.id id: this.readyDeleteItem.id
}; };
let { data } = await deleteById(params); let { data } = await deleteById(params);
await this.getList(); await this.getList();
console.log("this.id",this.id)
console.log("this.readyDeleteItem",this.readyDeleteItem.id)
if(this.id===this.readyDeleteItem.id){
uni.$emit('update-custom-id',this.list[0])
this.$store.dispatch("Save_custom_id",this.list[0].id)
}
} catch (e) { } catch (e) {
console.log(e); console.log(e);
//TODO handle the exception //TODO handle the exception
......
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