Browse Source

2024.07.08
- 重构收款账户页,增加账户类型和开户行相关字段;

zweiqin 9 months ago
parent
commit
a4cb8a69b5

+ 276 - 0
src/views/finance/account/components/EditModal.vue

@@ -0,0 +1,276 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      :rules="formRules"
+      size="mini"
+      label-suffix=":"
+      label-width="150px"
+    >
+      <!-- <p class="card">原绑定信息</p>
+        <el-form-item label="原持卡人姓名" prop="cardName">
+        <el-input v-model="formData.cardName" />
+        </el-form-item>
+        <el-form-item label="原银行卡号" prop="oldCardNumber">
+        <el-input v-model="formData.oldCardNumber" />
+        </el-form-item>
+        <p class="card">新绑定信息</p> -->
+      <el-form-item label="持卡人姓名" prop="cardName">
+        <el-input
+          v-model="formData.cardName" maxlength="20"
+          @blur="(e) => e.target.value.replace(cardNameReg, '')"
+        />
+      </el-form-item>
+      <el-form-item label="卡号" prop="cardNumber">
+        <el-input v-model="formData.cardNumber" maxlength="19" />
+      </el-form-item>
+      <el-form-item label="银行" prop="bank">
+        <el-select v-model="formData.bank" filterable placeholder="请选择所属银行">
+          <el-option v-for="item in bankList" :key="item.dictName" :label="item.dictName" :value="item.dictId" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="注册手机号" prop="phone">
+        <el-input v-model="formData.phone" maxlength="11" style="width: 120px;" />
+        <el-button style="margin-left: 10px;" type="primary" :loading="codeLoading" @click="handleSendCode(formData.phone)">
+          <span v-if="!codeLoading">获取验证码</span>
+          <span v-else>{{ codeCount }} s</span>
+        </el-button>
+      </el-form-item>
+      <el-form-item label="验证码" prop="code">
+        <el-input
+          v-model="formData.code" oninput="value=value.replace(/[^\d]/g,'')" maxlength="6"
+          style="width: 120px;"
+        />
+      </el-form-item>
+      <el-form-item label="账户类型" prop="bankType">
+        <el-radio-group v-model="formData.bankType">
+          <el-radio :label="1">对公</el-radio>
+          <el-radio :label="2">对私</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item v-if="formData.bankType === 1" label="开户行所在省市" prop="city">
+        <el-cascader
+          v-model="regionArrDialog" :props="regionProps" size="large" placeholder="请选择区域"
+          @change="((formData.province = regionArrDialog[0]) || true) && (formData.city = regionArrDialog[1])"
+        ></el-cascader>
+        <!-- <div v-if="formData.areaId">已选ID:{{ formData.areaId }}</div> -->
+      </el-form-item>
+      <el-form-item v-if="formData.bankType === 1" label="开户行详细名称" prop="bankName">
+        <el-input v-model="formData.bankName" placeholder="请输入开户行详细名称" />
+      </el-form-item>
+      <el-form-item v-if="formData.bankType === 1" label="开户行的联行号" prop="unionBank">
+        <el-input v-model="formData.unionBank" placeholder="请输入支付行号" />
+      </el-form-item>
+      <el-form-item v-if="formData.bankType === 1" label="银行代码" prop="bankCode">
+        <el-input v-model="formData.bankCode" placeholder="请输入银行代码" />
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="mini" @click="handleClose">取 消</el-button>
+      <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { getSelect, getCode, bankUpdate, bankAdd } from '@/api/account'
+import { searchParentId } from '@/api/threeSelection'
+
+export default {
+  name: 'EditModal',
+  components: {
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '820px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        id: '',
+        // oldCardNumber: '',
+        // oldPhone: '',
+        cardName: '',
+        cardNumber: '',
+        bank: '',
+        phone: '',
+        code: '',
+        bankType: '',
+        province: '',
+        city: '',
+        bankName: '',
+        unionBank: '',
+        bankCode: ''
+      },
+      formRules: {
+        cardName: [
+          { required: true, message: '请输入持卡人姓名', trigger: 'blur' }
+        ],
+        cardNumber: [
+          { required: true, message: '请输入正确银行卡号,卡号必须为以数字开头,10~19位的卡号!!!', trigger: 'blur' }
+        ],
+        phone: [ { required: true, message: '请输入手机号', trigger: 'blur' } ],
+        code: [ { required: true, message: '请输入验证码', trigger: 'blur' } ],
+        bank: [ { required: true, message: '请输入选择银行', trigger: 'blur' } ],
+        // oldCardNumber: [
+        //   { required: true, message: '请输入原银行卡号', trigger: 'blur' }
+        // ],
+        bankType: [ { required: true, message: '请选择账户类型' } ],
+        city: [ { required: true, message: '请选择开户行所在省市' } ],
+        bankName: [ { required: true, message: '请输入开户行详细名称' } ],
+        unionBank: [ { required: true, message: '请输入开户行的联行号' } ],
+        bankCode: [ { required: true, message: '请输入银行代码' } ]
+      },
+      cardNameReg: /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、' ']/g,
+      bankList: [],
+      codeTimer: '',
+      codeLoading: false,
+      codeCount: '',
+      regionArrDialog: [],
+      regionProps: {
+        lazy: true,
+        label: 'name',
+        value: 'shortName',
+        lazyLoad(node, resolve) {
+          const { level, value, data } = node
+          if (level === 0) {
+            searchParentId({ parentId: 0 }).then((res) => {
+              resolve(res.data)
+            })
+          } else if (level != 0) {
+            searchParentId({ parentId: data.id }).then((res) => {
+              resolve(res.data.map((item) => {
+                item.leaf = level === 1
+                return item
+              }))
+            })
+          }
+        }
+      }
+    }
+  },
+  watch: {
+    'formData.bankType': {
+      deep: true,
+      handler(val) {
+        if (val === 1) {
+          this.formRules.city = [ { required: true, message: '请选择开户行所在省市' } ]
+          this.formRules.bankName = [ { required: true, message: '请输入开户行详细名称' } ]
+          this.formRules.unionBank = [ { required: true, message: '请输入开户行的联行号' } ]
+          this.formRules.bankCode = [ { required: true, message: '请输入银行代码' } ]
+        } else {
+          this.formRules.city = []
+          this.formRules.bankName = []
+          this.formRules.unionBank = []
+          this.formRules.bankCode = []
+        }
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    // 获取验证码
+    async handleSendCode(phone) {
+      if (phone === '') {
+        this.$message.error('请填写电话号码')
+        return
+      } else if (!/^1[3-9]\d{9}$/.test(phone)) {
+        this.$message({
+          message: '请输入正确手机号',
+          type: 'warning'
+        })
+        return false
+      }
+      if (!this.codeTimer) {
+        const res = await getCode({ phone })
+        if (res.code === '') {
+          this.$message({
+            message: '发送成功,请注意查看手机短信',
+            type: 'success'
+          })
+        }
+        this.codeLoading = true
+        this.codeCount = 60
+        this.codeTimer = setInterval(() => {
+          if (this.codeCount > 0 && this.codeCount <= 60) {
+            this.codeCount--
+          } else {
+            clearInterval(this.codeTimer) // 清除定时器
+            this.codeTimer = null
+            this.codeLoading = false
+          }
+        }, 1000)
+      }
+    },
+    async getBankList() {
+      const res = await getSelect({ dictName: '所属银行' })
+      this.bankList = res.data
+    },
+    initList() {
+      this.getBankList()
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = params.id ? '更换银行卡' : '绑定银行卡'
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (this.formData.province && this.formData.city) this.regionArrDialog = [this.formData.province, this.formData.city]
+      else if (this.formData.province) this.regionArrDialog = [this.formData.province, '']
+      this.visible = true
+      this.initList()
+      if (params.id) { // 关联店铺Id
+        // this.getInfo(params.id)
+      } else {
+        this.$refs.formData && this.$refs.formData.resetFields()
+      }
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await xxx({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || ''
+        })
+        this.$nextTick(() => {
+          this.$refs.formData && this.$refs.formData.validate()
+        })
+      } finally {
+        loading.close()
+      }
+    },
+    handleSubmit() {
+      console.log(this.formData)
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '提交中,请稍候……' })
+          try {
+            const { ...otps } = this.formData
+            const params = {
+              ...otps
+            }
+            this.formData.id ? await bankUpdate(params) : await bankAdd(params)
+            loading.close()
+            this.$message({ message: `${this.formData.id ? '编辑' : '添加'}成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+

+ 141 - 0
src/views/finance/account/components/UnBindBank.vue

@@ -0,0 +1,141 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+    append-to-body
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      :rules="formRules"
+      size="mini"
+      label-suffix=":"
+      label-width="150px"
+    >
+      <el-form-item label="注册手机号" prop="phone">
+        <el-input v-model="formData.phone" maxlength="11" placeholder="注册手机号" disabled style="width: 120px;" />
+        <el-button style="margin-left: 10px;" type="primary" :loading="codeLoading" @click="handleSendCode(formData.phone)">
+          <span v-if="!codeLoading">获取验证码</span>
+          <span v-else>{{ codeCount }} s</span>
+        </el-button>
+      </el-form-item>
+      <el-form-item label="验证码" prop="code">
+        <el-input
+          v-model="formData.code" oninput="value=value.replace(/[^\d]/g,'')" maxlength="6"
+          style="width: 120px;"
+        />
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" @click="handleClose">取 消</el-button>
+        <el-button type="primary" size="mini" @click="handleSubmit">确 定</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+import { getCode, bankDelete } from '@/api/account'
+
+export default {
+  name: 'UnBindBank',
+  components: {
+  },
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '620px',
+        title: ''
+      },
+      visible: false,
+      formData: {
+        phone: '',
+        code: ''
+      },
+      formRules: {
+        phone: [ { required: true, message: '缺少注册手机号' } ],
+        code: [ { required: true, message: '请输入验证码' } ]
+      },
+      codeTimer: '',
+      codeLoading: false,
+      codeCount: ''
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    // 获取验证码
+    async handleSendCode(phone) {
+      if (phone === '') {
+        this.$message.error('请填写电话号码')
+        return
+      } else if (!/^1[3-9]\d{9}$/.test(phone)) {
+        this.$message({
+          message: '请输入正确手机号',
+          type: 'warning'
+        })
+        return false
+      }
+      if (!this.codeTimer) {
+        const res = await getCode({ phone })
+        if (res.code === '') {
+          this.$message({
+            message: '发送成功,请注意查看手机短信',
+            type: 'success'
+          })
+        }
+        this.codeLoading = true
+        this.codeCount = 60
+        this.codeTimer = setInterval(() => {
+          if (this.codeCount > 0 && this.codeCount <= 60) {
+            this.codeCount--
+          } else {
+            clearInterval(this.codeTimer) // 清除定时器
+            this.codeTimer = null
+            this.codeLoading = false
+          }
+        }, 1000)
+      }
+    },
+    initList() {
+    },
+    handleOpen(params = {}) {
+      this.modalOptions.title = '解绑银行卡'
+      this.formData.phone = params.phone
+      // this.formData = Object.assign(this.$options.data().formData, params)
+      this.visible = true
+      this.initList()
+      this.$refs.formData && this.$refs.formData.resetFields()
+    },
+    handleSubmit() {
+      this.$refs.formData.validate(async (valid) => {
+        if (valid) {
+          const loading = this.$loading({ text: '加载中' })
+          try {
+            const { ...otps } = this.formData
+            const params = {
+              ...otps
+            }
+            await bankDelete(params)
+            loading.close()
+            this.$message({ message: `解绑成功!`, type: 'success' })
+            this.$emit('success')
+            this.visible = false
+          } catch (e) {
+            loading.close()
+          } finally {
+            loading.close()
+          }
+        } else {
+          this.$message({ message: '请输入相关信息', type: 'warning' })
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+

+ 19 - 322
src/views/finance/account/index.vue

@@ -25,8 +25,8 @@
           </div>
           <!-- 按钮 -->
           <div class="btnList">
-            <div class="cutBank" @click="delBank(2)">解绑</div>
-            <div class="changeBank" @click="replaceCard(3)">更换</div>
+            <div class="cutBank" @click="$refs.UnBindBank && $refs.UnBindBank.handleOpen(bankArr)">解绑</div>
+            <div class="changeBank" @click="$refs.EditModal && $refs.EditModal.handleOpen({ ...bankArr, id: bankArr.shopId })">更换</div>
           </div>
         </div>
       </div>
@@ -47,345 +47,47 @@
           </div>
           <!-- 按钮 -->
           <div class="btnList">
-            <div class="changeBank" @click="bindCard(1)">立即绑定</div>
+            <div class="changeBank" @click="$refs.EditModal && $refs.EditModal.handleOpen({ id: '' })">立即绑定</div>
           </div>
         </div>
       </div>
     </el-card>
 
-    <!-- 弹框开始 -->
-    <el-dialog
-      :title="dialogData.title" :visible.sync="dialogData.isVisible" width="500px" :close-on-click-modal="false"
-      center @close="closeDialog"
-    >
-      <!-- 绑定银行卡 -->
-      <el-form v-if="dialogData.type === 1" ref="form" :model="form" :rules="rules" label-width="120px">
-        <el-form-item label="持卡人姓名" prop="cardName">
-          <el-input v-model="form.cardName" maxlength="20" @onblur="btKeyUp" />
-        </el-form-item>
-        <el-form-item label="卡号" prop="cardNumber">
-          <el-input v-model="form.cardNumber" maxlength="19" oninput="value=value.replace(/[^\d]/g,'')" />
-        </el-form-item>
-        <el-form-item label="银行" prop="bank">
-          <el-select v-model="form.bank" filterable placeholder="请选择所属银行">
-            <el-option v-for="item in options" :key="item.dictName" :label="item.dictName" :value="item.dictId" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="注册手机号" prop="phone">
-          <el-input
-            v-model="form.phone" oninput="value=value.replace(/[^\d]/g,'')" maxlength="11"
-            style="width: 120px;"
-          />
-          <el-button class="sendCode" type="primary" :loading="codeloading" @click="sendCode(form.phone)">
-            <span v-if="!codeloading">获取验证码</span>
-            <span v-else>{{ count }} s</span>
-          </el-button>
-        </el-form-item>
-        <el-form-item label="验证码" prop="code">
-          <el-input v-model="form.code" style="width: 120px;" oninput="value=value.replace(/[^\d]/g,'')" maxlength="6" />
-        </el-form-item>
-      </el-form>
-      <!-- 解绑 -->
-      <el-form v-if="dialogData.type === 2" ref="unbind" :model="unbinds" :rules="rules" label-width="120px">
-        <el-form-item label="注册手机号" prop="phone">
-          <el-input v-model="unbinds.phone" maxlength="11" style="width: 120px;" />
-          <el-button class="sendCode" type="primary" :loading="codeloading" @click="sendCode(unbinds.phone)">
-            <span v-if="!codeloading">获取验证码</span>
-            <span v-else>{{ count }} s</span>
-          </el-button>
-        </el-form-item>
-        <el-form-item label="验证码" prop="code">
-          <el-input v-model="unbinds.code" style="width: 120px;" />
-        </el-form-item>
-      </el-form>
-      <!-- 更换银行卡 -->
-      <el-form v-if="dialogData.type === 3" ref="card" :model="card" :rules="rules" label-width="120px">
-        <!-- <p class="card">原绑定信息</p>
-          <el-form-item label="原持卡人姓名" prop="cardName">
-          <el-input v-model="card.cardName" />
-          </el-form-item>
-          <el-form-item label="原银行卡号" prop="oldCardNumber">
-          <el-input v-model="card.oldCardNumber" />
-          </el-form-item>
-          <p class="card">新绑定信息</p> -->
-        <el-form-item label="持卡人姓名" prop="cardName">
-          <el-input v-model="card.cardName" maxlength="20" @onblur="btKeyUp" />
-        </el-form-item>
-        <el-form-item label="卡号" prop="cardNumber">
-          <el-input
-            v-if="cardNumberShow" :value="hidden(card.cardNumber, 3, 4)" oninput="value=value.replace(/[^\d]/g,'')"
-            maxlength="19" @focus="focusCardNunberInput"
-          />
-          <el-input v-else v-model="card.cardNumber" maxlength="19" oninput="value=value.replace(/[^\d]/g,'')" />
-        </el-form-item>
-        <el-form-item label="银行" prop="bank">
-          <el-select v-model="card.bank" filterable placeholder="请选择所属银行">
-            <el-option v-for="item in options" :key="item.dictName" :label="item.dictName" :value="item.dictId" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="注册手机号" prop="phone">
-          <el-input
-            v-if="phoneShow" :value="hidden(card.phone, 3, 4)" oninput="value=value.replace(/[^\d]/g,'')"
-            maxlength="11" style="width: 120px;" @focus="focusPhoneInput"
-          />
-          <el-input
-            v-else v-model="card.phone" oninput="value=value.replace(/[^\d]/g,'')" maxlength="11"
-            style="width: 120px;"
-          />
-          <el-button class="sendCode" type="primary" :loading="codeloading" @click="sendCode(card.phone)">
-            <span v-if="!codeloading">获取验证码</span>
-            <span v-else>{{ count }} s</span>
-          </el-button>
-        </el-form-item>
-        <el-form-item label="验证码" prop="code">
-          <el-input v-model="card.code" oninput="value=value.replace(/[^\d]/g,'')" maxlength="6" style="width: 120px;" />
-        </el-form-item>
-      </el-form>
-      <p slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="confirm(formList[dialogData.type])">{{ dialogData.confirm || '确定' }}</el-button>
-        <el-button @click="dialogData.isVisible = false">取 消</el-button>
-      </p>
-    </el-dialog>
+    <!-- 新增编辑 -->
+    <EditModal ref="EditModal" @success="getList" />
+    <!-- 解绑银行卡 -->
+    <UnBindBank ref="UnBindBank" @success="getList" />
   </div>
 </template>
 
 <script>
-import {
-  accountGetById,
-  getSelect,
-  bankDelete,
-  bankUpdate,
-  bankAdd,
-  getCode
-} from '@/api/account'
+import EditModal from './components/EditModal'
+import UnBindBank from './components/UnBindBank'
+import { accountGetById } from '@/api/account'
 import defaultBank from '@/assets/images/bank/default_bank_3x.png'
-const TIME_COUNT = 60 // 更改倒计时时间
+
 export default {
+  name: 'Account',
+  components: {
+    EditModal,
+    UnBindBank
+  },
   data() {
     return {
       err: '账&#12288;号:',
-      bankArr: '',
+      bankArr: {},
       show: true,
-      codeloading: false,
-      dialogData: {},
-      count: '',
-      mobile: '13444444444',
-      options: [],
-      formList: {
-        1: 'form',
-        2: 'unbind',
-        3: 'card'
-      },
-      // 绑定银行卡
-      form: {
-        cardName: '',
-        cardNumber: '',
-        bank: '',
-        phone: '',
-        code: ''
-      },
-      // 解绑
-      unbinds: {
-        phone: '',
-        code: ''
-      },
-      // 更换
-      card: {
-        cardName: '',
-        cardNumber: '',
-        bank: '',
-        phone: '',
-        code: ''
-      },
-      rules: {
-        cardName: [
-          { required: true, message: '请输入持卡人姓名', trigger: 'blur' }
-        ],
-        cardNumber: [
-          { required: true, message: '请输入银行卡号', trigger: 'blur' }
-        ],
-        phone: [ { required: true, message: '请输入手机号', trigger: 'blur' } ],
-        code: [ { required: true, message: '请输入验证码', trigger: 'blur' } ],
-        bank: [ { required: true, message: '请输入选择银行', trigger: 'blur' } ],
-        oldCardNumber: [
-          { required: true, message: '请输入原银行卡号', trigger: 'blur' }
-        ]
-      },
       privacyTime: 0,
-      cardNumberShow: true, // 是否显示卡号脱敏
-      phoneShow: true, // 是否显示手机号脱敏
-      oldCardNumber: '',
-      oldPhone: '',
       defaultBank
     }
   },
   created() {
-    this.bankDetails()
-    this.bankName()
+    this.getList()
     this.privacyTime = localStorage.getItem('privacyTime')
-    console.log(this.privacyTime)
   },
   methods: {
-    closeDialog() {
-      this.card.cardNumber = this.card.cardNumber ? this.card.cardNumber : this.oldCardNumber
-      this.card.phone = this.card.phone ? this.card.phone : this.oldPhone
-    },
-    focusPhoneInput() {
-      this.phoneShow = false,
-      this.card.phone = ''
-    },
-    focusCardNunberInput() {
-      this.cardNumberShow = false
-      this.card.cardNumber = ''
-    },
-    // 获取验证码
-    async sendCode(phone) {
-      var myreg = /^1[3-9]\d{9}$/
-      if (phone === '') {
-        this.$message.error('请填写电话号码')
-        return
-      } else if (!myreg.test(phone)) {
-        this.$message({
-          message: '请输入正确手机号',
-          type: 'warning'
-        })
-        return false
-      }
-      if (!this.timer) {
-        const res = await getCode({ phone })
-        if (res.code === '') {
-          this.$message({
-            message: '发送成功,请注意查看手机短信',
-            type: 'success'
-          })
-        }
-        this.codeloading = true
-        this.count = TIME_COUNT
-        this.timer = setInterval(() => {
-          if (this.count > 0 && this.count <= TIME_COUNT) {
-            this.count--
-          } else {
-            this.show = true
-            clearInterval(this.timer) // 清除定时器
-            this.timer = null
-            this.codeloading = false
-          }
-        }, 1000)
-      }
-    },
-    btKeyUp(e) {
-      e.target.value = e.target.value.replace(/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、' ']/g, '')
-    },
-    // 解绑
-    async unbind(v) {
-      const res = await bankDelete(this.unbinds)
-      if (res.code === '') {
-        this.$message({
-          message: '解绑成功',
-          type: 'success'
-        })
-        this.bankDetails()
-        this.dialogData.isVisible = false
-      }
-    },
-    // 更换银行卡
-    replaceCard(v) {
-      this.dialogData = {
-        title: '更换银行卡',
-        isVisible: true,
-        confirm: '更换',
-        type: v
-      }
-      this.card = this.bankArr
-      this.cardNumberShow = true
-      this.oldCardNumber = this.card.cardNumber
-      this.oldPhone = this.card.phone
-    },
-    // 绑定银行卡
-    bindCard(v) {
-      this.dialogData = {
-        title: '绑定银行卡',
-        isVisible: true,
-        confirm: '绑定',
-        type: v
-      }
-      this.card = {
-        cardName: '',
-        cardNumber: '',
-        bank: '',
-        phone: '',
-        code: ''
-      }
-    },
-    // 解绑银行卡
-    delBank(v) {
-      this.dialogData = {
-        title: '解绑银行卡',
-        isVisible: true,
-        confirm: '解绑',
-        type: v
-      }
-    },
-    // 确认
-    confirm(formName) {
-      this.$refs[formName].validate((valid) => {
-        if (valid) {
-          console.log(formName)
-          if (formName === 'card') {
-            this.changeBank()
-          } else if (formName === 'form') {
-            this.addBank()
-          } else if (formName === 'unbind') {
-            this.unbind()
-          }
-        } else {
-          console.log('error submit!!')
-          return false
-        }
-      })
-    },
-    // 更换账户
-    async changeBank() {
-      var regExp = /^([1-9]{1})(\d{8,17})$/
-      if (!regExp.test(this.card.cardNumber)) {
-        this.$message({
-          message: '请输入正确银行卡号,卡号必须为以数字开头,10~19位的卡号!!!',
-          type: 'warning'
-        })
-        return false
-      }
-      const res = await bankUpdate(this.card)
-      if (res.code === '') {
-        this.$message({
-          message: '更换成功',
-          type: 'success'
-        })
-        this.bankDetails()
-        this.dialogData.isVisible = false
-      }
-    },
-    // 绑定账户
-    async addBank() {
-      var regExp = /^([1-9]{1})(\d{8,17})$/
-      if (!regExp.test(this.form.cardNumber)) {
-        this.$message({
-          message: '请输入正确银行卡号,卡号必须为以数字开头,10~19位的卡号!!!',
-          type: 'warning'
-        })
-        return false
-      }
-      const res = await bankAdd(this.form)
-      if (res.code === '') {
-        this.$message({
-          message: '绑定成功',
-          type: 'success'
-        })
-        this.bankDetails()
-        this.dialogData.isVisible = false
-      }
-    },
     // 查询账户
-    async bankDetails() {
+    async getList() {
       const res = await accountGetById({})
       if (res.code === '') {
         console.log(JSON.stringify(res.data))
@@ -398,11 +100,6 @@ export default {
         console.log(this.show)
       }
     },
-    async bankName() {
-      const res = await getSelect({ dictName: '所属银行' })
-      this.options = res.data
-      console.log(this.options)
-    },
     // 中间部分
     hidden(str, frontLen, endLen) {
       if (str && frontLen && endLen) {

+ 1 - 0
src/views/selectionCenter/distributionPricingPlan/components/EditModal.vue

@@ -137,6 +137,7 @@ export default {
     },
     handleOpen(params = {}) {
       this.modalOptions.title = params.priceId ? '编辑定价方案' : '添加定价方案'
+      this.formData = Object.assign(this.$options.data().formData, params)
       this.visible = true
       this.initList()
       if (params.priceId) {

+ 1 - 0
src/views/selectionCenter/productSelectionList/components/SelectionAddModal.vue

@@ -107,6 +107,7 @@ export default {
       this.getGroupDataList()
       this.formData.productId = params.productId
       this.formData.shopParentId = params.shopId
+      // this.formData = Object.assign(this.$options.data().formData, params)
       this.visible = true
       this.$refs.formData && this.$refs.formData.resetFields()
     },

+ 1 - 0
vue.config.js

@@ -51,6 +51,7 @@ module.exports = {
       '/canvasApi': {
         // target: 'http://192.168.0.91:9104', // 测试
         target: 'https://nsbusinessapitest.tuanfengkeji.cn',
+        // target: 'https://nsbusinessapi.tuanfengkeji.cn',
         changeOrigin: true,
         pathRewrite: {
           '^/canvasApi': ''