You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.vue 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. <template>
  2. <div>
  3. <crud-template v-if="itemStart" class="as-weight" :ref="(el) => (crudRef = el)" :home-data="field"
  4. @btnSearch="btnSearch" @refreshLeft="refreshLeft" :tableData="tableData" @add="add" @handleEdit="handleEdit"
  5. @cancel="cancel" @CurrentChange="handleCurrentChange" @submit="submitClick">
  6. <template #search>
  7. <el-input maxlength="60" v-trim clearable v-model="searchForm.agencyId" style="width: 200px;"
  8. placeholder="请输入渠道编号" />
  9. <el-input maxlength="60" v-trim clearable v-model="searchForm.name" style="width: 200px;"
  10. placeholder="请输入渠道名称" />
  11. </template>
  12. <template #CustomButton>
  13. <el-button type="success" @click="getItmeLiet()">
  14. 报备部中心渠道管理
  15. </el-button>
  16. </template>
  17. <template #operation="{ scope }">
  18. <el-button v-if="scope.row.status === '停用' && IsPermission(route, 'STAET_LIST')" type="primary"
  19. @click="isOpenHandle(scope.row, 1)" size="small">启用</el-button>
  20. <el-button v-if="scope.row.status === '启用' && IsPermission(route, 'STAET_LIST')" type="danger"
  21. @click="isOpenHandle(scope.row, 2)" size="small">停用</el-button>
  22. </template>
  23. <template #status="item">
  24. <el-switch :disabled="!IsPermission(route, 'STAET_LIST')" v-model="item.scope.row.status"
  25. active-value="ENABLE" inactive-value="DISABLE" active-color="#13ce66" inactive-color="#ff4949"
  26. @click="handleBeforeChange(item.scope.row.status, item.scope.row)">
  27. </el-switch>
  28. </template>
  29. <template #fieldList>
  30. <div style="padding: 0 0 30px 0;text-align: right;">
  31. <el-button type="success" icon="Plus" @click="addBtn" style="margin-bottom: 10px;" v-show="typeOption=='add'||typeOption=='edit'">
  32. 添加
  33. </el-button>
  34. <el-table :data="dataForm.configSetInfos" :border="true">
  35. <!-- <el-table-column type="index" header-align="center" align="center" width="50"></el-table-column> -->
  36. <el-table-column label="协议名称">
  37. <template v-slot="scope">
  38. <div class="input-wrap">
  39. <el-form-item prop="agreementName">
  40. <el-input maxlength="60" v-trim clearable v-model="scope.row.agreementName"
  41. placeholder="协议名称"></el-input>
  42. </el-form-item>
  43. </div>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="协议编号">
  47. <template v-slot="scope">
  48. <div class="input-wrap">
  49. <el-form-item prop="agreementId">
  50. <el-input maxlength="60" v-trim clearable v-model="scope.row.agreementId"
  51. placeholder="协议编号"></el-input>
  52. </el-form-item>
  53. </div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="有效期">
  57. <template v-slot="scope">
  58. <div class="input-wrap">
  59. <el-form-item prop="termOfValidity">
  60. <el-input maxlength="60" v-trim clearable v-model="scope.row.termOfValidity"
  61. placeholder="有效期"></el-input>
  62. </el-form-item>
  63. </div>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="协议附件">
  67. <template v-slot="scope">
  68. <el-upload ref="upload" :file-list="scope.row.fileList" style="padding-top: 9px;"
  69. :limit="1" :on-exceed="handleExceed" class="upload-demo" :data="data"
  70. :action="uploadUrl" @success="onSuccess($event, scope.row)">
  71. <el-button type="primary" icon="upload">
  72. 上传附件
  73. </el-button>
  74. </el-upload>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="对公账户">
  78. <template v-slot="scope">
  79. <div class="input-wrap">
  80. <el-form-item prop="corporateAccount">
  81. <el-input maxlength="60" v-trim clearable v-model="scope.row.corporateAccount"
  82. placeholder="对公账户"></el-input>
  83. </el-form-item>
  84. </div>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="商户号">
  88. <template v-slot="scope">
  89. <div class="input-wrap">
  90. <el-form-item prop="merchantId">
  91. <el-input maxlength="60" v-trim clearable v-model="scope.row.merchantId"
  92. placeholder="商户号"></el-input>
  93. </el-form-item>
  94. </div>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="开户行">
  98. <template v-slot="scope">
  99. <div class="input-wrap">
  100. <el-form-item prop="openingBank">
  101. <el-input maxlength="60" v-trim clearable v-model="scope.row.openingBank"
  102. placeholder="开户行"></el-input>
  103. </el-form-item>
  104. </div>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="操作" width="70" v-if="typeOption=='add'||typeOption=='edit'">
  108. <template v-slot="scope">
  109. <el-button class="op-btn" type="danger" @click="deleteHandle(scope.row, scope.$index)">
  110. 删除
  111. </el-button>
  112. </template>
  113. </el-table-column>
  114. </el-table>
  115. </div>
  116. </template>
  117. </crud-template>
  118. <el-dialog title="报备部中心渠道管理" v-model="vShowDoalog">
  119. <crud-template ref="crudRefTwo" :home-data="zxqdFind" @submit="itemAdd" @handleEdit="itemEdit" @add="Adds"
  120. @CurrentChange="handleCurrentChangeTwo" :searchForm="searchForm2" @handleDelete="itemDelete"
  121. :tableData="tableItemData" @btnSearch="btnSearch2" @refreshLeft="refreshLeft2">
  122. <template #search>
  123. <el-input maxlength="60" v-trim clearable v-model="searchForm2.id" style="width: 200px;"
  124. placeholder="请输入渠道编号" />
  125. <el-input maxlength="60" v-trim clearable v-model="searchForm2.name" style="width: 200px;"
  126. placeholder="请输入渠道名称" />
  127. </template>
  128. </crud-template>
  129. </el-dialog>
  130. </div>
  131. </template>
  132. <!-- 渠道配置 -->
  133. <script lang="ts" setup>
  134. // @ts-ignore crudFrom模板
  135. import CrudTemplate from "@/crud/index.vue";
  136. import { computed, ref, toRaw, onMounted } from "vue";
  137. import { ElMessage, UploadProps, UploadRawFile, genFileId } from "element-plus";
  138. import { useDebounce } from "@/utils/utils";
  139. import { addAgencyApi, updatAgencyeApi, queryAgencyApi, openAgencyApi } from "@/api/system/branch";
  140. import BaseService from "@/utils/baseService";
  141. import { IObject } from "@/types/interface";
  142. import $storeinitData from "@/store/initData"; //引入tab vuex
  143. import { useRoute } from 'vue-router';
  144. import { IsPermission } from "@/router/routerUtil";
  145. import { getZxqdFindConfig } from "./data.js";
  146. //或取路由传入过来的对象数据
  147. const route = useRoute();
  148. const crudRef = ref();
  149. const zxqdFind = ref(getZxqdFindConfig(route));;
  150. const crudRefTwo = ref();
  151. const itemStart = ref(true);
  152. const vShowDoalog = ref(false);
  153. const searchForm = ref({
  154. name: "",
  155. agencyId: "",
  156. });
  157. const searchForm2 = ref({
  158. id:"",
  159. name:""
  160. });
  161. const initItem = {
  162. name: "",
  163. agencyId: "",
  164. corporateAccount: "",
  165. merchantId: "",
  166. openingBank: "",
  167. status: 1,
  168. address: "",
  169. tel: ""
  170. };
  171. //订单阶段
  172. const AGENCY_TYPE = computed(() => {
  173. return $storeinitData.state.dictData['AGENCY_TYPE'] || []
  174. })
  175. // console.log(AGENCY_TYPE, '--------------------------');
  176. const addForm: any = ref(initItem);
  177. const tableData = ref([]);
  178. const tableItemData = ref([]);
  179. const getCenterAgencyIdList = ref([]);
  180. const typeOption = ref("");
  181. let formLabelWidth = '150px';
  182. const itemStartValue = ref("1")
  183. //新增
  184. const itemAdd = (data: any) => {
  185. request(data, itemStartValue.value)
  186. }
  187. const Adds = () => {
  188. // console.log(zxqdFind.value.field[0].form);
  189. zxqdFind.value.field[0].form.hideEdit = false;
  190. itemStartValue.value = 1
  191. }
  192. //表单编辑按钮
  193. function itemEdit(idx: any, row: any) {
  194. // console.log("我是编辑事件", idx, row);
  195. zxqdFind.value.field[0].form.hideEdit = true;
  196. // request(row, 2)
  197. itemStartValue.value = 2
  198. }
  199. //表单编辑按钮
  200. function itemDelete(idx: any, row: any) {
  201. // console.log("删除事件", idx, row);
  202. BaseService.postN('/userw/centerAgency/delete', row).then((res: any) => {
  203. if (res && res.code === 0) {
  204. getItmeLiet()
  205. crudRefTwo.value.reset();
  206. crudRefTwo.value.dialogFormVisible = false;
  207. } else {
  208. ElMessage.error(res.message)
  209. }
  210. })
  211. }
  212. function handleCurrentChangeTwo(val: number) {
  213. zxqdFind.value.paging.currentPage = val;
  214. getItmeLiet();
  215. }
  216. const request = (data: any, type: any) => {
  217. data.optType = type //操作类型 1新增 2修改
  218. BaseService.postN('/userw/centerAgency/addOrUpDate', data).then((res: any) => {
  219. if (res && res.code === 0) {
  220. getItmeLiet()
  221. crudRefTwo.value.reset();
  222. crudRefTwo.value.dialogFormVisible = false;
  223. ElMessage.success("操作成功")
  224. } else {
  225. ElMessage.error(res.message)
  226. }
  227. })
  228. }
  229. const getItmeLiet = () => {
  230. vShowDoalog.value = true
  231. if (crudRefTwo.value) {
  232. crudRefTwo.value.tableLoding = true;
  233. }
  234. let params: any = {
  235. id: searchForm2.value.id,
  236. name: searchForm2.value.name,
  237. pageNo: zxqdFind.value.paging.currentPage,
  238. pageSize: zxqdFind.value.paging.pageSize,
  239. }
  240. BaseService.postN('/userw/centerAgency/page', params).then((res: any) => {
  241. // console.log(res, 'res')
  242. if (res && res.code === 0) {
  243. let bizContent = res.data
  244. let data = bizContent.result || [];
  245. data.forEach((item) => {
  246. if (item.models) item.models.forEach((i) => {
  247. if (i.agreementAnnex) i.fileList = [{ name: i.agreementAnnex }]
  248. })
  249. })
  250. // console.log("bizContent12222", data)
  251. tableItemData.value = data;
  252. crudRefTwo.value.tableLoding = false;
  253. zxqdFind.value.paging.total = bizContent.totalCount;
  254. } else {
  255. crudRefTwo.value.tableLoding = false;
  256. ElMessage.error(res.message)
  257. }
  258. })
  259. }
  260. //表单数据配置
  261. const field = ref({
  262. tabSize: "small", //Table 的尺寸 large / default /small (默认default)
  263. searchShow: IsPermission(route, 'QUERY_BASE'), //是否显示搜索模块(默认false)
  264. border: true, //是否添加边框(默认false)
  265. dialogCustom: false, //自定义Dialog (默认false)
  266. dialogFooter: false, //隐藏弹窗页脚显示 (默认false)
  267. dialogWidth: "70%", //dialog宽度 (默认40%)
  268. dialogInfoWidth: "70%",
  269. crudShow: true, //是否显示CURD操作栏 (默认true)
  270. crudChildShow: true, //是否显示CURD子操作栏 (默认true)
  271. paginStart: true, //是否显示分页查询 (默认false)
  272. titleDialog: "", //table 标题
  273. dataListLoading: false,
  274. paging: {
  275. pageSize: 10,
  276. currentPage: 1,
  277. total: 0
  278. },
  279. crud: {
  280. add: IsPermission(route, 'ADD_BASE'),
  281. edit: false,
  282. delete: false,
  283. derive: false,
  284. search: false,
  285. refresh: false,
  286. },
  287. searchOperation: {
  288. isDownload: false,
  289. isAdd: false,
  290. isTransferMachine: false,
  291. },
  292. tableSize: -1,
  293. operateShow: true, //是否为表格添加操作栏(默认true)
  294. operateTitle: "操作", //操作栏标题(默认为"")
  295. operateFixed: true, //操作栏是否固定(默认false)
  296. operateWidth: "160", //操作栏宽度
  297. operate: {
  298. edit: IsPermission(route, 'EDIT_LIST'), //是否编辑(默认true)
  299. info: IsPermission(route, 'INFO_LIST'), //是否编辑(默认true)
  300. delete: false, //是否删除(默认true)
  301. announcement: false, // 公告
  302. remark: false, // 详情
  303. forbidden: false, // 禁用
  304. enable: false, // 启用
  305. authorization: false, // 授权
  306. cancel: false, // 取消订单
  307. writeOff: false, // 注销
  308. make: false, // 补缴
  309. },
  310. extend: [
  311. {
  312. label: "序号",
  313. type: "index", //类型:selection,index,expand
  314. width: "50px", //表头宽度
  315. },
  316. ],
  317. field: [
  318. {
  319. prop: "issuerId",
  320. label: "发行方编号",
  321. width: "80px"
  322. },
  323. {
  324. prop: "name",
  325. label: "渠道名称",
  326. width: "200px",
  327. form: {
  328. width: '45%',
  329. formLabelWidth: formLabelWidth,
  330. type: 'input',
  331. required: true,
  332. }
  333. },
  334. {
  335. prop: "agencyId",
  336. label: "渠道编号",
  337. width: "100px",
  338. form: {
  339. width: '45%',
  340. formLabelWidth: formLabelWidth,
  341. type: 'input',
  342. required: true,
  343. disabled: false
  344. }
  345. },
  346. {
  347. prop: "mapAgencyId",
  348. label: "中心渠道编号",
  349. width: "120px",
  350. listData: getCenterAgencyIdList,
  351. form: {
  352. width: '45%',
  353. formLabelWidth: formLabelWidth,
  354. type: 'select',
  355. required: true,
  356. listData: getCenterAgencyIdList
  357. }
  358. },
  359. {
  360. prop: "type",
  361. label: "合作机构类别",
  362. width: "100px",
  363. listData: AGENCY_TYPE,
  364. form: {
  365. width: '45%',
  366. formLabelWidth: formLabelWidth,
  367. type: 'select',
  368. required: true,
  369. listData: AGENCY_TYPE
  370. }
  371. },
  372. {
  373. prop: "contact",
  374. label: "联系人姓名",
  375. form: {
  376. width: '45%',
  377. formLabelWidth: formLabelWidth,
  378. type: 'input',
  379. }
  380. }, {
  381. prop: "tel",
  382. label: "联系电话",
  383. form: {
  384. width: '45%',
  385. formLabelWidth: formLabelWidth,
  386. type: 'input'
  387. }
  388. }, {
  389. hide: true,
  390. prop: "taxPayerCode",
  391. label: "纳税人识别号",
  392. form: {
  393. width: '45%',
  394. formLabelWidth: formLabelWidth,
  395. type: 'input',
  396. }
  397. }, {
  398. hide: true,
  399. prop: "creditCode",
  400. label: "统一社会信用代码",
  401. form: {
  402. width: '45%',
  403. formLabelWidth: formLabelWidth,
  404. type: 'input',
  405. }
  406. }, {
  407. hide: true,
  408. prop: "accountId",
  409. label: "记账渠道号",
  410. form: {
  411. width: '45%',
  412. formLabelWidth: formLabelWidth,
  413. type: 'input',
  414. }
  415. },
  416. {
  417. prop: 'address',
  418. label: '地址',
  419. form: {
  420. width: '45%',
  421. formLabelWidth: formLabelWidth,
  422. type: 'input',
  423. }
  424. },
  425. {
  426. prop: 'distributionTeamLeader',
  427. label: '市场发行组负责人',
  428. hide: true,
  429. form: {
  430. width: '45%',
  431. formLabelWidth: formLabelWidth,
  432. type: 'input',
  433. }
  434. },
  435. {
  436. prop: 'customerTeamLeader',
  437. label: '客服组负责人',
  438. hide: true,
  439. form: {
  440. width: '45%',
  441. formLabelWidth: formLabelWidth,
  442. type: 'input',
  443. }
  444. },
  445. {
  446. prop: 'technicalTeamLeader',
  447. label: '技术组负责人',
  448. hide: true,
  449. form: {
  450. width: '45%',
  451. formLabelWidth: formLabelWidth,
  452. type: 'input',
  453. }
  454. },
  455. {
  456. prop: 'settlementTeamLeader',
  457. label: '结算组负责人',
  458. hide: true,
  459. form: {
  460. width: '45%',
  461. formLabelWidth: formLabelWidth,
  462. type: 'input',
  463. }
  464. },
  465. {
  466. prop: 'email',
  467. label: 'email',
  468. form: {
  469. width: '45%',
  470. formLabelWidth: formLabelWidth,
  471. type: 'input',
  472. }
  473. },
  474. {
  475. prop: 'status',
  476. label: '状态',
  477. slotSet: true,
  478. slotSetName: "status",
  479. },
  480. {
  481. prop: "info",
  482. label: "备注",
  483. span: 3,
  484. form: {
  485. width: '95%',
  486. formLabelWidth: formLabelWidth,
  487. type: 'input',
  488. itemType: 'textarea',
  489. rows: 5
  490. }
  491. },
  492. {
  493. hide: true,
  494. prop: "agencyModels",
  495. form: {
  496. width: '95%',
  497. slotSetEdit: true,
  498. slotSetNameEdit: 'fieldList',
  499. formLabelWidth: '40px',
  500. slotSetInfo: true,
  501. slotSetNameInfo: 'fieldList',
  502. }
  503. },
  504. {
  505. prop: "insertTime",
  506. label: "创建时间",
  507. width: "150px",
  508. funRuleStarts: true,
  509. funRule: (val: any) => {
  510. if (val) {
  511. return val.replaceAll('T', ' ')
  512. }
  513. return val
  514. },
  515. }
  516. ]
  517. });
  518. // 搜索按钮
  519. function btnSearch() {
  520. field.value.paging.currentPage = 1;
  521. getList();
  522. }
  523. function btnSearch2() {
  524. zxqdFind.value.paging.currentPage = 1
  525. getItmeLiet()
  526. }
  527. // 搜索重置
  528. function refreshLeft() {
  529. searchForm.value = {
  530. name: "",
  531. agencyId: ""
  532. }
  533. field.value.paging.currentPage = 1;
  534. getList();
  535. }
  536. function refreshLeft2() {
  537. searchForm2.value = {
  538. id: '',
  539. name:'',
  540. }
  541. zxqdFind.value.paging.currentPage = 1
  542. getItmeLiet()
  543. }
  544. function getCenterAgencyId() {
  545. //获取中心网点编号信息 /userw/agency/getCenterAgencyId
  546. BaseService.postN('/userw/centerAgency/getCenterAgencyId', {
  547. }).then((res: any) => {
  548. // console.log(res, 'resresres');
  549. let bizContent = res.data
  550. getCenterAgencyIdList.value = bizContent.map((item) => {
  551. return { label: item.centerAgencyName, value: item.centerAgencyId }
  552. })
  553. })
  554. }
  555. function add() {
  556. typeOption.value = "add";
  557. dataForm.value.configSetInfos = []
  558. field.value.field.forEach(item => {
  559. if (item.prop === 'agencyId') {
  560. item.form.disabled = false
  561. }
  562. })
  563. BaseService.postN('/userw/agency/getAgencyId', {}).then((res: any) => {
  564. if (res && res.code === 0) {
  565. let bizContent = res.data
  566. crudRef.value.form.agencyId = bizContent
  567. } else {
  568. ElMessage.error(res.message)
  569. }
  570. })
  571. }
  572. //表单编辑按钮
  573. function handleEdit(idx: any, row: any) {
  574. dataForm.value.configSetInfos = row.models ?? []
  575. const data = toRaw(row);
  576. typeOption.value = "edit";
  577. addForm.value = {
  578. ...data
  579. }
  580. // console.log(data, '===');
  581. // Object.assign(addForm.value,data)
  582. crudRef.value.title = "编辑";
  583. crudRef.value.dialogFormVisible = true;
  584. field.value.field.forEach(item => {
  585. if (item.prop === 'agencyId') {
  586. item.form.disabled = true
  587. }
  588. })
  589. }
  590. function handleCurrentChange(val: number) {
  591. field.value.paging.currentPage = val;
  592. getList();
  593. }
  594. //切换按钮 ENABLE 启用 DISABLE 停用
  595. function handleBeforeChange(value, arg1) {
  596. // arg1.status == 1 ? 1 : 2
  597. // console.log(value, arg1);
  598. BaseService.postN('/userw/agency/agencyenable', {
  599. agencyId: arg1.agencyId,
  600. status:value
  601. }).then((res: any) => {
  602. if (res && res.code === 0) {
  603. if (value == 'ENABLE') {
  604. ElMessage.success("启用成功");
  605. } else {
  606. ElMessage.error("禁用成功");
  607. }
  608. } else {
  609. ElMessage.error(res.message);
  610. }
  611. });
  612. }
  613. // 取消
  614. function cancel() {
  615. addForm.value = JSON.parse(JSON.stringify(initItem)); //清空数据
  616. crudRef.value.reset();
  617. crudRef.value.dialogFormVisible = false;
  618. typeOption.value = ""
  619. crudRef.value.title = "";
  620. }
  621. // 提交
  622. function submitClick(data: any) {
  623. data.agencyModels = dataForm.value.configSetInfos
  624. let api = '/userw/agency/agencyinsert';
  625. if (typeOption.value === 'edit') {
  626. api = '/userw/agency/agencyupdate';
  627. }
  628. BaseService.postN(api, data).then((res: any) => {
  629. if (res && res.code === 0) {
  630. ElMessage.success("操作成功");
  631. getList();
  632. cancel();
  633. } else {
  634. ElMessage.error(res.message)
  635. }
  636. })
  637. }
  638. const submitHandle = useDebounce(submitClick);
  639. function getList() {
  640. //itemStart.value = false;
  641. crudRef.value.tableLoding = true;
  642. let params: any = {
  643. methods: "page",
  644. pageNo: field.value.paging.currentPage,
  645. pageSize: field.value.paging.pageSize,
  646. }
  647. let searchFormList = { ...searchForm.value }
  648. for (let key in searchFormList) {
  649. if (searchFormList[key]) {
  650. params[key] = searchFormList[key]
  651. }
  652. }
  653. BaseService.postN('/userw/agency/agencyquery', params).then((res: any) => {
  654. // console.log(res, 'res')
  655. if (res && res.code === 0) {
  656. let bizContent = res.data
  657. let data = bizContent.result || [];
  658. data.forEach((item) => {
  659. if (item.models) item.models.forEach((i) => {
  660. if (i.agreementAnnex) i.fileList = [{ name: i.agreementAnnex }]
  661. })
  662. })
  663. // console.log("bizContent12222", data)
  664. tableData.value = data;
  665. crudRef.value.tableLoding = false;
  666. field.value.paging.total = bizContent.totalCount;
  667. } else {
  668. crudRef.value.tableLoding = false;
  669. ElMessage.error(res.message)
  670. }
  671. })
  672. }
  673. // 启用、禁用
  674. function isOpenHandle(row: IObject, type: number) {
  675. // console.log(type);
  676. // type 1是启用 2是禁用
  677. BaseService.postN('/userw/agency/agencyenable', {
  678. agencyId: row.agencyId,
  679. status: type == 1 ? 'ENABLE' : 'DISABLE'
  680. }).then((res: any) => {
  681. if (res && res.code === 0) {
  682. getList();
  683. ElMessage.success("操作成功");
  684. } else {
  685. ElMessage.error(res.message)
  686. }
  687. })
  688. }
  689. // 字段列表
  690. const dataForm = ref<{ id?: string; configSetInfos?: any }>({
  691. configSetInfos: [],
  692. })
  693. // 添加
  694. const addBtn = () => {
  695. dataForm.value.configSetInfos.push({
  696. corporateAccount: '',
  697. merchantId: '',
  698. openingBank: '',
  699. agreementName: '',
  700. agreementId: '',
  701. termOfValidity: '',
  702. agreementAnnex: ''
  703. })
  704. }
  705. // 删除
  706. const deleteHandle = (item, index) => {
  707. dataForm.value.configSetInfos.splice(index, 1)
  708. }
  709. // 附件上传
  710. const data = { bucket: "" };
  711. const uploadUrl = "/minIo/upload"
  712. const upload = ref()
  713. const url = import.meta.env.VITE_APP_UPLOAD_URL
  714. //覆盖替换上一个文件
  715. const handleExceed: UploadProps['onExceed'] = (files) => {
  716. ElMessage.error('只能上传一条附件!')
  717. }
  718. function onSuccess(response: any, row: any) {
  719. // import.meta.env.VITE_APP_UPLOAD_URL +
  720. // row.agreementAnnex = response.data.ossFilePath
  721. row.agreementAnnex = response.data.originalFileName
  722. }
  723. onMounted(() => {
  724. getList();
  725. getCenterAgencyId();
  726. })
  727. </script>
  728. <style lang="scss" scoped>
  729. .input-wrap {
  730. .el-form-item {
  731. margin-bottom: 0;
  732. }
  733. }
  734. </style>