12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- const _Http = getApp().globalData.http;
- Page({
- data: {
- deletereason: "",
- },
- onLoad(options) {
- if (options.item) this.setData({
- ...JSON.parse(options.item)
- })
- },
- onInput(e) {
- this.setData({
- deletereason: e.detail.value
- })
- },
- handleDetele() {
- _Http.basic({
- "id": 20221010164402,
- "content": {
- ...this.data
- }
- }).then(res => {
- console.log("作废", res);
- if (res.msg != '成功') return wx.showToast({
- title: res.data,
- icon: "none"
- });
- wx.showToast({
- title: '作废成功',
- icon: "none"
- })
- setTimeout(() => {
- getCurrentPages().forEach(v => {
- if (['packageA/setclient/detail'].includes(v.__route__)) {
- wx.navigateBack();
- } else if (['packageA/setclient/index', 'packageA/setclient/search'].includes(v.__route__)) {
- v.setData({
- list: v.data.list.filter(s => s.sa_customersid != this.data.sa_customersids[0]),
- 'content.total': v.data.content.total - 1
- })
- }
- });
- wx.navigateBack();
- }, 300)
- })
- }
- })
|