| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- const _Http = getApp().globalData.http;
- let sa_projectid = null;
- Page({
- data: {
- deletereason: "",
- loading: false,
- },
- onLoad(options) {
- sa_projectid = options.id;
- getApp().globalData.Language.getLanguagePackage(this, '作废原因');
- },
- onInput(e) {
- this.setData({
- deletereason: e.detail.value
- })
- },
- handleDetele() {
- let that = this;
- wx.showModal({
- title: getApp().globalData.Language.getMapText('提示'),
- content: getApp().globalData.Language.getMapText('是否确认作废该项目') + '?',
- cancelText: getApp().globalData.Language.getMapText('取消'),
- confirmText: getApp().globalData.Language.getMapText('确定'),
- complete: ({
- confirm
- }) => {
- if (confirm) {
- that.setData({
- loading: true
- })
- _Http.basic({
- "id": 20221020144302,
- "content": {
- "sa_projectids": [sa_projectid],
- "deletereason": that.data.deletereason
- },
- }).then(res => {
- console.log("作废", res);
- that.setData({
- loading: false
- })
- wx.showToast({
- title: res.code != '1' ? res.data : getApp().globalData.Language.getMapText('作废成功'),
- icon: "none",
- mask: true
- });
- if (res.code == '1') setTimeout(() => {
- wx.navigateBack({
- delta: 2
- });
- }, 300)
- })
- }
- }
- })
- }
- })
|