管灌系统农户端微信小程序(嘉峪关应用)
pages/irrigation/irrigation.js
@@ -239,6 +239,51 @@
      }
    });
  },
  /**
   * 点击删除按钮
   */
  onDelete: function (e) {
    const id = e.currentTarget.dataset.id;
    wx.showModal({
      title: '确认删除',
      content: '确定要删除该轮灌计划吗?',
      success: (res) => {
        if (res.confirm) {
          // 调用删除接口
          post({
            url: '/wx/plan/deletePlan',
            data: {
              planId: id,
              operatorId: app.globalData.clientId
            },
            isShowLoding: true
          }).then(res => {
            if (res.success) {
              wx.showToast({
                title: '删除成功',
                icon: 'success'
              });
              // 刷新数据
              this.loadIrrigationData();
            } else {
              wx.showToast({
                title: res.msg || '删除失败',
                icon: 'none'
              });
            }
          }).catch(err => {
            console.error('删除失败:', err);
            wx.showToast({
              title: '删除失败',
              icon: 'none'
            });
          });
        }
      }
    });
  },
  //终止轮灌计划
   postStop(planID){
    post({