Ver código fonte

添加渠道门店

230320a303 1 ano atrás
pai
commit
a03089373c

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/index.html


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/static/css/chunk-cf6135cc.a8873671.css


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/static/js/app.646d8956.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/static/js/app.9c04c29f.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/static/js/chunk-cf6135cc.773c165b.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/static/js/chunk-dff88098.a6da5a7a.js


+ 2 - 2
src/api/index.js

@@ -1,12 +1,12 @@
 import base from './base'
 import house from './house'
 import user from './user'
-// import other from './other'
+import shop from './shop'
 import cust from './cust'
 export default {
   base,
   house,
   user,
-  // other,
+  shop,
   cust,
 }

+ 22 - 0
src/api/shop.js

@@ -0,0 +1,22 @@
+/**
+  * 门店渠道
+*/
+import { getRequest, getRequestNoSort } from '@/utils/request'
+
+export default {
+  admstorelist: params => { // 门店渠道 -  列表
+    return getRequest('/adm/store/list', params)
+  },
+  admstoreadd: params => { // 门店渠道 -  添加
+    return getRequestNoSort('/adm/store/add', params, 'loading')
+  },
+  admstoreedit: params => { // 门店渠道 -  编辑
+    return getRequestNoSort('/adm/store/edit', params, 'loading')
+  },
+  admstoredetail: params => { // 门店渠道 -  详情
+    return getRequestNoSort('/adm/store/detail', params, 'loading')
+  },
+  admstoredel: params => { // 门店渠道 -  删除
+    return getRequestNoSort('/adm/store/del', params, 'loading')
+  },
+}

+ 11 - 10
src/components/Common/Map.vue

@@ -1,13 +1,14 @@
 <template>
-  <el-drawer
-    :show-close="false"
-    :title="'定位'"
-    :wrapper-closable="false"
-    :close-on-press-escape="false"
-    :visible.sync="isShow"
-    size="900px"
-    custom-class="xl-drawer"
-    direction="rtl"
+    <el-dialog
+      v-loading="loading"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      :title="'定位'"
+      :fullscreen="false"
+      width="900px"
+      custom-class="xl-dialog"
+      center
     >
     <el-form :model="pointObj" class="lib-edit" :is-inline="false" label-width="50px" disabled>
       <el-form-item label="经度" style="width:50%">
@@ -44,7 +45,7 @@
       <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
       <el-button class="xl-form-btn t1" @click="close('confirm')">确 定</el-button>
     </div>
-  </el-drawer>
+  </el-dialog>
 </template>
 <script>
 import { AMapManager, lazyAMapApiLoaderInstance } from 'vue-amap'

+ 189 - 0
src/views/shop/components/popup/IndexEdit.vue

@@ -0,0 +1,189 @@
+<template>
+  <div>
+    <el-dialog
+      v-loading="loading"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      :title="curObj.id ? '编辑渠道' : '新增渠道'"
+      :fullscreen="false"
+      width="700px"
+      custom-class="xl-dialog"
+      center
+    >
+      <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="110px" :insertSlotArr="[9]">
+        <div slot="OI9" class="scoped-other-form">
+          <el-form-item label="点位坐标" class="scoped-item-two item">
+            纬度N<el-input v-model="cObj.latitude" disabled />
+            经度E<el-input v-model="cObj.longitude" disabled />
+            <el-button type="primary" class="map-btn" size="small" @click="openMap">点击从地图获取</el-button>
+          </el-form-item>
+        </div>
+        <div slot="footer" style="padding-top: 20px;">
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </base-form>
+    </el-dialog>
+    <handle-map :is-show="isShowMap" @close="closeMap" />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import handleMap from '@/components/Common/Map'
+export default {
+  components: {
+    handleMap,
+  },
+  mixins,
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    const token = window.sessionStorage.getItem('fp_token')
+    let domainUrl = process.env.VUE_APP_BASE_API
+    return {
+      domainUrl,
+      token,
+      loading: false,
+      formData: [],
+      cObj: {},
+      isShowMap: false,
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        if (this.curObj.id) {
+          this.$api.shop.admstoredetail({id: this.curObj.id}).then(res => {
+            this.cObj = res || {}
+            this.getDef()
+          })
+        } else {
+          this.cObj = this.curObj
+          this.getDef()
+        }
+      }
+    },
+  },
+  methods: {
+    getDef (str, strKey, strParams) {
+      let params = {...this.cObj}
+      if (!params.sort) params.sort = '9'
+      this.formData = [
+        { label: '门店名称', key: 'store_name', class: 'c-2', rules: 1 },
+        { label: '门店品牌', key: 'store_brand', class: 'c-2', rules: 1 },
+        { label: '所属区域', key: 'area_type', type: 'select', class: 'c-2', options: this.$dictData.area_type, rules: 1 },
+        { label: '店员数量', key: 'clerk_num', class: 'c-2', rules: 1 },
+        { label: '店长', key: 'store_manager', class: 'c-2', rules: 1 },
+        { label: '店长电话', key: 'manager_phone', class: 'c-2', rules: 1 },
+        { label: '分销代码', key: 'dept_code', class: 'c-2', rules: 1 },
+        { label: '排序', key: 'sort', class: 'c-2', rules: 1 },
+        { label: '门店精英', key: 'store_elite' },
+        { label: '地址', key: 'address', rules: 1 },
+        { label: '门头照片', key: 'pri_image', class: 'c-2', type: 'cuImg',
+        options: {
+            w: 375,
+            h: 250,
+          }
+        , rules: 1 },
+        { label: '营业执照', key: 'busines_licens', type: 'upload', class: 'c-2'},
+      ]
+      this.setDefaultValue(params)
+    },
+    close (str) {
+      if (str === 'confirm') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            const newForm = { ...oldform }
+            newForm.longitude = this.cObj.longitude
+            newForm.latitude = this.cObj.latitude
+            if (!newForm.longitude) return this.$msgw('请选择经度!')
+            else if (!newForm.latitude) return this.$msgw('请选择纬度!')
+            let apiStr = 'admstoreadd'
+            if (this.curObj.id) {
+              newForm.id = this.curObj.id
+              apiStr = 'admstoreedit'
+            }
+            this.$api.shop[apiStr](newForm).then(data => {
+              this.$msgs(newForm.id ? '编辑成功' : '新增成功')
+              this.productData = []
+              this.$emit('close', newForm)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.productData = []
+        this.setDefaultValue()
+      }
+    },
+    openMap() { // 定位
+      this.isShowMap = true
+      const pointObj = {
+        latitude: this.cObj.latitude || '',
+        longitude: this.cObj.longitude || '',
+        address: this.cObj.address || ''
+      }
+      this.$root.$emit('handleMap', pointObj)
+    },
+    closeMap(obj) {
+      if (obj) {
+        const oldform = this.$refs.ruleForm.baseForm
+        const newForm = { ...oldform, ...obj }
+        this.cObj = newForm
+        this.setDefaultValue(newForm)
+      }
+      this.isShowMap = false
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+@import '../../../../styles/libEdit.scss';
+.lib-edit {
+  width: 600px;
+  padding-top: 0;
+  padding-left: 0;
+  padding-bottom: 40px;
+  ::v-deep .el-form-item {
+    margin-bottom: 10px;
+  }
+  ::v-deep .el-date-editor.el-input {
+    width: 100%;
+  }
+}
+.scoped-other-form {
+  .scoped-item-two {
+    .el-input {
+      display: inline-block;
+      width: 120px;
+      margin: 0 10px;
+    }
+  }
+}
+.map-btn{
+  height: 36px;
+}
+::v-deep .el-drawer__header {
+  margin-bottom: 10px;
+}
+
+::v-deep .img-upload {
+  width: 120px;
+  height: 80px;
+  .icon {
+    width: 120px;
+    height: 80px;
+    line-height: 80px;
+  }
+  .img {
+    width: 120px;
+    height: 80px;
+  }
+}
+
+</style>

+ 45 - 0
src/views/shop/components/searchForm/Index.vue

@@ -0,0 +1,45 @@
+<template>
+  <base-form slot="content" ref="ruleForm" :data="searchData">
+    <div slot="footer">
+      <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询</el-button>
+      <el-button :loading="listLoading" icon="el-icon-plus" class="xl-form-btn bgc2" @click="addHandle">添加</el-button>
+    </div>
+  </base-form>
+</template>
+<script>
+export default {
+  props: {
+    listLoading: Boolean
+  },
+  inject: ['parentData'],
+  mixins,
+  data() {
+    return {
+      searchData: []
+    }
+  },
+  mounted () {
+    this.getDef()
+  },
+  methods: {
+    addHandle () {
+      this.parentData.isDtlShow = true
+      this.parentData.curObj = {}
+    },
+    getDef (str) {
+      this.searchData = [
+        { label: '所属区域', key: 'area_type', type: 'select', options: this.$dictData.area_type},
+        { label: '门店名称', key: 'store_name' },
+        { label: '店长', key: 'store_manager' },
+        { label: '店长电话', key: 'manager_phone' },
+      ]
+      this.setDefaultValue(params, 'searchData')
+    },
+    searchHandle() {
+      const oldform = this.$refs.ruleForm.baseForm
+      const newForm = { ...oldform }
+      this.$emit('change', newForm)
+    }
+  }
+}
+</script>

BIN
src/views/shop/img/icon_g_close.png


+ 118 - 0
src/views/shop/index.vue

@@ -0,0 +1,118 @@
+<template>
+  <div class="app-container">
+    <search-form
+      :list-loading="listLoading"
+      @change="searchHandle"
+    />
+    <table-list
+      :list-loading="listLoading"
+      :data="tableData2"
+      :columns="listConfig"
+      :current-page="currentPage"
+      :page-size="pageSize"
+      :total-records="totalRecords"
+      @currentChange="pageHandle"
+      @sizeChange="sizeChange"
+      :isAdd="true"
+      @add="openPopup"
+      :operationsDefaultLength="3"
+    >
+    </table-list>
+    <popup-edit
+      :isShow="isDtlShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/Index'
+import PopupEdit from './components/popup/IndexEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'shopIndex',
+  components: {
+    SearchForm,
+    PopupEdit
+  },
+  provide() {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  data() {
+    return {
+      apiStr: 'shop.admstorelist',
+      searchForm: null,
+      isDtlShow: false,
+      isPriceShow: false,
+      curObj: {},
+      isHRShow: false,
+    }
+  },
+  computed: {
+    tableData2() {
+      const arr = [...this.tableData]
+      arr.map(item => {
+        // item.report_lock = item.report_lock + '天'
+        // item.lead_lock = item.lead_lock + '天'
+      })
+      return arr
+    }
+  },
+  created() {},
+  mounted() {
+    this.listConfig = {
+      rows: [
+        { label: '排序', prop: 'sort'},
+        { label: '门头照片', prop: 'pri_image', type: 'img' },
+        { label: '门店名称', prop: 'store_name' },
+        { label: '门店品牌', prop: 'store_brand' },
+        { label: '所属区域', prop: 'area_type', type: 'flag', flags: arrToObj(this.$dictData.area_type) },
+        { label: '店员数量', prop: 'clerk_num' },
+        { label: '店长', prop: 'store_manager' },
+        { label: '店长电话', prop: 'manager_phone' },
+        { label: '分销代码', prop: 'dept_code' },
+        { label: '更新时间', prop: 'update_at' },
+        { label: '操作', width: 80, type: 'handle2', operations:
+          [
+            { label: '编辑', func: this.openPopup, btnType: 'primary' },
+            { label: '删除', func: this.delHandle, btnType: 'danger' },
+          ]
+        }
+      ]
+    }
+  },
+  methods: {
+    delHandle(row) {
+      this.$msg(`您确定要删除该门店吗?`, 'confirm', () => {
+        this.$api.shop.admstoredel({
+          id: row.id,
+          status: 2
+        }).then(data => {
+          this.$msgs(`已删除!`)
+          this.fetchData()
+        })
+      }, null, true)
+    },
+    openPopup(row) {
+      if (row && row.id) {
+        this.curObj = row
+      } else {
+        this.curObj = {}
+      }
+      this.isDtlShow = true
+    },
+    closePopup(obj) {
+      this.isDtlShow = false
+      if (obj) {
+        this.fetchData()
+      }
+    },
+    
+    
+  }
+}
+</script>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff