|
@@ -0,0 +1,142 @@
|
|
|
+const _Http = getApp().globalData.http;
|
|
|
+let sys_enterpriseid = null,
|
|
|
+ sys_enterprise_bankid = 0;
|
|
|
+
|
|
|
+Page({
|
|
|
+ data: {
|
|
|
+ form: [{
|
|
|
+ label: "联系人",
|
|
|
+ error: false,
|
|
|
+ errMsg: "",
|
|
|
+ type: "text",
|
|
|
+ value: "",
|
|
|
+ placeholder: "请填写",
|
|
|
+ valueName: "name",
|
|
|
+ required: true,
|
|
|
+ checking: "base"
|
|
|
+ }, {
|
|
|
+ label: "手机号",
|
|
|
+ error: false,
|
|
|
+ errMsg: "",
|
|
|
+ type: "number",
|
|
|
+ value: "",
|
|
|
+ placeholder: "联系人手机号码",
|
|
|
+ valueName: "phonenumber",
|
|
|
+ required: true,
|
|
|
+ checking: "phone"
|
|
|
+ }, {
|
|
|
+ label: "开户行",
|
|
|
+ error: false,
|
|
|
+ errMsg: "",
|
|
|
+ type: "textarea",
|
|
|
+ value: "",
|
|
|
+ placeholder: "开户银行",
|
|
|
+ valueName: "bank",
|
|
|
+ required: true,
|
|
|
+ checking: "base"
|
|
|
+ }, {
|
|
|
+ label: "银行卡号",
|
|
|
+ error: false,
|
|
|
+ errMsg: "",
|
|
|
+ type: "number",
|
|
|
+ value: "",
|
|
|
+ placeholder: "银行卡号",
|
|
|
+ hint: "银行卡号格式错误!",
|
|
|
+ valueName: "bankcardno",
|
|
|
+ required: true,
|
|
|
+ checking: `^([1-9]{1})(\\d{15}|\\d{16}|\\d{18})$`
|
|
|
+ }],
|
|
|
+ disabled: true,
|
|
|
+ isDelete: false, //是否允许删除
|
|
|
+ },
|
|
|
+ onLoad(options) {
|
|
|
+ sys_enterpriseid = options.id
|
|
|
+ if (options.item) {
|
|
|
+ let item = JSON.parse(options.item);
|
|
|
+ sys_enterprise_bankid = item.sys_enterprise_bankid;
|
|
|
+ this.setData({
|
|
|
+ form: this.data.form.map(v => {
|
|
|
+ v.value = item[v.valueName] || "";
|
|
|
+ return v
|
|
|
+ }),
|
|
|
+ isDelete: true
|
|
|
+ })
|
|
|
+ this.selectComponent("#Form").confirm();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submit() {
|
|
|
+ let content = this.selectComponent("#Form").submit();
|
|
|
+ content.sys_enterpriseid = sys_enterpriseid;
|
|
|
+ content.sys_enterprise_bankid = sys_enterprise_bankid;
|
|
|
+ content.isdefault = 0;
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221022165703,
|
|
|
+ content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("新建卡号", res)
|
|
|
+ wx.showToast({
|
|
|
+ title: res.msg != '成功' ? res.msg : "保存成功",
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ if (res.msg == '成功') setTimeout(() => {
|
|
|
+ let page = getCurrentPages()[getCurrentPages().length - 2];
|
|
|
+ let con = page.data.content;
|
|
|
+ con.pageSize = (con.pageNumber - 1) * 20;
|
|
|
+ con.pageNumber = 1;
|
|
|
+ _Http.basic({
|
|
|
+ "id": "20221022165803",
|
|
|
+ content: con
|
|
|
+ }).then(res => {
|
|
|
+ wx.navigateBack();
|
|
|
+ if (res.msg == '成功') {
|
|
|
+ page.setData({
|
|
|
+ list: res.data
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ page.getList(true);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 500)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 处理删除 */
|
|
|
+ handleDelete() {
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否确认删除?',
|
|
|
+ complete: ({
|
|
|
+ confirm
|
|
|
+ }) => {
|
|
|
+ if (confirm) _Http.basic({
|
|
|
+ "id": "20221022165903",
|
|
|
+ "content": {
|
|
|
+ "sys_enterprise_bankids": [sys_enterprise_bankid]
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("删除", res)
|
|
|
+ wx.showToast({
|
|
|
+ title: res.msg != '成功' ? res.msg : "删除成功",
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ if (res.msg == '成功') setTimeout(() => {
|
|
|
+ let page = getCurrentPages()[getCurrentPages().length - 2];
|
|
|
+ page.setData({
|
|
|
+ list: page.data.list.filter(v => v.sys_enterprise_bankid != sys_enterprise_bankid)
|
|
|
+ })
|
|
|
+ wx.navigateBack();
|
|
|
+ }, 500)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 表单是否填写完成 */
|
|
|
+ onConfirm({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ this.setData({
|
|
|
+ disabled: detail
|
|
|
+ })
|
|
|
+ },
|
|
|
+})
|