adminAccInf.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <div class="app-container zap-main">
  3. <div class="zap-content zap-margin-top">
  4. <el-button
  5. type="primary"
  6. icon="el-icon-plus"
  7. @click="handleAdd"
  8. >添加虚拟账户</el-button>
  9. </div>
  10. <el-table class="zap-table" v-loading="loading" :data="accList" @selection-change="handleSelectionChange" stripe>
  11. <el-table-column label="序号" type="index" width="55" align="center" />
  12. <el-table-column label="开户行" align="center" prop="paiBankName" />
  13. <el-table-column label="账户类型" :formatter="formulaFormat" align="center" prop="paiAcctype"/>
  14. <el-table-column label="账户卡号" align="center" prop="paiAccno" />
  15. <el-table-column label="账户状态" :formatter="formulaFormatSend" align="center" prop="paiStatus"/>
  16. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  17. <template slot-scope="scope">
  18. <el-button
  19. size="mini"
  20. type="text"
  21. icon="el-icon-delete"
  22. @click="handleDelete(scope.row)"
  23. v-hasPermi="['admin:accInf:delete']"
  24. >删除</el-button
  25. >
  26. </template>
  27. </el-table-column> -->
  28. </el-table>
  29. <pagination
  30. v-show="total > 0"
  31. :total="total"
  32. :page.sync="queryParams.pageNum"
  33. :limit.sync="queryParams.pageSize"
  34. @pagination="getList"
  35. />
  36. <!-- 添加虚拟账户 -->
  37. <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
  38. <el-form ref="form" :model="form" :rules="rules" label-width="120px" :inline="true">
  39. <el-form-item prop="paiBankName" label="开户银行" size="large">
  40. <el-select
  41. @change="changePayer"
  42. v-model="form.paiBankName"
  43. :disabled="disableds"
  44. filterable
  45. clearable
  46. remote
  47. reserve-keyword
  48. placeholder="请选择开户银行"
  49. :remote-method="getBankList"
  50. >
  51. <el-option
  52. v-for="(item, index) in bankList"
  53. :key="index"
  54. :label="item.zcbiBankName"
  55. :value="item.zcbiBankName"
  56. >
  57. </el-option>
  58. </el-select>
  59. </el-form-item>
  60. <el-form-item label="法人姓名" prop="scyLegal" size="large">
  61. <el-input v-model="form.scyLegal" style="width: 215px" placeholder="请输入法人姓名" maxlength="15" readonly/>
  62. </el-form-item>
  63. <el-form-item label="法人手机号" prop="scyPhone" size="large">
  64. <el-input v-model="form.scyPhone" style="width: 215px" placeholder="请输入法人手机号" maxlength="15" readonly/>
  65. </el-form-item>
  66. <el-form-item label="身份证号" prop="scyLegalId" size="large">
  67. <el-input v-model="form.scyLegalId" style="width: 215px" placeholder="请输入身份证号" maxlength="15" readonly/>
  68. </el-form-item>
  69. <el-form-item label="邮箱" prop="email" size="large">
  70. <el-input v-model="form.email" style="width: 215px" placeholder="请输入邮箱" maxlength="15" readonly/>
  71. </el-form-item>
  72. <el-form-item label="企业名称" prop="scyName" size="large">
  73. <el-input v-model="form.scyName" style="width: 215px" placeholder="请输入企业名称" maxlength="15" readonly/>
  74. </el-form-item>
  75. <el-form-item label="企业注册地址" prop="scyAddress" size="large">
  76. <el-input v-model="form.scyAddress" style="width: 215px" placeholder="请输入企业注册地址" maxlength="15" readonly/>
  77. </el-form-item>
  78. </el-form>
  79. <el-row style="height: 109px" type="flex" align="middle" justify="center">
  80. <el-button type="primary" plain @click="cancel">取 消</el-button>
  81. <el-button type="primary" @click="submitForm">确 定</el-button>
  82. </el-row>
  83. </el-dialog>
  84. </div>
  85. </template>
  86. <script>
  87. import { listAdminAcc,listCorporation} from "@/api/system/adminAccInf";
  88. import { listBank } from "@/api/system/accInf";
  89. import { register } from "@/api/bank/bankInterface";
  90. import { release } from 'os';
  91. import Cookies from 'js-cookie';
  92. export default {
  93. name: "accInf",
  94. data() {
  95. return {
  96. //可用余额
  97. KYAMT: null,
  98. //电子账户
  99. accno: null,
  100. // id隐藏
  101. isShow: false,
  102. // 遮罩层
  103. loading: true,
  104. // 选中数组
  105. ids: [],
  106. // 非单个禁用
  107. single: true,
  108. // 非多个禁用
  109. multiple: true,
  110. // 显示搜索条件
  111. showSearch: true,
  112. //联系人隐藏
  113. disabled: false,
  114. disableds: false,
  115. // 总条数
  116. total: 0,
  117. // 账户表格数据
  118. accList: [],
  119. //账户卡号数据
  120. cardList: [],
  121. //姓名
  122. nameList: [],
  123. bankList: [],
  124. //字典
  125. formulaOptions: [],
  126. formulaOptionsSend: [],
  127. UserList: [],
  128. enclosureList: [],
  129. sfzList: [],
  130. // 弹出层标题
  131. title: "",
  132. // 是否显示弹出层
  133. open: false,
  134. // 是否显示弹出层
  135. edit: false,
  136. // 是否显示弹出层
  137. recharge: false,
  138. // 是否显示弹出层
  139. withdrawal: false,
  140. // 查询参数
  141. queryParams: {
  142. pageNum: 1,
  143. pageSize: 10,
  144. scyName: null,
  145. smiType: null,
  146. smiManager: null,
  147. smiContract: null,
  148. smiContractPhone: null,
  149. sfsContent: null,
  150. sfsIsDel: null,
  151. sfsRemark: null,
  152. ssId: null,
  153. ssName: null,
  154. },
  155. // 表单参数
  156. form: {},
  157. // 表单校验
  158. rules: {
  159. paiBankName: [
  160. {
  161. required: true,
  162. message: "开户银行不能为空",
  163. trigger: ["change", "blur"],
  164. },
  165. ],
  166. },
  167. };
  168. },
  169. created() {
  170. this.getList();
  171. this.getBankList();
  172. this.getDicts("pay_pai_acctype").then((response) => {
  173. this.formulaOptions = response.data;
  174. });
  175. this.getDicts("pay_pai_status").then((response) => {
  176. this.formulaOptionsSend = response.data;
  177. });
  178. },
  179. methods: {
  180. //切换账款类型
  181. changePayer(value) {
  182. if (value) {
  183. this.$set(this.form, "paiQlbankname", value);
  184. }
  185. },
  186. /** 查询账户列表 */
  187. getList() {
  188. this.loading = true;
  189. listAdminAcc(this.queryParams).then((response) => {
  190. this.accList = response.data.records;
  191. this.total = response.data.total;
  192. this.loading = false;
  193. });
  194. },
  195. // 取消按钮
  196. cancel() {
  197. this.open = false;
  198. this.reset();
  199. },
  200. // 修改取消按钮
  201. cancelEdit() {
  202. this.edit = false;
  203. this.reset();
  204. },
  205. // 充值取消按钮
  206. cancelRecharge() {
  207. this.recharge = false;
  208. this.reset();
  209. },
  210. // 表单重置
  211. reset() {
  212. this.form = {
  213. paiBankName: null,
  214. scyLegal: null,
  215. scyPhone: null,
  216. scyLegalId: null,
  217. email: null,
  218. scyName: null,
  219. scyAddress: null,
  220. };
  221. this.noneBtnImg = false;
  222. this.enclosureList = [];
  223. this.sfzList = [];
  224. this.resetForm("form");
  225. },
  226. /** 搜索按钮操作 */
  227. handleQuery() {
  228. this.queryParams.pageNum = 1;
  229. this.getList();
  230. },
  231. /** 重置按钮操作 */
  232. resetQuery() {
  233. this.resetForm("queryForm");
  234. this.handleQuery();
  235. },
  236. // 多选框选中数据
  237. handleSelectionChange(selection) {
  238. this.ids = selection.map((item) => item.scyId);
  239. this.single = selection.length !== 1;
  240. this.multiple = !selection.length;
  241. },
  242. //资方类型
  243. formulaFormat(row, column) {
  244. return this.selectDictLabel(this.formulaOptions, row.paiAcctype);
  245. },
  246. //奖项
  247. formulaFormatSend(row, column) {
  248. return this.selectDictLabel(this.formulaOptionsSend, row.paiStatus);
  249. },
  250. //查询银行名称
  251. getBankList(paiBankName) {
  252. this.queryParams.paiBankName = paiBankName;
  253. listBank(this.queryParams).then((response) => {
  254. this.bankList = response.data.records;
  255. });
  256. },
  257. /** 新增按钮操作 */
  258. handleAdd() {
  259. this.reset();
  260. listCorporation().then((response) =>{
  261. this.form = response.data[0]
  262. })
  263. this.open = true;
  264. // this.$set(this.form, "name", "丛美红");
  265. // this.$set(this.form, "phone", "18810133746");
  266. // this.$set(this.form, "IDCard", "210282198912038724");
  267. // this.$set(this.form, "email", "congmeihong@zcylian.com");
  268. // this.$set(this.form, "companyName", "招采云链(山东)信息服务有限公司");
  269. // this.$set(this.form, "companyAddress", "中国(山东)自由贸易试验区济南片区汉峪金谷A3-1-1401");
  270. this.title = "添加虚拟账户";
  271. },
  272. /** 新增提交按钮 */
  273. submitForm() {
  274. this.$refs["form"].validate((valid) => {
  275. console.log(this.form);
  276. if (valid) {
  277. const loading = this.$loading({
  278. lock: true,
  279. text: "Loading",
  280. spinner: "el-icon-loading",
  281. background: "rgba(0, 0, 0, 0.7)",
  282. });
  283. register()
  284. .then((response) => {
  285. debugger
  286. loading.close();
  287. this.msgSuccess("新增成功");
  288. this.open = false;
  289. this.getList();
  290. })
  291. .catch((response) => {
  292. loading.close();
  293. });
  294. }
  295. });
  296. },
  297. /** 提交按钮 */
  298. submitEdit() {
  299. this.$refs["form"].validate((valid) => {
  300. if (valid) {
  301. const loading = this.$loading({
  302. lock: true,
  303. text: "Loading",
  304. spinner: "el-icon-loading",
  305. background: "rgba(0, 0, 0, 0.7)",
  306. });
  307. updateAcc(this.form)
  308. .then((response) => {
  309. loading.close();
  310. this.msgSuccess("修改成功");
  311. this.edit = false;
  312. this.getList();
  313. })
  314. .catch((response) => {
  315. loading.close();
  316. });
  317. }
  318. });
  319. },
  320. /** 删除按钮操作 */
  321. handleDelete(row) {
  322. const paiId = row.paiId || this.ids;
  323. const paiAccno = row.paiAccno;
  324. this.$confirm(
  325. '是否确认删除账户卡号为"' + paiAccno + '"的数据项?',
  326. "警告",
  327. {
  328. confirmButtonText: "确定",
  329. cancelButtonText: "取消",
  330. type: "warning",
  331. }
  332. )
  333. .then(function () {
  334. return delAdminAcc(paiId);
  335. })
  336. .then(() => {
  337. this.getList();
  338. this.msgSuccess("删除成功");
  339. });
  340. },
  341. },
  342. };
  343. </script>