| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- const _Http = getApp().globalData.http;
- Component({
- properties: {},
- data: {
- show: false,
- endreason: ""
- },
- methods: {
- onClick(sa_projectid) {
- this.setData({
- show: true
- })
- let Dialog = this.selectComponent("#Dialog");
- Dialog.data.beforeClose = (action) => new Promise((resolve) => {
- if (action === 'confirm') {
- if (!this.data.endreason) {
- Dialog.setData({
- "loading.confirm": false
- })
- wx.showToast({
- title: '还未填写结案原因',
- icon: "none"
- })
- } else {
- _Http.basic({
- "id": 20221215163702,
- "content": {
- sa_projectid,
- endreason: this.data.endreason
- }
- }).then(res => {
- console.log('结案', res)
- wx.showToast({
- title: res.msg == '成功' ? '已结案' : res.msg,
- icon: "none"
- });
- resolve(true);
- let page = getCurrentPages()[getCurrentPages().length - 1];
- page.getDetail();
- })
- }
- } else {
- resolve(false);
- this.setData({
- show: false
- })
- }
- });
- },
- onChange(e) {
- this.data.endreason = e.detail.value;
- }
- }
- })
|