index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. <template>
  2. <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
  3. <template slot-scope="{ activeKey, data }">
  4. <div class="app-container">
  5. <div v-if="activeKey == 'list'" class="mymain-container">
  6. <div>
  7. <el-select v-model="value1" multiple placeholder="显示层级">
  8. <el-option v-for="item in types" :key="item.value" :label="item.label" :value="item.value"> </el-option>
  9. </el-select>
  10. <span style="display: inline-block; width: 220px; margin: 0 10px"
  11. ><el-input v-model="input" placeholder="模糊搜索"></el-input
  12. ></span>
  13. <el-button type="primary" @click="handleDownload">下载模板</el-button>
  14. <span style="display: inline-block; margin: 0 10px">
  15. <el-upload action="_" :show-file-list="false" :http-request="adminWebsitImportFun">
  16. <el-button type="primary">导入</el-button>
  17. </el-upload>
  18. </span>
  19. <el-button type="primary" @click="daochuqu">导出</el-button>
  20. </div>
  21. <div class="table">
  22. <el-table :data="showList" border>
  23. <el-table-column prop="type" label="级别" width="70">
  24. <template slot-scope="scope">
  25. <el-tag v-if="scope.row.type == 'A'" type="success">平台</el-tag>
  26. <el-tag v-if="scope.row.type == 'B'">商户</el-tag>
  27. <el-tag v-if="scope.row.type == 'C'" type="warning">网点</el-tag>
  28. </template>
  29. </el-table-column>
  30. <el-table-column prop="name" label="网点名称"> </el-table-column>
  31. <el-table-column prop="" label="结构">
  32. <template slot-scope="scope">
  33. {{ scope.row.pname.join(' -> ') }}
  34. </template>
  35. </el-table-column>
  36. <el-table-column align="center" label="状态" class-name="status-col" width="80">
  37. <template slot-scope="scope">
  38. <el-tag :type="scope.row.status ? 'success' : 'danger'">{{
  39. scope.row.status ? '启用' : '禁用'
  40. }}</el-tag>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="操作" width="268" fixed="right">
  44. <template slot-scope="scope">
  45. <el-button
  46. type="primary"
  47. size="mini"
  48. icon="el-icon-edit"
  49. @click="openMainForm('edit', scope.row.websitId)"
  50. >编辑</el-button
  51. >
  52. <el-button type="primary" size="mini" icon="el-icon-edit" @click="handleDelete(scope.row.websitId)"
  53. >删除</el-button
  54. >
  55. <el-button
  56. v-if="!!~['A', 'B'].indexOf(scope.row.type)"
  57. :type="{ A: 'primary', B: 'warning' }[scope.row.type]"
  58. plain
  59. size="mini"
  60. icon="el-icon-plus"
  61. @click="openMainForm('add', scope.row.websitId)"
  62. >
  63. 添加{{ scope.row.type == 'A' ? '商户' : scope.row.type == 'B' ? '网点' : '网点' }}
  64. </el-button>
  65. </template>
  66. </el-table-column>
  67. </el-table>
  68. </div>
  69. <div class="pagination clearfix">
  70. <div class="fr">
  71. <el-pagination
  72. @size-change="handleSizeChange"
  73. @current-change="handleCurrentChange"
  74. :current-page="currentPage"
  75. :page-sizes="[15, 20, 30, 50]"
  76. :page-size="pageSize"
  77. layout="total, sizes, prev, pager, next, jumper"
  78. :total="listTotal"
  79. >
  80. </el-pagination>
  81. </div>
  82. </div>
  83. </div>
  84. <div v-if="~['add', 'edit'].indexOf(activeKey)">
  85. <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="120px">
  86. <el-row :gutter="20" justify="start">
  87. <el-col :span="6">
  88. <el-form-item label="上级" prop="parentId">
  89. <el-cascader
  90. style="width: 100%"
  91. :options="dataList2"
  92. :props="{ checkStrictly: true, value: 'websitId', label: 'name' }"
  93. v-model="mainForm.parentId"
  94. filterable
  95. clearable
  96. >
  97. </el-cascader>
  98. </el-form-item>
  99. </el-col>
  100. <el-col :span="6">
  101. <el-form-item label="名称" prop="name">
  102. <el-input placeholder="请输入网点名称" v-model="mainForm.name"></el-input>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="6">
  106. <el-form-item label="联系人" prop="linkName">
  107. <el-input placeholder="请输入联系人名称" v-model="mainForm.linkName"></el-input>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="6">
  111. <el-form-item label="联系人电话" prop="websitPhone">
  112. <el-input
  113. placeholder="请输入联系人电话"
  114. maxlength="11"
  115. type="number"
  116. v-model="mainForm.websitPhone"
  117. ></el-input>
  118. </el-form-item>
  119. </el-col>
  120. <el-col :span="12">
  121. <el-form-item label="地址" prop="address">
  122. <div style="display: flex">
  123. <el-input placeholder="请选择地址" style="margin-right: 20px" v-model="mainForm.address"></el-input>
  124. <geographicalPosi :formData="mainForm" @selectPosi="selectAddress"></geographicalPosi>
  125. </div>
  126. </el-form-item>
  127. </el-col>
  128. <el-col :span="6">
  129. <el-form-item label="电子支付商户" prop="payWorkerCodeId">
  130. <el-select v-model="mainForm.payWorkerCodeId" placeholder="请选择">
  131. <el-option v-for="item in PayConfigList" :key="item.value" :label="item.label" :value="item.value">
  132. </el-option>
  133. </el-select>
  134. <div style="margin-left: 5px; color: #fd8005; width: calc(100% + 120px); margin-left: -90px">
  135. 配置师傅销售辅材配件给用户的电子支付收款商户
  136. </div>
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="6">
  140. <el-form-item label="状态" prop="status">
  141. <el-radio-group v-model="mainForm.status">
  142. <el-radio :label="true">启用</el-radio>
  143. <el-radio :label="false">禁用</el-radio>
  144. </el-radio-group>
  145. </el-form-item>
  146. </el-col>
  147. <el-col :span="24">
  148. <el-form-item label="通联支付" prop="isUseAllinpay">
  149. <el-switch v-model="mainForm.isUseAllinpay" active-color="#13ce66" inactive-color="#ff4949">
  150. </el-switch>
  151. <span style="margin-left: 5px; color: #fd8005">网点销售辅材配件通联支付配置开关</span>
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="24" v-if="mainForm.isUseAllinpay">
  155. <el-button
  156. v-if="!editId"
  157. type="text"
  158. @click="
  159. () => {
  160. mainForm.payConfigList.push({})
  161. }
  162. "
  163. >添加</el-button
  164. >
  165. <el-table
  166. :data="editId ? [{}, ...(mainForm.payConfigList || [])] : mainForm.payConfigList || []"
  167. style="width: 100%"
  168. >
  169. <el-table-column prop="name" label="商户名称">
  170. <template slot-scope="scope">
  171. <el-input
  172. v-if="!!~indexs.indexOf(scope.$index) || !editId"
  173. v-model="scope.row.name"
  174. placeholder="请输入内容"
  175. ></el-input>
  176. <span v-else>{{ scope.row.name }}</span>
  177. </template>
  178. </el-table-column>
  179. <el-table-column prop="orgId" label="通联集团号">
  180. <template slot-scope="scope">
  181. <el-input
  182. v-if="!!~indexs.indexOf(scope.$index) || !editId"
  183. v-model="scope.row.orgId"
  184. placeholder="请输入内容"
  185. ></el-input>
  186. <span v-else>{{ scope.row.orgId }}</span>
  187. </template>
  188. </el-table-column>
  189. <el-table-column prop="type" label="类别">
  190. <template slot-scope="scope">
  191. <el-select
  192. v-if="!!~indexs.indexOf(scope.$index) || !editId"
  193. v-model="scope.row.type"
  194. placeholder="请选择"
  195. >
  196. <el-option label="辅材" value="M" />
  197. <el-option label="配件" value="P" />
  198. </el-select>
  199. <span v-else>{{ { M: '辅材', P: '配件' }[scope.row.type] }}</span>
  200. </template>
  201. </el-table-column>
  202. <el-table-column prop="mchNo" label="通联商户号">
  203. <template slot-scope="scope">
  204. <el-input
  205. v-if="!!~indexs.indexOf(scope.$index) || !editId"
  206. v-model="scope.row.mchNo"
  207. placeholder="请输入内容"
  208. ></el-input>
  209. <span v-else>{{ scope.row.mchNo }}</span>
  210. </template>
  211. </el-table-column>
  212. <el-table-column prop="appid" label="通联商户appid">
  213. <template slot-scope="scope">
  214. <el-input
  215. v-if="!!~indexs.indexOf(scope.$index) || !editId"
  216. v-model="scope.row.appid"
  217. placeholder="请输入内容"
  218. ></el-input>
  219. <span v-else>{{ scope.row.appid }}</span>
  220. </template>
  221. </el-table-column>
  222. <el-table-column prop="status" label="状态">
  223. <template slot-scope="scope">
  224. <el-select
  225. v-if="!!~indexs.indexOf(scope.$index) || !editId"
  226. v-model="scope.row.status"
  227. placeholder="请选择"
  228. >
  229. <el-option label="开启" :value="true" />
  230. <el-option label="关闭" :value="false" />
  231. </el-select>
  232. <span v-else>{{ scope.row.type ? '开启' : '关闭' }}</span>
  233. </template>
  234. </el-table-column>
  235. <el-table-column v-if="editId" prop="createBy" label="创建人"> </el-table-column>
  236. <el-table-column v-if="editId" prop="createTime" label="创建时间"> </el-table-column>
  237. <el-table-column v-if="editId" prop="updateBy" label="修改人"> </el-table-column>
  238. <el-table-column v-if="editId" prop="" label="操作">
  239. <template slot-scope="scope">
  240. <el-button v-if="!!~indexs.indexOf(scope.$index)" type="text" @click="caozuoanniuSave(scope)"
  241. >保存</el-button
  242. >
  243. <el-button
  244. v-if="!~indexs.indexOf(scope.$index) && scope.$index > 0"
  245. type="text"
  246. @click="caozuoanniuEid(scope)"
  247. >编辑</el-button
  248. >
  249. <el-button
  250. v-if="!~indexs.indexOf(scope.$index) && scope.$index > 0"
  251. type="text"
  252. @click="caozuoanniuDel(scope)"
  253. >删除</el-button
  254. >
  255. </template>
  256. </el-table-column>
  257. </el-table>
  258. </el-col>
  259. <!-- <el-col :span="6">
  260. <el-form-item label="增值服务" prop="isIncre">
  261. <el-radio-group v-model="mainForm.isIncre">
  262. <el-radio :label="true">启用</el-radio>
  263. <el-radio :label="false">禁用</el-radio>
  264. </el-radio-group>
  265. </el-form-item>
  266. </el-col> -->
  267. </el-row>
  268. <!-- <el-form-item v-if="mainForm.type == 'B'" label="商品出入库" prop="joinCode">
  269. <el-radio-group v-model="mainForm.joinCode">
  270. <el-radio :label="true">关联条码</el-radio>
  271. <el-radio :label="false">不关联条码</el-radio>
  272. </el-radio-group>
  273. </el-form-item> -->
  274. </el-form>
  275. <div class="footer">
  276. <el-button @click="data.removeTab()">取 消</el-button>
  277. <el-button type="primary" @click="submitMainForm(data.removeTab)">确 定</el-button>
  278. </div>
  279. </div>
  280. </div>
  281. </template>
  282. </zj-tab-page>
  283. </template>
  284. <script>
  285. import {
  286. getDepartmentList,
  287. addDepartment,
  288. editDepartment,
  289. getDepartmentDetail,
  290. deleteDepartment,
  291. adminWebsitSavePayConfig,
  292. adminWebsitDeletePayConfig,
  293. adminWebsitImport,
  294. adminWebsitExport
  295. } from '@/api/setting'
  296. import geographicalPosi from '@/components/geographicalPosi/index.vue'
  297. import { adminCompanyPayConfigList } from '@/api/paymentMerchantManagement'
  298. import { commonTemplateDownload } from '@/api/common.js'
  299. export default {
  300. components: { geographicalPosi },
  301. data() {
  302. return {
  303. PayConfigList: [],
  304. dataList: [], // 列表数据
  305. dataList2: [], // 列表数据
  306. listLoading: true, // 列表加载loading
  307. currentPage: 1, // 当前页码
  308. pageSize: 15, // 每页数量
  309. editId: null,
  310. mainFormType: 'add',
  311. mainFormVisible: false,
  312. addressVisible: false,
  313. input: '',
  314. value1: [],
  315. levels: [],
  316. types: [
  317. { label: '平台', value: 'A' },
  318. { label: '商户', value: 'B' },
  319. { label: '网点', value: 'C' }
  320. ],
  321. mainForm: {
  322. parentId: '',
  323. name: '',
  324. linkName: '',
  325. websitPhone: '',
  326. lat: '',
  327. lng: '',
  328. address: '',
  329. status: true,
  330. isUseAllinpay: true,
  331. payWorkerCodeId: '',
  332. payConfigList: [],
  333. isIncre: true,
  334. joinCode: '',
  335. type: ''
  336. },
  337. mainFormRules: {
  338. name: [{ required: true, message: '请填写网点名称', trigger: 'blur' }],
  339. linkName: [{ required: true, message: '请填写联系人名称', trigger: 'blur' }],
  340. websitPhone: [{ required: true, message: '请填写联系人电话', trigger: 'blur' }],
  341. address: [{ required: true, message: '请选择GPS地址', trigger: 'blur' }],
  342. payWorkerCodeId: [{ required: true, message: '请选择电子支付商户', trigger: 'blur' }]
  343. },
  344. indexs: [0]
  345. }
  346. },
  347. created() {
  348. this.getList()
  349. },
  350. computed: {
  351. showList() {
  352. return [...this.dataList]
  353. .filter(item => {
  354. return (
  355. (this.value1.length ? !!~this.value1.indexOf(item.type) : true) &&
  356. (this.input ? !!~item.name.indexOf(this.input) || !!~item.pname.indexOf(this.input) : true)
  357. )
  358. })
  359. .splice((this.currentPage - 1) * this.pageSize, this.pageSize)
  360. },
  361. listTotal() {
  362. return [...this.dataList].filter(item => {
  363. return (
  364. (this.value1.length ? !!~this.value1.indexOf(item.type) : true) &&
  365. (this.input ? !!~item.name.indexOf(this.input) || !!~item.pname.indexOf(this.input) : true)
  366. )
  367. }).length
  368. }
  369. },
  370. watch: {
  371. value1() {
  372. this.$nextTick(() => {
  373. this.currentPage = 1
  374. })
  375. },
  376. input() {
  377. this.$nextTick(() => {
  378. this.currentPage = 1
  379. })
  380. }
  381. },
  382. methods: {
  383. daochuqu() {
  384. adminWebsitExport({}, `网点管理`)
  385. .then(res => {
  386. this.$message({
  387. message: '导出成功',
  388. type: 'success'
  389. })
  390. })
  391. .catch(err => {
  392. this.$message.error('导出失败')
  393. })
  394. },
  395. adminWebsitImportFun(data) {
  396. const loading = this.$loading({
  397. lock: true,
  398. text: '正在导入',
  399. spinner: 'el-icon-loading',
  400. background: 'rgba(0, 0, 0, 0.7)'
  401. })
  402. var formdata = new FormData()
  403. formdata.append('file', data.file)
  404. adminWebsitImport({ formdata })
  405. .then(res => {
  406. this.getList()
  407. loading.close()
  408. this.$message({
  409. type: 'success',
  410. message: '导入成功!'
  411. })
  412. })
  413. .catch(err => {
  414. loading.close()
  415. this.$message({
  416. type: 'error',
  417. message: err.message || '导入失败'
  418. })
  419. })
  420. },
  421. // 下载导入模版
  422. handleDownload() {
  423. commonTemplateDownload({ name: '网点管理导入模板.xlsx' }, '网点管理导入模板')
  424. .then(res => {
  425. this.$message({
  426. message: '下载成功',
  427. type: 'success'
  428. })
  429. })
  430. .catch(err => {
  431. this.$message.error('下载失败')
  432. })
  433. },
  434. // 获取网点列表
  435. getList() {
  436. var list_ = []
  437. var levels = []
  438. function dg(list, level = 1, pname = []) {
  439. for (let { children, name, ...item } of list) {
  440. var n_ = ''
  441. for (var i = 1; i < level; i++) n_ += ` -> `
  442. list_.push({ ...item, name: n_ + name, level, pname: [...pname] })
  443. if (!~levels.indexOf(level)) levels.push(level)
  444. if (children && children.length) dg(children, level + 1, [...pname, name])
  445. }
  446. }
  447. getDepartmentList().then(res => {
  448. this.dataList2 = res.data
  449. dg(res.data)
  450. this.dataList = list_
  451. this.levels = levels
  452. })
  453. },
  454. selectAddress(res) {
  455. this.mainForm.lng = res.center[0]
  456. this.mainForm.lat = res.center[1]
  457. this.mainForm.address = res.name
  458. },
  459. // 更改每页数量
  460. handleSizeChange(val) {
  461. this.pageSize = val
  462. this.currentPage = 1
  463. // this.getList()
  464. },
  465. // 更改当前页
  466. handleCurrentChange(val) {
  467. this.currentPage = val
  468. // this.getList()
  469. },
  470. // 操作 - 删除
  471. handleDelete(id) {
  472. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  473. confirmButtonText: '确定',
  474. cancelButtonText: '取消',
  475. showClose: false,
  476. type: 'warning'
  477. })
  478. .then(() => {
  479. deleteDepartment({ id: id }).then(res => {
  480. this.getList()
  481. this.$successMsg()
  482. })
  483. })
  484. .catch(() => {})
  485. },
  486. // 打开 新增编辑 网点表单
  487. openMainForm(type, id) {
  488. this.$refs.tabPage.addTab({
  489. // 对应显示的模块
  490. activeKey: type,
  491. // 唯一标识
  492. key: type,
  493. // 页签名称
  494. label: { edit: '编辑', add: '新增' }[type],
  495. // 打开时事件
  496. triggerEvent: () => {
  497. adminCompanyPayConfigList({ pageNum: 1, pageSize: -1, params: [] }).then(res => {
  498. this.PayConfigList = res.data.records.map(item => ({
  499. label: item.payMerchantName,
  500. value: item.id
  501. }))
  502. })
  503. this.cancelMainForm()
  504. this.$nextTick(() => {
  505. this.mainFormType = type
  506. this.mainFormVisible = true
  507. if (type == 'add') {
  508. this.editId = null
  509. this.mainForm.parentId = id
  510. } else {
  511. this.editId = id
  512. getDepartmentDetail({ id }).then(res => {
  513. this.mainForm = {
  514. parentId: res.data.parentId,
  515. name: res.data.name,
  516. linkName: res.data.linkName,
  517. websitPhone: res.data.websitPhone,
  518. lat: res.data.lat,
  519. lng: res.data.lng,
  520. address: res.data.address,
  521. status: res.data.status,
  522. isUseAllinpay: res.data.isUseAllinpay,
  523. payWorkerCodeId: res.data.payWorkerCodeId,
  524. payConfigList: res.data.payConfigList || [],
  525. isIncre: res.data.isIncre,
  526. joinCode: res.data.joinCode,
  527. type: res.data.type
  528. }
  529. })
  530. }
  531. })
  532. },
  533. // 关闭时事件
  534. closeEvent: () => {}
  535. })
  536. },
  537. // 取消 新增编辑 网点表单
  538. cancelMainForm() {
  539. this.mainFormVisible = false
  540. this.$refs?.mainForm?.resetFields()
  541. this.$data.mainForm = this.$options.data().mainForm
  542. },
  543. // 提交 网点表单
  544. submitMainForm(removeTab) {
  545. this.$refs.mainForm.validate(valid => {
  546. if (valid) {
  547. let parentId = null
  548. if (this.mainForm.parentId instanceof Array) {
  549. parentId = this.mainForm.parentId[this.mainForm.parentId.length - 1]
  550. } else {
  551. parentId = this.mainForm.parentId
  552. }
  553. let params = {
  554. parentId,
  555. name: this.mainForm.name,
  556. linkName: this.mainForm.linkName,
  557. websitPhone: this.mainForm.websitPhone,
  558. lat: this.mainForm.lat,
  559. lng: this.mainForm.lng,
  560. address: this.mainForm.address,
  561. status: this.mainForm.status,
  562. isIncre: this.mainForm.isIncre,
  563. isUseAllinpay: this.mainForm.isUseAllinpay,
  564. payWorkerCodeId: this.mainForm.payWorkerCodeId,
  565. payConfigList: this.mainForm.payConfigList,
  566. joinCode: this.mainForm.joinCode
  567. }
  568. if (this.mainFormType == 'edit') {
  569. params.websitId = this.editId
  570. editDepartment(params).then(res => {
  571. this.getList()
  572. this.$successMsg('编辑成功')
  573. removeTab('list')
  574. })
  575. } else {
  576. addDepartment(params).then(res => {
  577. this.getList()
  578. this.$successMsg('添加成功')
  579. removeTab('list')
  580. })
  581. }
  582. }
  583. })
  584. },
  585. caozuoanniuSave(data) {
  586. adminWebsitSavePayConfig({
  587. ...{
  588. companyWechatName: JSON.parse(localStorage.getItem('greemall_user'))?.companyName || '',
  589. companyWechatId: JSON.parse(localStorage.getItem('greemall_user'))?.companyWechatId || '',
  590. websitId: this.editId
  591. },
  592. ...data.row
  593. }).then(res => {
  594. getDepartmentDetail({ id: this.editId }).then(res => {
  595. this.mainForm = {
  596. parentId: res.data.parentId,
  597. name: res.data.name,
  598. linkName: res.data.linkName,
  599. websitPhone: res.data.websitPhone,
  600. lat: res.data.lat,
  601. lng: res.data.lng,
  602. address: res.data.address,
  603. status: res.data.status,
  604. isUseAllinpay: res.data.isUseAllinpay,
  605. payWorkerCodeId: res.data.payWorkerCodeId,
  606. payConfigList: res.data.payConfigList || [],
  607. isIncre: res.data.isIncre,
  608. joinCode: res.data.joinCode,
  609. type: res.data.type
  610. }
  611. this.$successMsg('保存成功')
  612. if (data.$index > 0) {
  613. if (~indexs.indexOf(data.$index)) {
  614. this.indexs.splice(indexs.indexOf(data.$index), 1)
  615. }
  616. }
  617. })
  618. })
  619. },
  620. caozuoanniuDel(data) {
  621. adminWebsitDeletePayConfig({
  622. id: data.row.id
  623. }).then(res => {
  624. getDepartmentDetail({ id: this.editId }).then(res => {
  625. this.mainForm = {
  626. parentId: res.data.parentId,
  627. name: res.data.name,
  628. linkName: res.data.linkName,
  629. websitPhone: res.data.websitPhone,
  630. lat: res.data.lat,
  631. lng: res.data.lng,
  632. address: res.data.address,
  633. status: res.data.status,
  634. isUseAllinpay: res.data.isUseAllinpay,
  635. payWorkerCodeId: res.data.payWorkerCodeId,
  636. payConfigList: res.data.payConfigList || [],
  637. isIncre: res.data.isIncre,
  638. joinCode: res.data.joinCode,
  639. type: res.data.type
  640. }
  641. this.$successMsg('删除成功')
  642. if (data.$index > 0) {
  643. if (~indexs.indexOf(data.$index)) {
  644. this.indexs.splice(indexs.indexOf(data.$index), 1)
  645. }
  646. }
  647. })
  648. })
  649. },
  650. caozuoanniuEid(data) {
  651. if (!~this.indexs.indexOf(data.$index)) {
  652. this.indexs.push(data.$index)
  653. }
  654. }
  655. }
  656. }
  657. </script>
  658. <style scoped lang="scss">
  659. .footer {
  660. position: fixed;
  661. bottom: 0;
  662. left: 0;
  663. z-index: 1;
  664. width: 100%;
  665. background: #fff;
  666. padding: 15px 40px;
  667. box-sizing: border-box;
  668. transition: all 0.28s;
  669. text-align: right;
  670. box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
  671. &.hideSidebar {
  672. margin-left: 54px;
  673. width: calc(100vw - 54px);
  674. }
  675. &.openSidebar {
  676. margin-left: 210px;
  677. width: calc(100vw - 210px);
  678. }
  679. .tips {
  680. font-size: 12px;
  681. color: red;
  682. margin-top: 10px;
  683. }
  684. }
  685. </style>