|
@@ -1,123 +1,121 @@
|
|
|
const _Http = getApp().globalData.http;
|
|
|
Component({
|
|
|
- options: {
|
|
|
- addGlobalClass: true
|
|
|
- },
|
|
|
- properties: {
|
|
|
- list: Array,
|
|
|
- changeTotal: Function
|
|
|
- },
|
|
|
- data: {
|
|
|
- radio: 0,
|
|
|
- detailItem: {},
|
|
|
- },
|
|
|
- methods: {
|
|
|
- //打开详情
|
|
|
- onClick(e) {
|
|
|
- const {
|
|
|
- item
|
|
|
- } = e.currentTarget.dataset;
|
|
|
- this.setData({
|
|
|
- "detailItem": item
|
|
|
- })
|
|
|
- wx.navigateTo({
|
|
|
- url: '/packageA/setclient/modules/financing/detail/index?data=' + JSON.stringify(item),
|
|
|
- })
|
|
|
+ options: {
|
|
|
+ addGlobalClass: true
|
|
|
},
|
|
|
- /* 处理快捷小按钮 */
|
|
|
- handleItem(e) {
|
|
|
- const {
|
|
|
- name,
|
|
|
- item
|
|
|
- } = e.target.dataset,
|
|
|
- that = this;
|
|
|
- if (!name) return;
|
|
|
- switch (name) {
|
|
|
- case "call":
|
|
|
- wx.makePhoneCall({
|
|
|
- phoneNumber: item.phonenumber,
|
|
|
- })
|
|
|
- break;
|
|
|
- case "copy":
|
|
|
- wx.setClipboardData({
|
|
|
- data: `名称:${item.enterprisename}\n纳税人识别号:${item.taxno}\n地址:${item.address}\n开户行:${item.bank}\n账号:${item.bankcardno}`,
|
|
|
- })
|
|
|
- break;
|
|
|
- case "delete":
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '是否确认删除',
|
|
|
- complete: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- _Http.basic({
|
|
|
- "id": 20221013160502,
|
|
|
- "content": {
|
|
|
- "sys_enterprise_financeids": [item.sys_enterprise_financeid]
|
|
|
- },
|
|
|
- }).then(res => {
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
+ properties: {
|
|
|
+ list: Array,
|
|
|
+ changeTotal: Function
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ radio: 0
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //打开详情
|
|
|
+ onClick(e) {
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/packageA/setclient/modules/financing/detail/index?sys_enterprise_financeid=' + item.sys_enterprise_financeid,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 处理快捷小按钮 */
|
|
|
+ handleItem(e) {
|
|
|
+ const {
|
|
|
+ name,
|
|
|
+ item
|
|
|
+ } = e.target.dataset,
|
|
|
+ that = this;
|
|
|
+ if (!name) return;
|
|
|
+ switch (name) {
|
|
|
+ case "call":
|
|
|
+ wx.makePhoneCall({
|
|
|
+ phoneNumber: item.phonenumber,
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case "copy":
|
|
|
+ wx.setClipboardData({
|
|
|
+ data: `名称:${item.enterprisename}\n纳税人识别号:${item.taxno}\n地址:${item.address}\n开户行:${item.bank}\n账号:${item.bankcardno}`,
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case "delete":
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否确认作废',
|
|
|
+ complete: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221013160502,
|
|
|
+ "content": {
|
|
|
+ "sys_enterprise_financeids": [item.sys_enterprise_financeid]
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ that.triggerEvent("changeTotal");
|
|
|
+ getCurrentPages().forEach(v => {
|
|
|
+ switch (v.__route__) {
|
|
|
+ //退出详情界面
|
|
|
+ case 'packageA/setclient/modules/financing/detail/index':
|
|
|
+ wx.navigateBack()
|
|
|
+ break;
|
|
|
+ //列表页更新数据
|
|
|
+ case 'packageA/setclient/detail':
|
|
|
+ that.setData({
|
|
|
+ list: that.data.list.filter(v => v.sys_enterprise_financeid != item.sys_enterprise_financeid)
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ wx.showToast({
|
|
|
+ title: '作废成功',
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ case "edit":
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/packageA/setclient/modules/financing/add/index?data=' + JSON.stringify(item),
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /* 查询默认项目 */
|
|
|
+ queryDefault() {
|
|
|
+ const item = this.data.list.find(v => v.isdefault == 1);
|
|
|
+ if (!item) return;
|
|
|
+ this.setData({
|
|
|
+ radio: item.sys_enterprise_financeid
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 修改默认项 */
|
|
|
+ onChange({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221013160702,
|
|
|
+ "content": {
|
|
|
+ "sys_enterprise_financeid": detail
|
|
|
+ },
|
|
|
+ }).then(res => {
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
title: res.data,
|
|
|
icon: "none"
|
|
|
- });
|
|
|
- that.setData({
|
|
|
- list: that.data.list.filter(v => v.sys_enterprise_financeid != item.sys_enterprise_financeid)
|
|
|
- });
|
|
|
- that.triggerEvent("changeTotal");
|
|
|
- that.setData({
|
|
|
- detailItem: {}
|
|
|
- })
|
|
|
- let pages = getCurrentPages();
|
|
|
- if (pages[pages.length - 1].__route__ == 'packageA/setclient/modules/financing/detail/index') wx.navigateBack()
|
|
|
- wx.showToast({
|
|
|
- title: '删除成功',
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
});
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- break;
|
|
|
- case "edit":
|
|
|
- wx.navigateTo({
|
|
|
- url: '/packageA/setclient/modules/financing/add/index?data=' + JSON.stringify(item),
|
|
|
- });
|
|
|
- that.setData({
|
|
|
- detailItem: {}
|
|
|
- })
|
|
|
- break;
|
|
|
- }
|
|
|
- },
|
|
|
- /* 查询默认项目 */
|
|
|
- queryDefault() {
|
|
|
- const item = this.data.list.find(v => v.isdefault == 1);
|
|
|
- if (!item) return;
|
|
|
- this.setData({
|
|
|
- radio: item.sys_enterprise_financeid
|
|
|
- })
|
|
|
- },
|
|
|
- /* 修改默认项 */
|
|
|
- onChange({
|
|
|
- detail
|
|
|
- }) {
|
|
|
- _Http.basic({
|
|
|
- "id": 20221013160702,
|
|
|
- "content": {
|
|
|
- "sys_enterprise_financeid": detail
|
|
|
+ this.setData({
|
|
|
+ list: this.data.list.map(v => {
|
|
|
+ v.isdefault = v.sys_enterprise_financeid == detail ? 1 : 0
|
|
|
+ return v
|
|
|
+ }),
|
|
|
+ radio: detail
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
- }).then(res => {
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- this.setData({
|
|
|
- list: this.data.list.map(v => {
|
|
|
- v.isdefault = v.sys_enterprise_financeid == detail ? 1 : 0
|
|
|
- return v
|
|
|
- }),
|
|
|
- radio: detail
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- }
|
|
|
+ }
|
|
|
})
|