doum
11 小时以前 c384e04f81caf681647c602d5896cc10b289582e
admin/src/views/business/shop.vue
@@ -5,19 +5,52 @@
      <el-form-item label="名称" prop="name">
        <el-input v-model="searchForm.name" placeholder="请输入名称" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="门店ID" prop="code">
        <el-input v-model="searchForm.code" placeholder="请输入门店ID" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="登录账号" prop="name">
        <el-input v-model="searchForm.username" placeholder="请输入登录账号" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="销售模式" prop="saleType" >
        <!-- 0正常 1禁用 -->
        <el-select     v-model="searchForm.saleType"  placeholder="销售模式"  @change="search"  >
        <el-select     v-model="searchForm.saleType"  placeholder="销售模式"  style="width: 100px"  @change="search"  >
          <el-option  :key="0" :value="0"  label="平台铺货"  ></el-option>
          <el-option   :key="1" :value="1" label="自主采购"  ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="省市区" prop="provinceId" >
      <el-select v-model="searchForm.provinceId" placeholder="省份" style="width: 100px" filterable @change="selectProvince">
        <el-option
            v-for="item in provinces"
            :key="item.id"
            :value="item.id"
            :label="item.name"
        ></el-option>
      </el-select>
      </el-form-item>
      <el-form-item label="" prop="cityId" >
      <el-select v-model="searchForm.cityId" filterable placeholder="城市"  @change="selectCity" style="width: 100px" >
        <el-option
            v-for="item in cities"
            :key="item.id"
            :value="item.id"
            :label="item.name"
        ></el-option>
      </el-select>
      </el-form-item>
      <el-form-item label="" prop="areaId" >
      <el-select v-model="searchForm.areaId" filterable placeholder="区域"  style="width: 100px" >
        <el-option
            v-for="item in areas"
            :key="item.id"
            :value="item.id"
            :label="item.name"
        ></el-option>
      </el-select>
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <!-- 0正常 1禁用 -->
        <el-select     v-model="searchForm.status"  placeholder="请选择状态"    @change="search"   >
        <el-select     v-model="searchForm.status"  placeholder="请选择状态"  style="width: 100px"    @change="search"   >
          <el-option  :key="0" :value="0"  label="正常"  ></el-option>
          <el-option   :key="1" :value="1" label="禁用"  ></el-option>
        </el-select>
@@ -135,21 +168,29 @@
import OperaGoodsShopWindow from '@/components/business/OperaGoodsShopWindow'
import { resetPwd, updateIsRecById } from '@/api/business/shop'
import ResetPwdShopWindow from '@/components/business/ResetPwdShopWindow'
import { listByParentId } from '@/api/business/areas'
export default {
  name: 'Shop',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaShopWindow, OperaShopInfoWindow, ResetPwdShopWindow,OperaGoodsShopWindow },
  components: { TableLayout, Pagination, OperaShopWindow, OperaShopInfoWindow, ResetPwdShopWindow, OperaGoodsShopWindow },
  data () {
    return {
      // 搜索
      searchForm: {
        name: '',
        code: '',
        username: '',
        status: '',
        saleType: '',
        isrec: ''
      }
        isrec: '',
        provinceId: '',
        cityId: '',
        areaId: ''
      },
      provinces: [],
      cities: [],
      areas: []
    }
  },
  created () {
@@ -159,11 +200,55 @@
      'field.id': 'id',
      'field.main': 'id'
    })
    listByParentId({ type: 0, parentId: '' })
      .then(data => {
        this.provinces = data
      })
    this.search()
  },
  methods: {
    goPriceSet(row){
      this.$refs.OperaGoodsShopWindow.open('设置供货价 - '+row.name, row )
    selectProvince (val) {
      this.searchForm.cityId = null
      this.searchForm.areaId = null
      this.cities = []
      this.areas = []
      listByParentId({ type: 1, parentId: val })
        .then(data => {
          this.cities = data
        })
        .catch(e => {
          this.$tip.error(e)
        })
    },
    selectCity (val) {
      this.searchForm.areaId = null
      this.areas = []
      listByParentId({ type: 2, parentId: val })
        .then(data => {
          this.areas = data
        })
        .catch(e => {
          this.$tip.error(e)
        })
    },
    initCityArea (proid, cityid) {
      listByParentId({ type: 1, parentId: proid })
        .then(data => {
          this.cities = data
        })
        .catch(e => {
          this.$tip.error(e)
        })
      listByParentId({ type: 2, parentId: cityid })
        .then(data => {
          this.areas = data
        })
        .catch(e => {
          this.$tip.error(e)
        })
    },
    goPriceSet (row) {
      this.$refs.OperaGoodsShopWindow.open('设置供货价 - ' + row.name, row)
    },
    resetPwd (row) {
      this.$dialog.messageWaring('确认重置该经销商【' + row.name + '】的登录密码吗?')
@@ -195,7 +280,7 @@
        })
    },
    showDetail (row) {
      this.$refs.OperaShopInfoWindow.open('经销商详情【'+row.name+'】', row)
      this.$refs.OperaShopInfoWindow.open('经销商详情【' + row.name + '】', row)
    }
  }
}