积分超市
This commit is contained in:
		@@ -1,105 +1,112 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <div class="AppScoreSupermarket">
 | 
					  <ai-list v-if="!isShowDetail">
 | 
				
			||||||
    <ai-list v-show="!detailShow">
 | 
					    <template slot="title">
 | 
				
			||||||
      <template slot="title">
 | 
					      <ai-title title="积分超市" :isShowBottomBorder="false">
 | 
				
			||||||
        <ai-title title="积分超市" :isShowBottomBorder="false" :instance="instance" :isShowArea="true" v-model="areaId" @change="changeArea"></ai-title>
 | 
					      </ai-title>
 | 
				
			||||||
      </template>
 | 
					    </template>
 | 
				
			||||||
      <template slot="tabs">
 | 
					    <template slot="tabs">
 | 
				
			||||||
        <el-tabs v-model="currIndex">
 | 
					      <el-tabs v-model="currIndex">
 | 
				
			||||||
          <el-tab-pane v-for="(tab,i) in tabs" :key="i" :name="String(i)" :label="tab.label">
 | 
					        <el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
 | 
				
			||||||
            <component
 | 
					          <component :areaId="areaId" :ref="String(i)" v-if="currIndex == i" :is="tab.comp" @change="onChange" lazy :instance="instance" :dict="dict" :permissions="permissions"/>
 | 
				
			||||||
              :is="tab.comp"
 | 
					        </el-tab-pane>
 | 
				
			||||||
              v-if="currIndex === String(i)"
 | 
					      </el-tabs>
 | 
				
			||||||
              :areaId="areaId"
 | 
					    </template>
 | 
				
			||||||
              :ref="tab.name"
 | 
					  </ai-list>
 | 
				
			||||||
              @showDetail="showDetail"
 | 
					  <AddGoods v-else-if="componentName === 'AddGoods'" :areaId="areaId" :params="params" :instance="instance" :dict="dict" @change="onChange"></AddGoods>
 | 
				
			||||||
              :instance="instance"
 | 
					  <AddStore v-else-if="componentName === 'AddStore'" :areaId="areaId" :params="params" :instance="instance" :dict="dict" @change="onChange"></AddStore>
 | 
				
			||||||
              :dict="dict"
 | 
					 | 
				
			||||||
              :permissions="permissions" />
 | 
					 | 
				
			||||||
          </el-tab-pane>
 | 
					 | 
				
			||||||
        </el-tabs>
 | 
					 | 
				
			||||||
      </template>
 | 
					 | 
				
			||||||
    </ai-list>
 | 
					 | 
				
			||||||
    <component v-if="detailShow" :is="currDet" :areaId="areaId" :info="info" @goBack="goBack" :instance="instance" :dict="dict" :permissions="permissions"/>
 | 
					 | 
				
			||||||
  </div>
 | 
					 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
import goodsManagement from './goodsManagement'
 | 
					  import AddGoods from './components/AddGoods'
 | 
				
			||||||
import storeManagement from './storeManagement'
 | 
					  import AddStore from './components/AddStore'
 | 
				
			||||||
import addGoods from './components/addGoods'
 | 
					  import StoreList from './components/StoreList'
 | 
				
			||||||
import {mapState} from 'vuex'
 | 
					  import GoodsList from './components/GoodsList'
 | 
				
			||||||
 | 
					  import { mapState } from 'vuex'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					  export default {
 | 
				
			||||||
  name: "AppIntegratingSupermarket",
 | 
					    name: 'AppIntegratingSupermarket',
 | 
				
			||||||
  label: "积分超市",
 | 
					    label: '积分超市',
 | 
				
			||||||
  components: { goodsManagement, storeManagement, addGoods},
 | 
					 | 
				
			||||||
  props: {
 | 
					 | 
				
			||||||
    instance: Function,
 | 
					 | 
				
			||||||
    dict: Object,
 | 
					 | 
				
			||||||
    permissions: Function
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  computed: {
 | 
					    components: {
 | 
				
			||||||
    tabs() {
 | 
					      GoodsList,
 | 
				
			||||||
      return [
 | 
					      StoreList,
 | 
				
			||||||
        {
 | 
					      AddGoods,
 | 
				
			||||||
          label: "商品信息",
 | 
					      AddStore
 | 
				
			||||||
          name: "goodsManagement",
 | 
					 | 
				
			||||||
          comp: goodsManagement,
 | 
					 | 
				
			||||||
          detail: addGoods,
 | 
					 | 
				
			||||||
          permission: "app_apppartyfee_config"
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          label: "店铺管理",
 | 
					 | 
				
			||||||
          name: "storeManagement",
 | 
					 | 
				
			||||||
          comp: storeManagement,
 | 
					 | 
				
			||||||
          detail: '',
 | 
					 | 
				
			||||||
          permission: "app_apppartyfee_statistics"
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
      ]
 | 
					 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    ...mapState(['user']),
 | 
					
 | 
				
			||||||
    currDet() {
 | 
					    props: {
 | 
				
			||||||
      return this.tabs[Number(this.currIndex)].detail;
 | 
					      instance: Function,
 | 
				
			||||||
    }
 | 
					      dict: Object,
 | 
				
			||||||
  },
 | 
					      permissions: Function
 | 
				
			||||||
  created() {
 | 
					 | 
				
			||||||
    this.areaId = this.user.info.areaId;
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  data() {
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
      activeName: "orderManagement",
 | 
					 | 
				
			||||||
      currIndex: 0,
 | 
					 | 
				
			||||||
      areaId: '',
 | 
					 | 
				
			||||||
      detailShow: false,
 | 
					 | 
				
			||||||
      info: {}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  methods: {
 | 
					 | 
				
			||||||
    goBack() {
 | 
					 | 
				
			||||||
      this.detailShow = false;
 | 
					 | 
				
			||||||
      this.$nextTick(() => {
 | 
					 | 
				
			||||||
        this.$refs[this.tabs[Number(this.currIndex)].name][0].getList();
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    showDetail(obj) {
 | 
					
 | 
				
			||||||
      this.info = {...obj};
 | 
					    computed: {
 | 
				
			||||||
      this.detailShow = true;
 | 
					      ...mapState(['user']),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      tabs () {
 | 
				
			||||||
 | 
					        const tabList = [
 | 
				
			||||||
 | 
					          {label: '商品信息', name: 'GoodsList', comp: GoodsList, permission: ''},
 | 
				
			||||||
 | 
					          {label: '店铺管理', name: 'StoreList', comp: StoreList, permission: ''}
 | 
				
			||||||
 | 
					        ].filter(item => {
 | 
				
			||||||
 | 
					          return true
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return tabList
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    changeArea() {
 | 
					
 | 
				
			||||||
      this.$nextTick(() => {
 | 
					    data () {
 | 
				
			||||||
        if (this.currIndex == 0) this.$refs[this.tabs[Number(this.currIndex)].name][0].getShopList();
 | 
					      return {
 | 
				
			||||||
        if (this.currIndex == 1) this.$refs[this.tabs[Number(this.currIndex)].name][0].updateList();
 | 
					        activeName: 'GoodsList',
 | 
				
			||||||
        this.$refs[this.tabs[Number(this.currIndex)].name][0].getList();
 | 
					        currIndex: '0',
 | 
				
			||||||
      })
 | 
					        componentName: '',
 | 
				
			||||||
 | 
					        params: {},
 | 
				
			||||||
 | 
					        areaName: '',
 | 
				
			||||||
 | 
					        areaId: '',
 | 
				
			||||||
 | 
					        isShowDetail: false
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    created () {
 | 
				
			||||||
 | 
					      this.areaId = this.user.info.areaId
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    methods: {
 | 
				
			||||||
 | 
					      onAreaChange () {
 | 
				
			||||||
 | 
					        if (this.currIndex === '0') {
 | 
				
			||||||
 | 
					          this.$nextTick(() => {
 | 
				
			||||||
 | 
					            this.$refs[this.currIndex][0].getList()
 | 
				
			||||||
 | 
					          })
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      onChange (data) {
 | 
				
			||||||
 | 
					        if (data.type === 'GoodsList') {
 | 
				
			||||||
 | 
					          this.componentName = 'GoodsList'
 | 
				
			||||||
 | 
					          this.isShowDetail = false
 | 
				
			||||||
 | 
					          this.params = data.params
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if (data.type === 'StoreList') {
 | 
				
			||||||
 | 
					          this.componentName = 'StoreList'
 | 
				
			||||||
 | 
					          this.isShowDetail = false
 | 
				
			||||||
 | 
					          this.params = data.params
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (data.type === 'AddGoods') {
 | 
				
			||||||
 | 
					          this.componentName = 'AddGoods'
 | 
				
			||||||
 | 
					          this.isShowDetail = true
 | 
				
			||||||
 | 
					          this.params = data.params
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (data.type === 'AddStore') {
 | 
				
			||||||
 | 
					          this.componentName = 'AddStore'
 | 
				
			||||||
 | 
					          this.isShowDetail = true
 | 
				
			||||||
 | 
					          this.params = data.params
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<style lang="scss" scoped>
 | 
					<style lang="scss" scoped>
 | 
				
			||||||
.AppScoreSupermarket {
 | 
					 | 
				
			||||||
  width: 100%;
 | 
					 | 
				
			||||||
  height: 100%;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
</style>
 | 
					</style>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,230 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <ai-detail class="appgoods">
 | 
				
			||||||
 | 
					    <template slot="title">
 | 
				
			||||||
 | 
					      <ai-title title="添加店铺" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
 | 
				
			||||||
 | 
					      </ai-title>
 | 
				
			||||||
 | 
					    </template>
 | 
				
			||||||
 | 
					    <template slot="content">
 | 
				
			||||||
 | 
					      <ai-card title="基本信息">
 | 
				
			||||||
 | 
					        <template #content>
 | 
				
			||||||
 | 
					          <el-form class="ai-form" :model="form" label-width="120px" ref="form">
 | 
				
			||||||
 | 
					            <el-form-item style="width: 100%" label="商品名称" prop="title" :rules="[{required: true, message: '请输入商品名称', trigger: 'blur'}]">
 | 
				
			||||||
 | 
					              <el-input type="input" size="small" v-model="form.title" clearable placeholder="请输入商品名称" :maxlength="50" show-word-limit></el-input>
 | 
				
			||||||
 | 
					            </el-form-item>
 | 
				
			||||||
 | 
					            <el-form-item style="width: 100%" label="店铺类型" prop="type" :rules="[{required: true, message: '请选择店铺类型', trigger: 'change'}]">
 | 
				
			||||||
 | 
					              <ai-select
 | 
				
			||||||
 | 
					                v-model="form.type"
 | 
				
			||||||
 | 
					                placeholder="请选择店铺类型"
 | 
				
			||||||
 | 
					                :selectList="dict.getDict('integralSSType')">
 | 
				
			||||||
 | 
					              </ai-select>
 | 
				
			||||||
 | 
					            </el-form-item>
 | 
				
			||||||
 | 
					            <el-form-item v-if="form.type === '0'" label="可见范围" label-width="120px"  prop="sendScope">
 | 
				
			||||||
 | 
					              <el-radio-group v-model="form.sendScope">
 | 
				
			||||||
 | 
					                <el-radio label="0">不限</el-radio>
 | 
				
			||||||
 | 
					                <el-radio label="1">仅指定网格可见</el-radio>
 | 
				
			||||||
 | 
					              </el-radio-group>
 | 
				
			||||||
 | 
					            </el-form-item>
 | 
				
			||||||
 | 
					            <el-form-item v-if="form.type === '0'" label="选择网格" style="width: 100%;" label-width="120px"  prop="girdNames" :rules="[{ required: true, message: '请选择选择群主', trigger: 'change' }]">
 | 
				
			||||||
 | 
					              <ai-picker
 | 
				
			||||||
 | 
					                :instance="instance"
 | 
				
			||||||
 | 
					                multiple
 | 
				
			||||||
 | 
					                dialogTitle="选择网格"
 | 
				
			||||||
 | 
					                :ops="{label: 'girdName'}"
 | 
				
			||||||
 | 
					                pageTitle="网格"
 | 
				
			||||||
 | 
					                :action="'/app/appgirdinfo/girdList'"
 | 
				
			||||||
 | 
					                v-model="form.girdList"
 | 
				
			||||||
 | 
					                @pick="onPick"
 | 
				
			||||||
 | 
					                @change="onSelcetChange">
 | 
				
			||||||
 | 
					                <div class="AppAnnounceDetail-select">
 | 
				
			||||||
 | 
					                  <el-input size="small" class="AppAnnounceDetail-select__input" placeholder="请选择..." disabled v-model="form.girdNames"></el-input>
 | 
				
			||||||
 | 
					                  <div class="select-left" v-if="form.girdList.length">
 | 
				
			||||||
 | 
					                    <span v-for="(item, index) in girdList" :key="index" v-if="index < 9">{{ item.girdName }}</span>
 | 
				
			||||||
 | 
					                    <em v-if="girdList.length > 9">等{{ girdList.length }}个</em>
 | 
				
			||||||
 | 
					                  </div>
 | 
				
			||||||
 | 
					                  <i v-if="!form.girdList.length">请选择</i>
 | 
				
			||||||
 | 
					                  <div class="select-right">{{ form.girdList.length ? '重新选择' : '选择' }}</div>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					              </ai-picker>
 | 
				
			||||||
 | 
					            </el-form-item>
 | 
				
			||||||
 | 
					            <!-- <el-form-item label="店铺服务网格" style="width: 100%;" prop="sendScope">
 | 
				
			||||||
 | 
					            </el-form-item> -->
 | 
				
			||||||
 | 
					          </el-form>
 | 
				
			||||||
 | 
					        </template>
 | 
				
			||||||
 | 
					      </ai-card>
 | 
				
			||||||
 | 
					    </template>
 | 
				
			||||||
 | 
					    <template #footer>
 | 
				
			||||||
 | 
					      <el-button @click="cancel">取消</el-button>
 | 
				
			||||||
 | 
					      <el-button type="primary" @click="confirm">提交</el-button>
 | 
				
			||||||
 | 
					    </template>
 | 
				
			||||||
 | 
					  </ai-detail>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					  export default {
 | 
				
			||||||
 | 
					    name: 'AddStore',
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    props: {
 | 
				
			||||||
 | 
					      instance: Function,
 | 
				
			||||||
 | 
					      dict: Object,
 | 
				
			||||||
 | 
					      params: Object
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    data () {
 | 
				
			||||||
 | 
					      return {
 | 
				
			||||||
 | 
					        form: {
 | 
				
			||||||
 | 
					          title: '',
 | 
				
			||||||
 | 
					          type: '',
 | 
				
			||||||
 | 
					          girdNames: '',
 | 
				
			||||||
 | 
					          girdList: []
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        girdList: [],
 | 
				
			||||||
 | 
					        id: ''
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    created () {
 | 
				
			||||||
 | 
					      if (this.params && this.params.id) {
 | 
				
			||||||
 | 
					        this.id = this.params.id
 | 
				
			||||||
 | 
					        this.getInfo(this.params.id)
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    methods: {
 | 
				
			||||||
 | 
					      getInfo (id) {
 | 
				
			||||||
 | 
					        this.instance.post(`/app/appintegralmerchandise/queryDetailById?id=${id}`).then(res => {
 | 
				
			||||||
 | 
					          if (res.code === 0) {
 | 
				
			||||||
 | 
					            this.form = res.data
 | 
				
			||||||
 | 
					            this.form.picUrl = [{
 | 
				
			||||||
 | 
					              url: res.data.picUrl
 | 
				
			||||||
 | 
					            }]
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      onPick (e) {
 | 
				
			||||||
 | 
					        this.girdList = e
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      onSelcetChange (e) {
 | 
				
			||||||
 | 
					        if (e.length) {
 | 
				
			||||||
 | 
					          this.form.girdNames = '1'
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					          this.form.girdNames = ''
 | 
				
			||||||
 | 
					          this.form.girdList = []
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      confirm () {
 | 
				
			||||||
 | 
					        this.$refs.form.validate((valid) => {
 | 
				
			||||||
 | 
					          if (valid) {
 | 
				
			||||||
 | 
					            this.instance.post(`/app/appintegralsupermarketgoods/addOrUpdate`, {
 | 
				
			||||||
 | 
					              ...this.form,
 | 
				
			||||||
 | 
					              picUrl: this.form.picUrl[0].url,
 | 
				
			||||||
 | 
					              id: this.params.id || ''
 | 
				
			||||||
 | 
					            }).then(res => {
 | 
				
			||||||
 | 
					              if (res.code == 0) {
 | 
				
			||||||
 | 
					                this.$message.success('提交成功')
 | 
				
			||||||
 | 
					                setTimeout(() => {
 | 
				
			||||||
 | 
					                  this.cancel(true)
 | 
				
			||||||
 | 
					                }, 600)
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      cancel (isRefresh) {
 | 
				
			||||||
 | 
					        this.$emit('change', {
 | 
				
			||||||
 | 
					          type: 'GoodsList',
 | 
				
			||||||
 | 
					          isRefresh: !!isRefresh
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style scoped lang="scss">
 | 
				
			||||||
 | 
					  .appgoods {
 | 
				
			||||||
 | 
					    .AppAnnounceDetail-select {
 | 
				
			||||||
 | 
					      display: flex;
 | 
				
			||||||
 | 
					      align-items: center;
 | 
				
			||||||
 | 
					      min-height: 32px;
 | 
				
			||||||
 | 
					      line-height: 1;
 | 
				
			||||||
 | 
					      background: #F5F5F5;
 | 
				
			||||||
 | 
					      border-radius: 4px;
 | 
				
			||||||
 | 
					      border: 1px solid #D0D4DC;
 | 
				
			||||||
 | 
					      cursor: pointer;
 | 
				
			||||||
 | 
					      overflow: hidden;
 | 
				
			||||||
 | 
					      transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      &:hover {
 | 
				
			||||||
 | 
					        border-color: #26f;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      & > i {
 | 
				
			||||||
 | 
					        flex: 1;
 | 
				
			||||||
 | 
					        height: 100%;
 | 
				
			||||||
 | 
					        line-height: 32px;
 | 
				
			||||||
 | 
					        padding: 0 12px;
 | 
				
			||||||
 | 
					        color: #888888;
 | 
				
			||||||
 | 
					        font-size: 14px;
 | 
				
			||||||
 | 
					        font-style: normal;
 | 
				
			||||||
 | 
					        border-right: 1px solid #D0D4DC;
 | 
				
			||||||
 | 
					        background: #fff;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      .AppAnnounceDetail-select__input {
 | 
				
			||||||
 | 
					        position: absolute;
 | 
				
			||||||
 | 
					        left: 0;
 | 
				
			||||||
 | 
					        top: 0;
 | 
				
			||||||
 | 
					        z-index: -1;
 | 
				
			||||||
 | 
					        opacity: 0;
 | 
				
			||||||
 | 
					        height: 100%;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      .select-right {
 | 
				
			||||||
 | 
					        height: 100%;
 | 
				
			||||||
 | 
					        padding: 0 12px;
 | 
				
			||||||
 | 
					        color: #222222;
 | 
				
			||||||
 | 
					        font-size: 12px;
 | 
				
			||||||
 | 
					        cursor: pointer;
 | 
				
			||||||
 | 
					        transition: all ease 0.3s;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        &:hover {
 | 
				
			||||||
 | 
					          opacity: 0.5;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      .select-left {
 | 
				
			||||||
 | 
					        display: flex;
 | 
				
			||||||
 | 
					        flex-wrap: wrap;
 | 
				
			||||||
 | 
					        flex: 1;
 | 
				
			||||||
 | 
					        padding: 5px 0 0px 12px;
 | 
				
			||||||
 | 
					        border-right: 1px solid #D0D4DC;
 | 
				
			||||||
 | 
					        border-radius: 4px 0 0 4px;
 | 
				
			||||||
 | 
					        background: #fff;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        em {
 | 
				
			||||||
 | 
					          height: 22px;
 | 
				
			||||||
 | 
					          line-height: 22px;
 | 
				
			||||||
 | 
					          margin: 0 4px 5px 0;
 | 
				
			||||||
 | 
					          color: #222222;
 | 
				
			||||||
 | 
					          font-size: 12px;
 | 
				
			||||||
 | 
					          font-style: normal;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        span {
 | 
				
			||||||
 | 
					          height: 22px;
 | 
				
			||||||
 | 
					          line-height: 22px;
 | 
				
			||||||
 | 
					          margin: 0 4px 5px 0;
 | 
				
			||||||
 | 
					          padding: 0 8px;
 | 
				
			||||||
 | 
					          font-size: 12px;
 | 
				
			||||||
 | 
					          color: #222222;
 | 
				
			||||||
 | 
					          background: #F3F4F7;
 | 
				
			||||||
 | 
					          border-radius: 2px;
 | 
				
			||||||
 | 
					          border: 1px solid #D0D4DC;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
@@ -0,0 +1,188 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <ai-list isTabs class="GoodsList">
 | 
				
			||||||
 | 
					    <template slot="content">
 | 
				
			||||||
 | 
					      <ai-search-bar>
 | 
				
			||||||
 | 
					        <template slot="left">
 | 
				
			||||||
 | 
					          <ai-select
 | 
				
			||||||
 | 
					            v-model="search.type"
 | 
				
			||||||
 | 
					            @change="(search.current = 1), getList()"
 | 
				
			||||||
 | 
					            placeholder="请选择商品类型"
 | 
				
			||||||
 | 
					            :selectList="dict.getDict('integralSGType')">
 | 
				
			||||||
 | 
					          </ai-select>
 | 
				
			||||||
 | 
					          <ai-select
 | 
				
			||||||
 | 
					            v-model="search.status"
 | 
				
			||||||
 | 
					            @change="(search.current = 1), getList()"
 | 
				
			||||||
 | 
					            placeholder="请选择类型"
 | 
				
			||||||
 | 
					            :selectList="dict.getDict('integralSGStatus')">
 | 
				
			||||||
 | 
					          </ai-select>
 | 
				
			||||||
 | 
					          <el-button type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button>
 | 
				
			||||||
 | 
					        </template>
 | 
				
			||||||
 | 
					        <template slot="right">
 | 
				
			||||||
 | 
					          <el-input
 | 
				
			||||||
 | 
					            v-model="search.title"
 | 
				
			||||||
 | 
					            class="search-input"
 | 
				
			||||||
 | 
					            size="small"
 | 
				
			||||||
 | 
					            v-throttle="() => {search.current = 1, getList()}"
 | 
				
			||||||
 | 
					            placeholder="请输入商品名称"
 | 
				
			||||||
 | 
					            clearable
 | 
				
			||||||
 | 
					            @clear="search.current = 1, search.title = '', getList()"
 | 
				
			||||||
 | 
					            suffix-icon="iconfont iconSearch">
 | 
				
			||||||
 | 
					          </el-input>
 | 
				
			||||||
 | 
					        </template>
 | 
				
			||||||
 | 
					      </ai-search-bar>
 | 
				
			||||||
 | 
					      <ai-table
 | 
				
			||||||
 | 
					        style="margin-top: 8px;"
 | 
				
			||||||
 | 
					        :tableData="tableData"
 | 
				
			||||||
 | 
					        :col-configs="colConfigs"
 | 
				
			||||||
 | 
					        :total="total"
 | 
				
			||||||
 | 
					        :current.sync="search.current"
 | 
				
			||||||
 | 
					        :size.sync="search.size"
 | 
				
			||||||
 | 
					        @getList="getList">
 | 
				
			||||||
 | 
					        <el-table-column
 | 
				
			||||||
 | 
					          label="商品"
 | 
				
			||||||
 | 
					          slot="goods"
 | 
				
			||||||
 | 
					          align="left"
 | 
				
			||||||
 | 
					          width="450">
 | 
				
			||||||
 | 
					          <template v-slot="{ row }">
 | 
				
			||||||
 | 
					            <div class="goods">
 | 
				
			||||||
 | 
					              <ai-uploader
 | 
				
			||||||
 | 
					                :disabled="true"
 | 
				
			||||||
 | 
					                :instance="instance"
 | 
				
			||||||
 | 
					                :value="[{url: row.picUrl}]"
 | 
				
			||||||
 | 
					                :limit="1">
 | 
				
			||||||
 | 
					              </ai-uploader>
 | 
				
			||||||
 | 
					              <p>{{ row.title }}</p>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					          </template>
 | 
				
			||||||
 | 
					        </el-table-column>
 | 
				
			||||||
 | 
					        <el-table-column label="操作" slot="options" align="center" width="210" fixed="right">
 | 
				
			||||||
 | 
					          <template v-slot="{ row }">
 | 
				
			||||||
 | 
					            <div class="table-options">
 | 
				
			||||||
 | 
					              <el-button type="text" title="编辑" @click="toAdd(row.id)">编辑</el-button>
 | 
				
			||||||
 | 
					              <el-button type="text" :title="row.status === '0' ? '上架' : '下架'" @click="changeStatus(row)">{{ row.status === '0' ? '上架' : '下架' }}</el-button>
 | 
				
			||||||
 | 
					              <el-button type="text" title="删除" @click="remove(row.id)">删除</el-button>
 | 
				
			||||||
 | 
					              <el-button type="text" title="复制链接" v-if="row.type === '1'" @click="copy(row.jdUrl)">复制链接</el-button>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					          </template>
 | 
				
			||||||
 | 
					        </el-table-column>
 | 
				
			||||||
 | 
					      </ai-table>
 | 
				
			||||||
 | 
					    </template>
 | 
				
			||||||
 | 
					  </ai-list>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					  export default {
 | 
				
			||||||
 | 
					    name: 'GoodsList',
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    props: {
 | 
				
			||||||
 | 
					      instance: Function,
 | 
				
			||||||
 | 
					      dict: Object,
 | 
				
			||||||
 | 
					      permissions: Function,
 | 
				
			||||||
 | 
					      areaId: String,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    data() {
 | 
				
			||||||
 | 
					      return {
 | 
				
			||||||
 | 
					        search: {
 | 
				
			||||||
 | 
					          type: '',
 | 
				
			||||||
 | 
					          title: '',
 | 
				
			||||||
 | 
					          current: 1,
 | 
				
			||||||
 | 
					          status: '',
 | 
				
			||||||
 | 
					          size: 10
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        total: 0,
 | 
				
			||||||
 | 
					        tableData: [],
 | 
				
			||||||
 | 
					        shopList: [],
 | 
				
			||||||
 | 
					        colConfigs: [
 | 
				
			||||||
 | 
					          { prop: 'serialNumber',  label: '商品ID', align: 'left' },
 | 
				
			||||||
 | 
					          { slot: 'goods', align: 'center' },
 | 
				
			||||||
 | 
					          { prop: 'type',  label: '商品类型', align: 'center', format: v => this.dict.getLabel('integralSGType', v) },
 | 
				
			||||||
 | 
					          { prop: 'onlineTime',  label: '上架时间', align: 'center' },
 | 
				
			||||||
 | 
					          { prop: 'createTime',  label: '申请时间', align: 'center' },
 | 
				
			||||||
 | 
					          { prop: 'status',  label: '状态', align: 'center', format: v => this.dict.getLabel('integralSGStatus', v) }
 | 
				
			||||||
 | 
					        ]
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    computed: {
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    created () {
 | 
				
			||||||
 | 
					      this.dict.load('integralSGType', 'integralSGStatus').then(() => {
 | 
				
			||||||
 | 
					        this.getList()
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    methods: {
 | 
				
			||||||
 | 
					      getList () {
 | 
				
			||||||
 | 
					        this.instance.post(`/app/appintegralsupermarketgoods/list`, null, {
 | 
				
			||||||
 | 
					          params: {
 | 
				
			||||||
 | 
					            ...this.search,
 | 
				
			||||||
 | 
					            areaId: this.areaId,
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        }).then((res) => {
 | 
				
			||||||
 | 
					          if (res.code == 0) {
 | 
				
			||||||
 | 
					            this.tableData = res.data.records
 | 
				
			||||||
 | 
					            this.total = res.data.total
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      toAdd (id) {
 | 
				
			||||||
 | 
					        this.$emit('change', {
 | 
				
			||||||
 | 
					          type: 'AddGoods',
 | 
				
			||||||
 | 
					          params: {
 | 
				
			||||||
 | 
					            id: id || ''
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      copy (url) {
 | 
				
			||||||
 | 
					        let oInput = document.createElement('input')
 | 
				
			||||||
 | 
					        oInput.value = url
 | 
				
			||||||
 | 
					        document.body.appendChild(oInput)
 | 
				
			||||||
 | 
					        oInput.select()
 | 
				
			||||||
 | 
					        document.execCommand('Copy')
 | 
				
			||||||
 | 
					        this.$message({
 | 
				
			||||||
 | 
					          message: '已复制',
 | 
				
			||||||
 | 
					          type: 'success'
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					        oInput.remove()
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      remove (id) {
 | 
				
			||||||
 | 
					        this.$confirm('确定删除该商品吗?').then(() => {
 | 
				
			||||||
 | 
					          this.instance.post(`/app/appintegralsupermarketgoods/delete?id=${id}`).then(res => {
 | 
				
			||||||
 | 
					            if (res.code == 0) {
 | 
				
			||||||
 | 
					              this.$message.success('删除成功!')
 | 
				
			||||||
 | 
					              this.getList()
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          })
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      changeStatus (row) {
 | 
				
			||||||
 | 
					        this.$confirm(`确定${row.status === '0' ? '上架' : '下架'}该商品?`).then(() => {
 | 
				
			||||||
 | 
					          this.instance.post(`/app/appintegralsupermarketgoods/online?id=${row.id}`).then(res => {
 | 
				
			||||||
 | 
					            if (res.code == 0) {
 | 
				
			||||||
 | 
					              this.$message.success(`${row.status === '0' ? '上架' : '下架'}成功`)
 | 
				
			||||||
 | 
					              this.getList()
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          })
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style lang="scss" scoped>
 | 
				
			||||||
 | 
					  .GoodsList {
 | 
				
			||||||
 | 
					    .goods {
 | 
				
			||||||
 | 
					      display: flex;
 | 
				
			||||||
 | 
					      align-items: center;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      p {
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
@@ -0,0 +1,151 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <ai-list isTabs class="order_management">
 | 
				
			||||||
 | 
					    <template slot="content">
 | 
				
			||||||
 | 
					      <ai-search-bar>
 | 
				
			||||||
 | 
					        <template slot="left">
 | 
				
			||||||
 | 
					          <ai-select
 | 
				
			||||||
 | 
					            v-model="search.type"
 | 
				
			||||||
 | 
					            @change="(search.current = 1), getList()"
 | 
				
			||||||
 | 
					            placeholder="请选择店铺类型"
 | 
				
			||||||
 | 
					            :selectList="dict.getDict('integralSSType')">
 | 
				
			||||||
 | 
					          </ai-select>
 | 
				
			||||||
 | 
					          <ai-select
 | 
				
			||||||
 | 
					            v-model="search.status"
 | 
				
			||||||
 | 
					            @change="(search.current = 1), getList()"
 | 
				
			||||||
 | 
					            placeholder="请选择类型"
 | 
				
			||||||
 | 
					            :selectList="dict.getDict('integralSGStatus')">
 | 
				
			||||||
 | 
					          </ai-select>
 | 
				
			||||||
 | 
					          <el-button type="primary" icon="iconfont iconAdd" @click="add()">添加</el-button>
 | 
				
			||||||
 | 
					        </template>
 | 
				
			||||||
 | 
					        <template slot="right">
 | 
				
			||||||
 | 
					          <el-input
 | 
				
			||||||
 | 
					            v-model="search.title"
 | 
				
			||||||
 | 
					            class="search-input"
 | 
				
			||||||
 | 
					            size="small"
 | 
				
			||||||
 | 
					            v-throttle="() => {search.current = 1, getList()}"
 | 
				
			||||||
 | 
					            placeholder="请输入店铺名称"
 | 
				
			||||||
 | 
					            clearable
 | 
				
			||||||
 | 
					            @clear="search.current = 1, search.title = '', getList()"
 | 
				
			||||||
 | 
					            suffix-icon="iconfont iconSearch">
 | 
				
			||||||
 | 
					          </el-input>
 | 
				
			||||||
 | 
					        </template>
 | 
				
			||||||
 | 
					      </ai-search-bar>
 | 
				
			||||||
 | 
					      <ai-table
 | 
				
			||||||
 | 
					        style="margin-top: 8px;"
 | 
				
			||||||
 | 
					        :tableData="tableData"
 | 
				
			||||||
 | 
					        :col-configs="colConfigs"
 | 
				
			||||||
 | 
					        :total="total"
 | 
				
			||||||
 | 
					        :current.sync="search.current"
 | 
				
			||||||
 | 
					        :size.sync="search.size"
 | 
				
			||||||
 | 
					        @getList="getList">
 | 
				
			||||||
 | 
					        <el-table-column label="操作" slot="options" align="center" width="160" fixed="right">
 | 
				
			||||||
 | 
					          <template v-slot="{ row }">
 | 
				
			||||||
 | 
					            <div class="table-options">
 | 
				
			||||||
 | 
					              <el-button type="text" title="编辑" @click="edit(row)">编辑</el-button>
 | 
				
			||||||
 | 
					              <el-button type="text" :title="row.status === '0' ? '上架' : '下架'" @click="changeStatus(row)">{{ row.status === '0' ? '上架' : '下架' }}</el-button>
 | 
				
			||||||
 | 
					              <el-button type="text" title="删除" @click="remove(row.id)">删除</el-button>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					          </template>
 | 
				
			||||||
 | 
					        </el-table-column>
 | 
				
			||||||
 | 
					      </ai-table>
 | 
				
			||||||
 | 
					    </template>
 | 
				
			||||||
 | 
					  </ai-list>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					  export default {
 | 
				
			||||||
 | 
					    name: 'GoodsList',
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    props: {
 | 
				
			||||||
 | 
					      instance: Function,
 | 
				
			||||||
 | 
					      dict: Object,
 | 
				
			||||||
 | 
					      permissions: Function,
 | 
				
			||||||
 | 
					      areaId: String,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    data() {
 | 
				
			||||||
 | 
					      return {
 | 
				
			||||||
 | 
					        search: {
 | 
				
			||||||
 | 
					          type: '',
 | 
				
			||||||
 | 
					          title: '',
 | 
				
			||||||
 | 
					          current: 1,
 | 
				
			||||||
 | 
					          status: '',
 | 
				
			||||||
 | 
					          size: 10
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        total: 0,
 | 
				
			||||||
 | 
					        tableData: [],
 | 
				
			||||||
 | 
					        shopList: [],
 | 
				
			||||||
 | 
					        colConfigs: [
 | 
				
			||||||
 | 
					          { prop: 'id',  label: '店铺ID', align: 'left' },
 | 
				
			||||||
 | 
					          { prop: 'title', label: '店铺名称', align: 'center' },
 | 
				
			||||||
 | 
					          { prop: 'type',  label: '店铺类型', align: 'center', format: v => this.dict.getLabel('integralSSType', v) },
 | 
				
			||||||
 | 
					          { prop: 'onlineTime',  label: '网格店铺服务网格', align: 'center' },
 | 
				
			||||||
 | 
					          { prop: 'createTime',  label: '居民店铺服务地区', align: 'center' },
 | 
				
			||||||
 | 
					          { prop: 'createTime',  label: '店铺商品数', align: 'center' },
 | 
				
			||||||
 | 
					          { prop: 'status',  label: '状态', align: 'center', format: v => this.dict.getLabel('integralSSStatus', v) }
 | 
				
			||||||
 | 
					        ]
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    computed: {
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    created () {
 | 
				
			||||||
 | 
					      this.dict.load('integralSSType', 'integralSSStatus', 'integralSSSType').then(() => {
 | 
				
			||||||
 | 
					        this.getList()
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    methods: {
 | 
				
			||||||
 | 
					      getList () {
 | 
				
			||||||
 | 
					        this.instance.post(`/app/appintegralsupermarketshop/list`, null, {
 | 
				
			||||||
 | 
					          params: {
 | 
				
			||||||
 | 
					            ...this.search,
 | 
				
			||||||
 | 
					            areaId: this.areaId,
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        }).then((res) => {
 | 
				
			||||||
 | 
					          if (res.code == 0) {
 | 
				
			||||||
 | 
					            this.tableData = res.data.records
 | 
				
			||||||
 | 
					            this.total = res.data.total
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      add (id) {
 | 
				
			||||||
 | 
					        this.$emit('change', {
 | 
				
			||||||
 | 
					          type: 'AddStore',
 | 
				
			||||||
 | 
					          params: {
 | 
				
			||||||
 | 
					            id: id || ''
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      remove (id) {
 | 
				
			||||||
 | 
					        this.$confirm('确定删除该商品吗?').then(() => {
 | 
				
			||||||
 | 
					          this.instance.post(`/app/appintegralsupermarketgoods/delete?id=${id}`).then(res => {
 | 
				
			||||||
 | 
					            if (res.code == 0) {
 | 
				
			||||||
 | 
					              this.$message.success('删除成功!')
 | 
				
			||||||
 | 
					              this.getList()
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          })
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      changeStatus (row) {
 | 
				
			||||||
 | 
					        this.$confirm(`确定${row.status === '0' ? '上架' : '下架'}该商品?`).then(() => {
 | 
				
			||||||
 | 
					          this.instance.post(`/app/appintegralsupermarketgoods/online?id=${id}`).then(res => {
 | 
				
			||||||
 | 
					            if (res.code == 0) {
 | 
				
			||||||
 | 
					              this.$message.success(`${row.status === '0' ? '上架' : '下架'}成功`)
 | 
				
			||||||
 | 
					              this.getList()
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          })
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style lang="scss" scoped>
 | 
				
			||||||
 | 
					  .order_management {
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
@@ -1,357 +1,221 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <section class="add_order">
 | 
					  <ai-detail class="appgoods">
 | 
				
			||||||
    <ai-detail>
 | 
					    <template slot="title">
 | 
				
			||||||
      <template slot="title">
 | 
					      <ai-title title="添加商品" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
 | 
				
			||||||
        <ai-title :title="title" isShowBack :isShowBottomBorder="true" @onBackClick="$emit('goBack')"></ai-title>
 | 
					      </ai-title>
 | 
				
			||||||
      </template>
 | 
					    </template>
 | 
				
			||||||
      <template slot="content" v-if="!isEdit">
 | 
					    <template slot="content">
 | 
				
			||||||
        <ai-card title="商品信息">
 | 
					      <ai-card title="基本信息">
 | 
				
			||||||
          <template #content>
 | 
					        <template #content>
 | 
				
			||||||
            <div class="form_div">
 | 
					          <el-form class="ai-form" :model="form" label-width="120px" ref="form">
 | 
				
			||||||
              <el-form
 | 
					            <el-form-item style="width: 100%" label="商品名称" prop="title" :rules="[{required: true, message: '请输入商品名称', trigger: 'blur'}]">
 | 
				
			||||||
                  ref="rules"
 | 
					              <el-input type="input" size="small" v-model="form.title" clearable placeholder="请输入商品名称" :maxlength="50" show-word-limit></el-input>
 | 
				
			||||||
                  :model="forms"
 | 
					            </el-form-item>
 | 
				
			||||||
                  :rules="formRules"
 | 
					            <el-form-item style="width: 100%" label="商品类型" prop="type" :rules="[{required: true, message: '请选择商品类型', trigger: 'change'}]">
 | 
				
			||||||
                  size="small"
 | 
					              <ai-select
 | 
				
			||||||
                  label-suffix=":"
 | 
					                v-model="form.type"
 | 
				
			||||||
                  label-width="100px">
 | 
					                placeholder="请选择商品类型"
 | 
				
			||||||
                <el-form-item label="店铺名称" prop="shopId">
 | 
					                :selectList="dict.getDict('integralSGType')">
 | 
				
			||||||
                  <el-select
 | 
					              </ai-select>
 | 
				
			||||||
                      v-model="forms.shopId"
 | 
					            </el-form-item>
 | 
				
			||||||
                      placeholder="请选择..."
 | 
					            <el-form-item  style="width: 100%" label="商品类型说明" prop="typeExplain"">
 | 
				
			||||||
                      clearable>
 | 
					              <el-input type="input" size="small" v-model="form.typeExplain" clearable placeholder="请输入商品类型说明" maxlength="50" show-word-limit></el-input>
 | 
				
			||||||
                    <el-option
 | 
					            </el-form-item>
 | 
				
			||||||
                        v-for="(item, i) in shopList"
 | 
					            <el-form-item style="width: 100%" label="商品图片" prop="picUrl" :rules="[{required: true, message: '请选择商品图片', trigger: 'change'}]">
 | 
				
			||||||
                        :key="i"
 | 
					              <ai-uploader
 | 
				
			||||||
                        :label="item.shopName"
 | 
					                :instance="instance"
 | 
				
			||||||
                        :value="item.id">
 | 
					                isShowTip
 | 
				
			||||||
                    </el-option>
 | 
					                isCrop
 | 
				
			||||||
                  </el-select>
 | 
					                :cropOps="{
 | 
				
			||||||
                </el-form-item>
 | 
					                  fixedNumber: [1, 1]
 | 
				
			||||||
                <el-form-item label="商品类型" prop="merchandiseType">
 | 
					                }"
 | 
				
			||||||
                  <el-select
 | 
					                v-model="form.picUrl"
 | 
				
			||||||
                      v-model="forms.merchandiseType"
 | 
					                :limit="1">
 | 
				
			||||||
                      placeholder="请选择..."
 | 
					                <template slot="tips">
 | 
				
			||||||
                      clearable>
 | 
					                  <p>建议尺寸:800*800,支持上传jpg/png格式图片,最多上传一张,单个图片大小不超过10M</p>
 | 
				
			||||||
                    <el-option
 | 
					                </template>
 | 
				
			||||||
                        v-for="(item, i) in dict.getDict('integralMerchandiseType')"
 | 
					              </ai-uploader>
 | 
				
			||||||
                        :key="i"
 | 
					            </el-form-item>
 | 
				
			||||||
                        :label="item.dictName"
 | 
					            <el-form-item label="零售价格" prop="retailPrice" :rules="[{required: true, message: '请输入零售价格', trigger: 'change'}]">
 | 
				
			||||||
                        :value="item.dictValue">
 | 
					              <el-input-number style="width: 200px;" size="small" type="input" v-model="form.retailPrice" clearable placeholder="请输入零售价格" :min="1"></el-input-number>
 | 
				
			||||||
                    </el-option>
 | 
					            </el-form-item>
 | 
				
			||||||
                  </el-select>
 | 
					            <el-form-item v-if="form.type === '1'" label="商品链接" prop="jdUrl" :rules="[{required: true, message: '请输入商品链接', trigger: 'blur'}]">
 | 
				
			||||||
                </el-form-item>
 | 
					              <el-input type="input" size="small" v-model="form.jdUrl" clearable placeholder="请输入商品链接"></el-input>
 | 
				
			||||||
                <el-form-item label="商品名称" prop="merchandiseName">
 | 
					            </el-form-item>
 | 
				
			||||||
                  <el-input
 | 
					            <el-form-item  style="width: 100%" label="商品描述" prop="description">
 | 
				
			||||||
                      v-model="forms.merchandiseName"
 | 
					              <el-input type="textarea" :rows="4" size="small" v-model="form.description" clearable placeholder="请输入商品描述"></el-input>
 | 
				
			||||||
                      placeholder="请输入..."
 | 
					            </el-form-item>
 | 
				
			||||||
                      maxlength="100"
 | 
					          </el-form>
 | 
				
			||||||
                      show-word-limit>
 | 
					        </template>
 | 
				
			||||||
                  </el-input>
 | 
					      </ai-card>
 | 
				
			||||||
                </el-form-item>
 | 
					    </template>
 | 
				
			||||||
                <div class="above">
 | 
					    <template #footer>
 | 
				
			||||||
                  <div class="left">
 | 
					      <el-button @click="cancel">取消</el-button>
 | 
				
			||||||
                    <el-form-item label="单价" prop="costIntegral">
 | 
					      <el-button type="primary" @click="confirm">提交</el-button>
 | 
				
			||||||
                      <el-input v-model="forms.costIntegral" placeholder="请输入..."/>
 | 
					    </template>
 | 
				
			||||||
                    </el-form-item>
 | 
					  </ai-detail>
 | 
				
			||||||
                  </div>
 | 
					 | 
				
			||||||
                  <div class="right">
 | 
					 | 
				
			||||||
                    <el-form-item label="库存" prop="inventoryNumber">
 | 
					 | 
				
			||||||
                      <el-input
 | 
					 | 
				
			||||||
                          v-model="forms.inventoryNumber"
 | 
					 | 
				
			||||||
                          placeholder="请输入...">
 | 
					 | 
				
			||||||
                      </el-input>
 | 
					 | 
				
			||||||
                    </el-form-item>
 | 
					 | 
				
			||||||
                  </div>
 | 
					 | 
				
			||||||
                </div>
 | 
					 | 
				
			||||||
                <el-form-item label="状态" prop="status">
 | 
					 | 
				
			||||||
                  <el-radio-group v-model="forms.status">
 | 
					 | 
				
			||||||
                    <el-radio label="1">上架中</el-radio>
 | 
					 | 
				
			||||||
                    <el-radio label="0">已下架</el-radio>
 | 
					 | 
				
			||||||
                  </el-radio-group>
 | 
					 | 
				
			||||||
                </el-form-item>
 | 
					 | 
				
			||||||
                <el-form-item label="商品图片" prop="fileList" ref="fileList">
 | 
					 | 
				
			||||||
                  <div class="upload">
 | 
					 | 
				
			||||||
                    <ai-uploader
 | 
					 | 
				
			||||||
                        :instance="instance"
 | 
					 | 
				
			||||||
                        @change="changeFile"
 | 
					 | 
				
			||||||
                        v-model="forms.fileList"
 | 
					 | 
				
			||||||
                        :limit="9">
 | 
					 | 
				
			||||||
                    </ai-uploader>
 | 
					 | 
				
			||||||
                  </div>
 | 
					 | 
				
			||||||
                </el-form-item>
 | 
					 | 
				
			||||||
                <el-form-item label="商品详情" prop="description">
 | 
					 | 
				
			||||||
                  <el-input
 | 
					 | 
				
			||||||
                      v-model="forms.description"
 | 
					 | 
				
			||||||
                      type="textarea"
 | 
					 | 
				
			||||||
                      :rows="5"
 | 
					 | 
				
			||||||
                      maxlength="100"
 | 
					 | 
				
			||||||
                      show-word-limit
 | 
					 | 
				
			||||||
                      placeholder="请输入...">
 | 
					 | 
				
			||||||
                  </el-input>
 | 
					 | 
				
			||||||
                </el-form-item>
 | 
					 | 
				
			||||||
              </el-form>
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
        </ai-card>
 | 
					 | 
				
			||||||
      </template>
 | 
					 | 
				
			||||||
      <template slot="content" v-if="isEdit">
 | 
					 | 
				
			||||||
        <ai-card title="商品信息">
 | 
					 | 
				
			||||||
          <template #content>
 | 
					 | 
				
			||||||
            <div class="info">
 | 
					 | 
				
			||||||
              <ai-wrapper label-width="70px" :columnsNumber="1">
 | 
					 | 
				
			||||||
                <ai-info-item label="店铺名称"><span>{{ forms.shopName }}</span></ai-info-item>
 | 
					 | 
				
			||||||
                <ai-info-item label="商品类型"
 | 
					 | 
				
			||||||
                ><span>{{
 | 
					 | 
				
			||||||
                    dict.getLabel("integralMerchandiseType", forms.merchandiseType)
 | 
					 | 
				
			||||||
                  }}</span></ai-info-item
 | 
					 | 
				
			||||||
                >
 | 
					 | 
				
			||||||
                <ai-info-item label="商品名称"
 | 
					 | 
				
			||||||
                ><span>{{ forms.merchandiseName }}</span></ai-info-item
 | 
					 | 
				
			||||||
                >
 | 
					 | 
				
			||||||
              </ai-wrapper>
 | 
					 | 
				
			||||||
              <ai-wrapper label-width="70px" :columnsNumber="2">
 | 
					 | 
				
			||||||
                <ai-info-item label="单价"><span>{{ forms.costIntegral + "积分" }}</span></ai-info-item>
 | 
					 | 
				
			||||||
                <ai-info-item label="库存"
 | 
					 | 
				
			||||||
                ><span>{{ forms.inventoryNumber }}</span></ai-info-item
 | 
					 | 
				
			||||||
                >
 | 
					 | 
				
			||||||
                <ai-info-item label="销量"
 | 
					 | 
				
			||||||
                ><span>{{ forms.saleNumber || "0" }}</span></ai-info-item
 | 
					 | 
				
			||||||
                >
 | 
					 | 
				
			||||||
              </ai-wrapper>
 | 
					 | 
				
			||||||
              <ai-wrapper label-width="70px" :columnsNumber="1">
 | 
					 | 
				
			||||||
                <ai-info-item label="状态"
 | 
					 | 
				
			||||||
                ><span
 | 
					 | 
				
			||||||
                    :style="{
 | 
					 | 
				
			||||||
                      color: dict.getColor(
 | 
					 | 
				
			||||||
                        'integralMerchandiseStatus',
 | 
					 | 
				
			||||||
                        forms.status
 | 
					 | 
				
			||||||
                      ),
 | 
					 | 
				
			||||||
                    }"
 | 
					 | 
				
			||||||
                >{{
 | 
					 | 
				
			||||||
                    dict.getLabel("integralMerchandiseStatus", forms.status)
 | 
					 | 
				
			||||||
                  }}</span
 | 
					 | 
				
			||||||
                ></ai-info-item
 | 
					 | 
				
			||||||
                >
 | 
					 | 
				
			||||||
                <ai-info-item label="商品图片">
 | 
					 | 
				
			||||||
                  <ai-uploader
 | 
					 | 
				
			||||||
                      :disabled="true"
 | 
					 | 
				
			||||||
                      :instance="instance"
 | 
					 | 
				
			||||||
                      v-model="forms.fileList"
 | 
					 | 
				
			||||||
                      :limit="9"
 | 
					 | 
				
			||||||
                  ></ai-uploader>
 | 
					 | 
				
			||||||
                </ai-info-item>
 | 
					 | 
				
			||||||
                <ai-info-item label="商品详情"
 | 
					 | 
				
			||||||
                ><span>{{ forms.description }}</span></ai-info-item
 | 
					 | 
				
			||||||
                >
 | 
					 | 
				
			||||||
              </ai-wrapper>
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
        </ai-card>
 | 
					 | 
				
			||||||
      </template>
 | 
					 | 
				
			||||||
      <template slot="footer" v-if="!isEdit">
 | 
					 | 
				
			||||||
        <el-button @click="$emit('goBack')" style="width: 120px">取消</el-button>
 | 
					 | 
				
			||||||
        <el-button type="primary" @click="save('rules')" style="width: 120px">提 交</el-button>
 | 
					 | 
				
			||||||
      </template>
 | 
					 | 
				
			||||||
    </ai-detail>
 | 
					 | 
				
			||||||
  </section>
 | 
					 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
import {mapState} from "vuex";
 | 
					  export default {
 | 
				
			||||||
 | 
					    name: 'Add',
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					    props: {
 | 
				
			||||||
  name: "addGoods",
 | 
					      instance: Function,
 | 
				
			||||||
  props: {
 | 
					      dict: Object,
 | 
				
			||||||
    instance: Function,
 | 
					      params: Object
 | 
				
			||||||
    dict: Object,
 | 
					    },
 | 
				
			||||||
    permissions: Function,
 | 
					
 | 
				
			||||||
    info: Object,
 | 
					    data () {
 | 
				
			||||||
    areaId: String,
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  data() {
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
      forms: {
 | 
					 | 
				
			||||||
        shopId: "",
 | 
					 | 
				
			||||||
        merchandiseType: "",
 | 
					 | 
				
			||||||
        merchandiseName: "",
 | 
					 | 
				
			||||||
        costIntegral: "",
 | 
					 | 
				
			||||||
        inventoryNumber: "",
 | 
					 | 
				
			||||||
        status: "",
 | 
					 | 
				
			||||||
        fileList: [],
 | 
					 | 
				
			||||||
        description: "",
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      shopList: [],
 | 
					 | 
				
			||||||
      title: "添加商品",
 | 
					 | 
				
			||||||
      showEdit: false,
 | 
					 | 
				
			||||||
      isEdit: false,
 | 
					 | 
				
			||||||
      detailInfo: {},
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  computed: {
 | 
					 | 
				
			||||||
    ...mapState(["user"]),
 | 
					 | 
				
			||||||
    formRules() {
 | 
					 | 
				
			||||||
      var integral = (rule, value, callback) => {
 | 
					 | 
				
			||||||
        if (value) {
 | 
					 | 
				
			||||||
          if (/^[1-9]\d*$/.test(value)) {
 | 
					 | 
				
			||||||
            callback();
 | 
					 | 
				
			||||||
          } else {
 | 
					 | 
				
			||||||
            callback(new Error("请输入正整数"));
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
          callback(new Error("请输入单价"));
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      };
 | 
					 | 
				
			||||||
      return {
 | 
					      return {
 | 
				
			||||||
        shopId: [{required: true, message: "请选择店铺", trigger: "change"}],
 | 
					        form: {
 | 
				
			||||||
        merchandiseType: [
 | 
					          typeExplain: '',
 | 
				
			||||||
          {required: true, message: "请选择商品类型", trigger: "change"},
 | 
					          title: '',
 | 
				
			||||||
        ],
 | 
					          description: '',
 | 
				
			||||||
        merchandiseName: [
 | 
					          jdUrl: '',
 | 
				
			||||||
          {required: true, message: "请输入商品名称", trigger: "blur"},
 | 
					          retailPrice: '',
 | 
				
			||||||
        ],
 | 
					          serialNumber: '',
 | 
				
			||||||
        inventoryNumber: [
 | 
					          picUrl: []
 | 
				
			||||||
          {required: true, validator: integral, trigger: "blur"},
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
        costIntegral: [
 | 
					 | 
				
			||||||
          {required: true, pattern: /^\d*[.\d]\d?$/, message: "请输入正数,最多保留一位小数", trigger: "blur"},
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
        status: [{required: true, message: "请选择状态", trigger: "change"}],
 | 
					 | 
				
			||||||
        fileList: [
 | 
					 | 
				
			||||||
          {required: true, message: "请上传商品图片", trigger: "change"},
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
      };
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  created() {
 | 
					 | 
				
			||||||
    let l = Object.keys(this.info).length;
 | 
					 | 
				
			||||||
    if (this.info.isAdd) {
 | 
					 | 
				
			||||||
      this.showEdit = false;
 | 
					 | 
				
			||||||
      if (l > 1) {
 | 
					 | 
				
			||||||
        this.title = "修改商品";
 | 
					 | 
				
			||||||
        this.getShopList().then(() => {
 | 
					 | 
				
			||||||
          this.searchDetail(this.info.id);
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      } else {
 | 
					 | 
				
			||||||
        this.title = "添加商品";
 | 
					 | 
				
			||||||
        this.getShopList();
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
      this.title = "商品详情";
 | 
					 | 
				
			||||||
      this.isEdit = true;
 | 
					 | 
				
			||||||
      this.showEdit = true;
 | 
					 | 
				
			||||||
      this.getShopList().then(() => {
 | 
					 | 
				
			||||||
        this.searchDetail(this.info.id);
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  methods: {
 | 
					 | 
				
			||||||
    getShopList() {
 | 
					 | 
				
			||||||
      return new Promise((reslove) => {
 | 
					 | 
				
			||||||
        this.instance
 | 
					 | 
				
			||||||
        .post(`/app/appvillagerintegralshop/listForOperator`, null, {
 | 
					 | 
				
			||||||
          params: {
 | 
					 | 
				
			||||||
            size: 100000,
 | 
					 | 
				
			||||||
            areaId: this.areaId,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        .then((res) => {
 | 
					 | 
				
			||||||
          if (res.code == 0) {
 | 
					 | 
				
			||||||
            this.shopList = res.data.records;
 | 
					 | 
				
			||||||
            reslove();
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    changeFile() {
 | 
					 | 
				
			||||||
      this.$refs.fileList.$emit("el.form.change");
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    searchDetail(id) {
 | 
					 | 
				
			||||||
      this.instance
 | 
					 | 
				
			||||||
      .post(`/app/appvillagerintegralmerchandise/queryDetailById`, null, {
 | 
					 | 
				
			||||||
        params: {
 | 
					 | 
				
			||||||
          id,
 | 
					 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
      })
 | 
					        girdList: [],
 | 
				
			||||||
      .then((res) => {
 | 
					        cropOps: {
 | 
				
			||||||
        if (res.code == 0) {
 | 
					          width: '800px',
 | 
				
			||||||
          this.forms = {...res.data};
 | 
					          height: '800px'
 | 
				
			||||||
          let i = this.shopList.findIndex(
 | 
					        },
 | 
				
			||||||
              (item) => item.id == this.forms.shopId
 | 
					        id: ''
 | 
				
			||||||
          );
 | 
					      }
 | 
				
			||||||
          if (i > -1) {
 | 
					    },
 | 
				
			||||||
            this.forms.shopName = this.shopList[i].shopName;
 | 
					
 | 
				
			||||||
 | 
					    created () {
 | 
				
			||||||
 | 
					      if (this.params && this.params.id) {
 | 
				
			||||||
 | 
					        this.id = this.params.id
 | 
				
			||||||
 | 
					        this.getInfo(this.params.id)
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    methods: {
 | 
				
			||||||
 | 
					      getInfo (id) {
 | 
				
			||||||
 | 
					        this.instance.post(`/app/appintegralsupermarketgoods/queryDetailById?id=${id}`).then(res => {
 | 
				
			||||||
 | 
					          if (res.code === 0) {
 | 
				
			||||||
 | 
					            this.form = res.data
 | 
				
			||||||
 | 
					            this.form.picUrl = [{
 | 
				
			||||||
 | 
					              url: res.data.picUrl
 | 
				
			||||||
 | 
					            }]
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        })
 | 
				
			||||||
      });
 | 
					      },
 | 
				
			||||||
    },
 | 
					
 | 
				
			||||||
    edit() {
 | 
					      confirm () {
 | 
				
			||||||
      this.isEdit = false;
 | 
					        this.$refs.form.validate((valid) => {
 | 
				
			||||||
    },
 | 
					          if (valid) {
 | 
				
			||||||
    save(formName, type) {
 | 
					            this.instance.post(`/app/appintegralsupermarketgoods/addOrUpdate`, {
 | 
				
			||||||
      this.$refs[formName].validate((valid) => {
 | 
					              ...this.form,
 | 
				
			||||||
        if (valid) {
 | 
					              picUrl: this.form.picUrl[0].url,
 | 
				
			||||||
          this.instance
 | 
					              id: this.params.id || ''
 | 
				
			||||||
          .post(
 | 
					            }).then(res => {
 | 
				
			||||||
              `/app/appvillagerintegralmerchandise/addOrUpdate`,
 | 
					              if (res.code == 0) {
 | 
				
			||||||
              {
 | 
					                this.$message.success('提交成功')
 | 
				
			||||||
                ...this.forms,
 | 
					                setTimeout(() => {
 | 
				
			||||||
                areaId: this.user.info.areaId,
 | 
					                  this.cancel(true)
 | 
				
			||||||
              },
 | 
					                }, 600)
 | 
				
			||||||
              null
 | 
					 | 
				
			||||||
          )
 | 
					 | 
				
			||||||
          .then((res) => {
 | 
					 | 
				
			||||||
            if (res.code == 0) {
 | 
					 | 
				
			||||||
              this.$message.success("提交成功");
 | 
					 | 
				
			||||||
              if (type == "detail") {
 | 
					 | 
				
			||||||
                this.isEdit = true;
 | 
					 | 
				
			||||||
              } else {
 | 
					 | 
				
			||||||
                this.$emit("goBack");
 | 
					 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            }
 | 
					            })
 | 
				
			||||||
          });
 | 
					          }
 | 
				
			||||||
        } else {
 | 
					        })
 | 
				
			||||||
          return false;
 | 
					      },
 | 
				
			||||||
        }
 | 
					
 | 
				
			||||||
      });
 | 
					      cancel (isRefresh) {
 | 
				
			||||||
    },
 | 
					        this.$emit('change', {
 | 
				
			||||||
  },
 | 
					          type: 'GoodsList',
 | 
				
			||||||
};
 | 
					          isRefresh: !!isRefresh
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<style lang="scss" scoped>
 | 
					<style scoped lang="scss">
 | 
				
			||||||
.add_order {
 | 
					  .appgoods {
 | 
				
			||||||
  height: 100%;
 | 
					    .AppAnnounceDetail-select {
 | 
				
			||||||
 | 
					      display: flex;
 | 
				
			||||||
 | 
					      align-items: center;
 | 
				
			||||||
 | 
					      min-height: 32px;
 | 
				
			||||||
 | 
					      line-height: 1;
 | 
				
			||||||
 | 
					      background: #F5F5F5;
 | 
				
			||||||
 | 
					      border-radius: 4px;
 | 
				
			||||||
 | 
					      border: 1px solid #D0D4DC;
 | 
				
			||||||
 | 
					      cursor: pointer;
 | 
				
			||||||
 | 
					      overflow: hidden;
 | 
				
			||||||
 | 
					      transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .form_div {
 | 
					      &:hover {
 | 
				
			||||||
    padding: 16px 0;
 | 
					        border-color: #26f;
 | 
				
			||||||
  }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .above {
 | 
					      & > i {
 | 
				
			||||||
    overflow: hidden;
 | 
					        flex: 1;
 | 
				
			||||||
    width: 100%;
 | 
					        height: 100%;
 | 
				
			||||||
 | 
					        line-height: 32px;
 | 
				
			||||||
 | 
					        padding: 0 12px;
 | 
				
			||||||
 | 
					        color: #888888;
 | 
				
			||||||
 | 
					        font-size: 14px;
 | 
				
			||||||
 | 
					        font-style: normal;
 | 
				
			||||||
 | 
					        border-right: 1px solid #D0D4DC;
 | 
				
			||||||
 | 
					        background: #fff;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .left {
 | 
					      .AppAnnounceDetail-select__input {
 | 
				
			||||||
      width: 50%;
 | 
					        position: absolute;
 | 
				
			||||||
      float: left;
 | 
					        left: 0;
 | 
				
			||||||
    }
 | 
					        top: 0;
 | 
				
			||||||
 | 
					        z-index: -1;
 | 
				
			||||||
 | 
					        opacity: 0;
 | 
				
			||||||
 | 
					        height: 100%;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .right {
 | 
					      .select-right {
 | 
				
			||||||
      width: 50%;
 | 
					        height: 100%;
 | 
				
			||||||
      float: right;
 | 
					        padding: 0 12px;
 | 
				
			||||||
 | 
					        color: #222222;
 | 
				
			||||||
 | 
					        font-size: 12px;
 | 
				
			||||||
 | 
					        cursor: pointer;
 | 
				
			||||||
 | 
					        transition: all ease 0.3s;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        &:hover {
 | 
				
			||||||
 | 
					          opacity: 0.5;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      .select-left {
 | 
				
			||||||
 | 
					        display: flex;
 | 
				
			||||||
 | 
					        flex-wrap: wrap;
 | 
				
			||||||
 | 
					        flex: 1;
 | 
				
			||||||
 | 
					        padding: 5px 0 0px 12px;
 | 
				
			||||||
 | 
					        border-right: 1px solid #D0D4DC;
 | 
				
			||||||
 | 
					        border-radius: 4px 0 0 4px;
 | 
				
			||||||
 | 
					        background: #fff;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        em {
 | 
				
			||||||
 | 
					          height: 22px;
 | 
				
			||||||
 | 
					          line-height: 22px;
 | 
				
			||||||
 | 
					          margin: 0 4px 5px 0;
 | 
				
			||||||
 | 
					          color: #222222;
 | 
				
			||||||
 | 
					          font-size: 12px;
 | 
				
			||||||
 | 
					          font-style: normal;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        span {
 | 
				
			||||||
 | 
					          height: 22px;
 | 
				
			||||||
 | 
					          line-height: 22px;
 | 
				
			||||||
 | 
					          margin: 0 4px 5px 0;
 | 
				
			||||||
 | 
					          padding: 0 8px;
 | 
				
			||||||
 | 
					          font-size: 12px;
 | 
				
			||||||
 | 
					          color: #222222;
 | 
				
			||||||
 | 
					          background: #F3F4F7;
 | 
				
			||||||
 | 
					          border-radius: 2px;
 | 
				
			||||||
 | 
					          border: 1px solid #D0D4DC;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  .iconEdit,
 | 
					 | 
				
			||||||
  .Edit {
 | 
					 | 
				
			||||||
    color: #5088ff;
 | 
					 | 
				
			||||||
    font-size: 12px;
 | 
					 | 
				
			||||||
    cursor: pointer;
 | 
					 | 
				
			||||||
    padding-left: 8px;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .info {
 | 
					 | 
				
			||||||
    padding: 16px 0;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
</style>
 | 
					</style>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,625 +0,0 @@
 | 
				
			|||||||
<template>
 | 
					 | 
				
			||||||
  <section class="add_order">
 | 
					 | 
				
			||||||
    <ai-detail>
 | 
					 | 
				
			||||||
      <template slot="title">
 | 
					 | 
				
			||||||
        <ai-title :title="title" :isShowBack="true" :isShowBottomBorder="true" @onBackClick="$emit('goBack')"></ai-title>
 | 
					 | 
				
			||||||
      </template>
 | 
					 | 
				
			||||||
      <template slot="content" v-if="info.isAdd">
 | 
					 | 
				
			||||||
        <ai-card title="订单信息">
 | 
					 | 
				
			||||||
          <template #content>
 | 
					 | 
				
			||||||
            <div class="form_div">
 | 
					 | 
				
			||||||
              <el-form
 | 
					 | 
				
			||||||
                  ref="rules"
 | 
					 | 
				
			||||||
                  :model="forms"
 | 
					 | 
				
			||||||
                  :rules="formRules"
 | 
					 | 
				
			||||||
                  size="small"
 | 
					 | 
				
			||||||
                  label-suffix=":"
 | 
					 | 
				
			||||||
                  label-width="100px">
 | 
					 | 
				
			||||||
                <el-form-item label="店铺名称" prop="shopId">
 | 
					 | 
				
			||||||
                  <el-select
 | 
					 | 
				
			||||||
                      v-model="forms.shopId"
 | 
					 | 
				
			||||||
                      placeholder="请选择..."
 | 
					 | 
				
			||||||
                      @change="(forms.merchandiseList = []), (goodIntegral = {})"
 | 
					 | 
				
			||||||
                      clearable>
 | 
					 | 
				
			||||||
                    <el-option
 | 
					 | 
				
			||||||
                        v-for="(item, i) in shopList"
 | 
					 | 
				
			||||||
                        :key="i"
 | 
					 | 
				
			||||||
                        :label="item.shopName"
 | 
					 | 
				
			||||||
                        :value="item.id">
 | 
					 | 
				
			||||||
                    </el-option>
 | 
					 | 
				
			||||||
                  </el-select>
 | 
					 | 
				
			||||||
                </el-form-item>
 | 
					 | 
				
			||||||
                <el-form-item label="兑换家庭" prop="name">
 | 
					 | 
				
			||||||
                  <el-row type="flex" :gutter="8">
 | 
					 | 
				
			||||||
                    <el-col
 | 
					 | 
				
			||||||
                    >
 | 
					 | 
				
			||||||
                      <el-input v-model="forms.name" disabled clearable
 | 
					 | 
				
			||||||
                      />
 | 
					 | 
				
			||||||
                    </el-col>
 | 
					 | 
				
			||||||
                    <el-col>
 | 
					 | 
				
			||||||
                      <ai-person-select
 | 
					 | 
				
			||||||
                          :instance="instance"
 | 
					 | 
				
			||||||
                          url="/app/appvillagerintegralfamilymember/list"
 | 
					 | 
				
			||||||
                          headerTitle="家庭列表"
 | 
					 | 
				
			||||||
                          dialogTitle="选择家庭"
 | 
					 | 
				
			||||||
                          @selectPerson="getSelect"
 | 
					 | 
				
			||||||
                      >
 | 
					 | 
				
			||||||
                        <template name="option" v-slot:option="{ item }">
 | 
					 | 
				
			||||||
                          <span class="iconfont iconProlife">{{ item.name }}</span>
 | 
					 | 
				
			||||||
                          <ai-id
 | 
					 | 
				
			||||||
                              mode="show"
 | 
					 | 
				
			||||||
                              :show-eyes="false"
 | 
					 | 
				
			||||||
                              :value="item.idNumber"
 | 
					 | 
				
			||||||
                          />
 | 
					 | 
				
			||||||
                          <span>{{ item.phone }}</span>
 | 
					 | 
				
			||||||
                        </template>
 | 
					 | 
				
			||||||
                      </ai-person-select>
 | 
					 | 
				
			||||||
                    </el-col>
 | 
					 | 
				
			||||||
                  </el-row>
 | 
					 | 
				
			||||||
                </el-form-item>
 | 
					 | 
				
			||||||
                <el-form-item label="积分余额">
 | 
					 | 
				
			||||||
                  <p>
 | 
					 | 
				
			||||||
                    <span style="color: #2266ff">{{ integral || "0" }}</span
 | 
					 | 
				
			||||||
                    >分
 | 
					 | 
				
			||||||
                  </p>
 | 
					 | 
				
			||||||
                </el-form-item>
 | 
					 | 
				
			||||||
                <el-form-item label="兑换商品" prop="merchandiseList">
 | 
					 | 
				
			||||||
                  <el-button @click="showGoodsList()" :disabled="!forms.shopId || !forms.name">选择商品</el-button>
 | 
					 | 
				
			||||||
                </el-form-item>
 | 
					 | 
				
			||||||
                <ai-table
 | 
					 | 
				
			||||||
                    :tableData="forms.merchandiseList"
 | 
					 | 
				
			||||||
                    :col-configs="colConfigs"
 | 
					 | 
				
			||||||
                    :isShowPagination="false">
 | 
					 | 
				
			||||||
                  <el-table-column
 | 
					 | 
				
			||||||
                      label="商品图"
 | 
					 | 
				
			||||||
                      slot="photo"
 | 
					 | 
				
			||||||
                      align="center"
 | 
					 | 
				
			||||||
                      width="150">
 | 
					 | 
				
			||||||
                    <template v-slot="{ row }">
 | 
					 | 
				
			||||||
                      <ai-uploader
 | 
					 | 
				
			||||||
                          :disabled="true"
 | 
					 | 
				
			||||||
                          :instance="instance"
 | 
					 | 
				
			||||||
                          v-model="row.photo"
 | 
					 | 
				
			||||||
                          :limit="9">
 | 
					 | 
				
			||||||
                      </ai-uploader>
 | 
					 | 
				
			||||||
                    </template>
 | 
					 | 
				
			||||||
                  </el-table-column>
 | 
					 | 
				
			||||||
                  <el-table-column
 | 
					 | 
				
			||||||
                      label="兑换数量"
 | 
					 | 
				
			||||||
                      width="180"
 | 
					 | 
				
			||||||
                      slot="merchandiseNumber"
 | 
					 | 
				
			||||||
                      align="center">
 | 
					 | 
				
			||||||
                    <template v-slot="{ row }">
 | 
					 | 
				
			||||||
                      <el-input-number
 | 
					 | 
				
			||||||
                          :min="1"
 | 
					 | 
				
			||||||
                          :max="row.inventoryNumber"
 | 
					 | 
				
			||||||
                          size="mini"
 | 
					 | 
				
			||||||
                          v-model="merchandiseNumbers[row.id]"
 | 
					 | 
				
			||||||
                          @change="
 | 
					 | 
				
			||||||
                          (currentValue, oldValue) =>
 | 
					 | 
				
			||||||
                            changeNumber(currentValue, oldValue, row)
 | 
					 | 
				
			||||||
                        "
 | 
					 | 
				
			||||||
                          :step="1"
 | 
					 | 
				
			||||||
                          step-strictly
 | 
					 | 
				
			||||||
                      ></el-input-number>
 | 
					 | 
				
			||||||
                    </template>
 | 
					 | 
				
			||||||
                  </el-table-column>
 | 
					 | 
				
			||||||
                  <el-table-column label="消耗积分" slot="integral" align="center">
 | 
					 | 
				
			||||||
                    <template v-slot="{ row }">
 | 
					 | 
				
			||||||
                      <span>{{ goodIntegral[row.id] }}</span>
 | 
					 | 
				
			||||||
                    </template>
 | 
					 | 
				
			||||||
                  </el-table-column>
 | 
					 | 
				
			||||||
                  <el-table-column
 | 
					 | 
				
			||||||
                      slot="options"
 | 
					 | 
				
			||||||
                      label="操作"
 | 
					 | 
				
			||||||
                      align="center"
 | 
					 | 
				
			||||||
                      width="60"
 | 
					 | 
				
			||||||
                  >
 | 
					 | 
				
			||||||
                    <template slot-scope="row">
 | 
					 | 
				
			||||||
                      <el-button
 | 
					 | 
				
			||||||
                          type="text"
 | 
					 | 
				
			||||||
                          class="icon-color89B"
 | 
					 | 
				
			||||||
                          icon="iconfont iconDelete"
 | 
					 | 
				
			||||||
                          title="删除"
 | 
					 | 
				
			||||||
                          @click="deleteGood(row)"
 | 
					 | 
				
			||||||
                      />
 | 
					 | 
				
			||||||
                    </template>
 | 
					 | 
				
			||||||
                  </el-table-column>
 | 
					 | 
				
			||||||
                </ai-table>
 | 
					 | 
				
			||||||
                <div class="total">
 | 
					 | 
				
			||||||
                  <p class="num">
 | 
					 | 
				
			||||||
                    <span>合计积分:</span>
 | 
					 | 
				
			||||||
                    <span>{{ allIntegral }}</span>
 | 
					 | 
				
			||||||
                    <span>分</span>
 | 
					 | 
				
			||||||
                  </p>
 | 
					 | 
				
			||||||
                  <p class="tip" v-if="allIntegral > Number(integral)">
 | 
					 | 
				
			||||||
                    (积分不足,请删减商品)
 | 
					 | 
				
			||||||
                  </p>
 | 
					 | 
				
			||||||
                </div>
 | 
					 | 
				
			||||||
              </el-form>
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
        </ai-card>
 | 
					 | 
				
			||||||
      </template>
 | 
					 | 
				
			||||||
      <template slot="content" v-if="!info.isAdd">
 | 
					 | 
				
			||||||
        <ai-card title="订单信息">
 | 
					 | 
				
			||||||
          <template #content>
 | 
					 | 
				
			||||||
            <div class="info">
 | 
					 | 
				
			||||||
              <ai-wrapper label-width="70px" :columnsNumber="1">
 | 
					 | 
				
			||||||
                <ai-info-item label="订单号"><span>{{ detailInfo.orderCode }}</span></ai-info-item>
 | 
					 | 
				
			||||||
                <ai-info-item label="创建时间"><span>{{ detailInfo.createTime }}</span></ai-info-item>
 | 
					 | 
				
			||||||
                <ai-info-item label="店铺名"><span>{{ detailInfo.shopName }}</span></ai-info-item>
 | 
					 | 
				
			||||||
                <ai-info-item label="状态">
 | 
					 | 
				
			||||||
                  <span :style="{ color: dict.getColor('integralOrderStatus', detailInfo.orderStatus)}">
 | 
					 | 
				
			||||||
                    {{ dict.getLabel("integralOrderStatus", detailInfo.orderStatus) }}
 | 
					 | 
				
			||||||
                  </span>
 | 
					 | 
				
			||||||
                </ai-info-item>
 | 
					 | 
				
			||||||
              </ai-wrapper>
 | 
					 | 
				
			||||||
              <ai-table
 | 
					 | 
				
			||||||
                  :tableData="detailInfo.merchandiseList"
 | 
					 | 
				
			||||||
                  :col-configs="colConfigs"
 | 
					 | 
				
			||||||
                  :isShowPagination="false">
 | 
					 | 
				
			||||||
                <el-table-column
 | 
					 | 
				
			||||||
                    label="商品图"
 | 
					 | 
				
			||||||
                    slot="photo"
 | 
					 | 
				
			||||||
                    align="center"
 | 
					 | 
				
			||||||
                    width="150">
 | 
					 | 
				
			||||||
                  <template v-slot="{ row }">
 | 
					 | 
				
			||||||
                    <ai-uploader
 | 
					 | 
				
			||||||
                        :disabled="true"
 | 
					 | 
				
			||||||
                        :instance="instance"
 | 
					 | 
				
			||||||
                        v-model="row.merchandisePhoto"
 | 
					 | 
				
			||||||
                        :limit="9">
 | 
					 | 
				
			||||||
                    </ai-uploader>
 | 
					 | 
				
			||||||
                  </template>
 | 
					 | 
				
			||||||
                </el-table-column>
 | 
					 | 
				
			||||||
                <el-table-column
 | 
					 | 
				
			||||||
                    label="兑换数量"
 | 
					 | 
				
			||||||
                    width="200"
 | 
					 | 
				
			||||||
                    slot="merchandiseNumber"
 | 
					 | 
				
			||||||
                    align="center">
 | 
					 | 
				
			||||||
                  <template v-slot="{ row }">
 | 
					 | 
				
			||||||
                    {{ row.merchandiseNumber }}
 | 
					 | 
				
			||||||
                  </template>
 | 
					 | 
				
			||||||
                </el-table-column>
 | 
					 | 
				
			||||||
                <el-table-column label="消耗积分" slot="integral" align="center">
 | 
					 | 
				
			||||||
                  <template v-slot="{ row }">
 | 
					 | 
				
			||||||
                    <span>{{ Number(row.merchandiseNumber) * Number(row.costIntegral) }}</span>
 | 
					 | 
				
			||||||
                  </template>
 | 
					 | 
				
			||||||
                </el-table-column>
 | 
					 | 
				
			||||||
              </ai-table>
 | 
					 | 
				
			||||||
              <div class="total">
 | 
					 | 
				
			||||||
                <p class="num">
 | 
					 | 
				
			||||||
                  <span>合计积分:</span>
 | 
					 | 
				
			||||||
                  <span>{{ detailInfo.orderIntegral }}</span>
 | 
					 | 
				
			||||||
                  <span>分</span>
 | 
					 | 
				
			||||||
                </p>
 | 
					 | 
				
			||||||
              </div>
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
        </ai-card>
 | 
					 | 
				
			||||||
        <ai-card title="兑换家庭信息">
 | 
					 | 
				
			||||||
          <template #content>
 | 
					 | 
				
			||||||
            <div class="info">
 | 
					 | 
				
			||||||
              <ai-wrapper label-width="70px" :columnsNumber="2">
 | 
					 | 
				
			||||||
                <ai-info-item label="户主"><span>{{ detailInfo.familyName }}</span></ai-info-item>
 | 
					 | 
				
			||||||
                <ai-info-item label="联系方式"><span>{{ detailInfo.familyPhone || "-" }}</span></ai-info-item>
 | 
					 | 
				
			||||||
              </ai-wrapper>
 | 
					 | 
				
			||||||
              <ai-wrapper label-width="70px" :columnsNumber="1">
 | 
					 | 
				
			||||||
                <ai-info-item label="备注"><span>{{ detailInfo.remark || "-" }}</span></ai-info-item>
 | 
					 | 
				
			||||||
              </ai-wrapper>
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
        </ai-card>
 | 
					 | 
				
			||||||
        <ai-card title="操作人信息">
 | 
					 | 
				
			||||||
          <template #content>
 | 
					 | 
				
			||||||
            <div class="info">
 | 
					 | 
				
			||||||
              <ai-wrapper label-width="70px">
 | 
					 | 
				
			||||||
                <ai-info-item label="操作人"><span>{{ detailInfo.createUserName || "-" }}</span></ai-info-item>
 | 
					 | 
				
			||||||
                <ai-info-item label="联系方式"><span>{{ detailInfo.createUserPhone || "-" }}</span></ai-info-item>
 | 
					 | 
				
			||||||
                <ai-info-item label="完成时间"><span>{{ detailInfo.finishTime || "-" }}</span></ai-info-item>
 | 
					 | 
				
			||||||
              </ai-wrapper>
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
        </ai-card>
 | 
					 | 
				
			||||||
      </template>
 | 
					 | 
				
			||||||
      <template slot="footer" v-if="info.isAdd">
 | 
					 | 
				
			||||||
        <el-button @click="$emit('goBack')" style="width: 120px">取消</el-button>
 | 
					 | 
				
			||||||
        <el-button type="primary" @click="save('rules')" style="width: 120px" :disabled="allIntegral > Number(integral)">确认兑换</el-button>
 | 
					 | 
				
			||||||
      </template>
 | 
					 | 
				
			||||||
    </ai-detail>
 | 
					 | 
				
			||||||
    <ai-dialog
 | 
					 | 
				
			||||||
        title="选择商品"
 | 
					 | 
				
			||||||
        :visible.sync="showGoods"
 | 
					 | 
				
			||||||
        :customFooter="true"
 | 
					 | 
				
			||||||
        :destroyOnClose="true"
 | 
					 | 
				
			||||||
        class="goods"
 | 
					 | 
				
			||||||
        @close="init"
 | 
					 | 
				
			||||||
        border
 | 
					 | 
				
			||||||
        width="780px">
 | 
					 | 
				
			||||||
      <div class="border_div">
 | 
					 | 
				
			||||||
        <header>
 | 
					 | 
				
			||||||
          <span>商品列表</span>
 | 
					 | 
				
			||||||
          <el-input
 | 
					 | 
				
			||||||
              v-model="keyWord"
 | 
					 | 
				
			||||||
              size="mini"
 | 
					 | 
				
			||||||
              placeholder="商品关键字"
 | 
					 | 
				
			||||||
              @keyup.enter.native="showGoodsList()"
 | 
					 | 
				
			||||||
              clearable
 | 
					 | 
				
			||||||
              style="width: 220px"
 | 
					 | 
				
			||||||
              suffix-icon="iconfont iconSearch"
 | 
					 | 
				
			||||||
          />
 | 
					 | 
				
			||||||
        </header>
 | 
					 | 
				
			||||||
        <ai-table
 | 
					 | 
				
			||||||
            :tableData="goodList"
 | 
					 | 
				
			||||||
            :col-configs="goodsConfig"
 | 
					 | 
				
			||||||
            :isShowPagination="false"
 | 
					 | 
				
			||||||
            @selection-change="handleSelectionChange"
 | 
					 | 
				
			||||||
        >
 | 
					 | 
				
			||||||
          <el-table-column slot="selection" type="selection" width="55" :selectable="(row)=>Number(row.inventoryNumber)>0"/>
 | 
					 | 
				
			||||||
        </ai-table>
 | 
					 | 
				
			||||||
      </div>
 | 
					 | 
				
			||||||
      <div class="dialog-footer" slot="footer">
 | 
					 | 
				
			||||||
        <el-button @click="showGoods = false" size="medium">取消</el-button>
 | 
					 | 
				
			||||||
        <el-button @click="onConfirm()" type="primary" size="medium">确认</el-button>
 | 
					 | 
				
			||||||
      </div>
 | 
					 | 
				
			||||||
    </ai-dialog>
 | 
					 | 
				
			||||||
  </section>
 | 
					 | 
				
			||||||
</template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<script>
 | 
					 | 
				
			||||||
import {mapState} from "vuex";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export default {
 | 
					 | 
				
			||||||
  name: "addOrder",
 | 
					 | 
				
			||||||
  props: {
 | 
					 | 
				
			||||||
    instance: Function,
 | 
					 | 
				
			||||||
    dict: Object,
 | 
					 | 
				
			||||||
    permissions: Function,
 | 
					 | 
				
			||||||
    info: Object,
 | 
					 | 
				
			||||||
    areaId: String,
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  data() {
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
      forms: {
 | 
					 | 
				
			||||||
        shopId: "",
 | 
					 | 
				
			||||||
        familyId: "",
 | 
					 | 
				
			||||||
        familyName: "",
 | 
					 | 
				
			||||||
        name: "",
 | 
					 | 
				
			||||||
        memberId: "",
 | 
					 | 
				
			||||||
        merchandiseList: [],
 | 
					 | 
				
			||||||
        phone: "",
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      integral: "",
 | 
					 | 
				
			||||||
      shopList: [],
 | 
					 | 
				
			||||||
      goodList: [],
 | 
					 | 
				
			||||||
      goodIntegral: {},
 | 
					 | 
				
			||||||
      merchandiseNumbers: {},
 | 
					 | 
				
			||||||
      showGoods: false,
 | 
					 | 
				
			||||||
      selectGoodList: [],
 | 
					 | 
				
			||||||
      keyWord: "",
 | 
					 | 
				
			||||||
      title: "",
 | 
					 | 
				
			||||||
      detailInfo: {},
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  computed: {
 | 
					 | 
				
			||||||
    ...mapState(["user"]),
 | 
					 | 
				
			||||||
    formRules() {
 | 
					 | 
				
			||||||
      return {
 | 
					 | 
				
			||||||
        shopId: [{required: true, message: "请选择店铺", trigger: "change"}],
 | 
					 | 
				
			||||||
        name: [
 | 
					 | 
				
			||||||
          {required: true, message: "请选择兑换家庭", trigger: "change"},
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
        merchandiseList: [
 | 
					 | 
				
			||||||
          {required: true, message: "请选择商品", trigger: "change"},
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
      };
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    colConfigs() {
 | 
					 | 
				
			||||||
      return [
 | 
					 | 
				
			||||||
        {slot: "photo", prop: "photo", label: "商品图", align: "center"},
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "merchandiseName",
 | 
					 | 
				
			||||||
          label: "商品名",
 | 
					 | 
				
			||||||
          align: "left",
 | 
					 | 
				
			||||||
          width: 160,
 | 
					 | 
				
			||||||
          "show-overflow-tooltip": false,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "costIntegral",
 | 
					 | 
				
			||||||
          label: "单价",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          width: 60,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          slot: "merchandiseNumber",
 | 
					 | 
				
			||||||
          prop: "merchandiseNumber",
 | 
					 | 
				
			||||||
          label: "兑换数量",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "inventoryNumber",
 | 
					 | 
				
			||||||
          label: "库存",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          width: 60,
 | 
					 | 
				
			||||||
          hide: this.title == "兑换订单详情",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          slot: "integral",
 | 
					 | 
				
			||||||
          prop: "integral",
 | 
					 | 
				
			||||||
          label: "消耗积分",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {slot: "options", label: "操作", align: "center"},
 | 
					 | 
				
			||||||
      ];
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    goodsConfig() {
 | 
					 | 
				
			||||||
      return [
 | 
					 | 
				
			||||||
        {slot: "selection", label: "", align: "center"},
 | 
					 | 
				
			||||||
        {prop: "merchandiseName", label: "商品名", align: "left", width: 350},
 | 
					 | 
				
			||||||
        {prop: "costIntegral", label: "单价", align: "left"},
 | 
					 | 
				
			||||||
        {prop: "inventoryNumber", align: "center", label: "库存"},
 | 
					 | 
				
			||||||
      ];
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    allIntegral() {
 | 
					 | 
				
			||||||
      let arr = Object.keys(this.goodIntegral);
 | 
					 | 
				
			||||||
      let all = 0;
 | 
					 | 
				
			||||||
      arr.forEach((e) => {
 | 
					 | 
				
			||||||
        all += this.goodIntegral[e];
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
      return all;
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  created() {
 | 
					 | 
				
			||||||
    if (this.info.isAdd) {
 | 
					 | 
				
			||||||
      this.title = "添加兑换订单";
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
      this.title = "兑换订单详情";
 | 
					 | 
				
			||||||
      this.searchDetail(this.info.id);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    this.getShopList();
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  methods: {
 | 
					 | 
				
			||||||
    getSelect(val) {
 | 
					 | 
				
			||||||
      if (val) {
 | 
					 | 
				
			||||||
        this.forms.familyName = val.familyName;
 | 
					 | 
				
			||||||
        this.forms.familyId = val.familyId;
 | 
					 | 
				
			||||||
        this.forms.name = val.name;
 | 
					 | 
				
			||||||
        this.forms.memberId = val.id;
 | 
					 | 
				
			||||||
        this.forms.phone = val.phone;
 | 
					 | 
				
			||||||
        this.integral = val.integral;
 | 
					 | 
				
			||||||
      } else {
 | 
					 | 
				
			||||||
        this.forms.familyName = "";
 | 
					 | 
				
			||||||
        this.forms.familyId = "";
 | 
					 | 
				
			||||||
        this.forms.name = "";
 | 
					 | 
				
			||||||
        this.forms.memberId = "";
 | 
					 | 
				
			||||||
        this.forms.phone = "";
 | 
					 | 
				
			||||||
        this.integral = 0;
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    handleSelectionChange(val) {
 | 
					 | 
				
			||||||
      this.selectGoodList = [...val];
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    onConfirm() {
 | 
					 | 
				
			||||||
      this.selectGoodsInit(this.selectGoodList).then(() => {
 | 
					 | 
				
			||||||
        this.showGoods = false;
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    init() {
 | 
					 | 
				
			||||||
      this.selectGoodList = [];
 | 
					 | 
				
			||||||
      this.goodList = [];
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    deleteGood(row) {
 | 
					 | 
				
			||||||
      console.log(row);
 | 
					 | 
				
			||||||
      this.$confirm("是否删除该商品?", {
 | 
					 | 
				
			||||||
        type: "error",
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
      .then(() => {
 | 
					 | 
				
			||||||
        this.forms.merchandiseList.splice(row.$index, 1);
 | 
					 | 
				
			||||||
        this.$delete(this.goodIntegral, row.row.id);
 | 
					 | 
				
			||||||
        this.$delete(this.merchandiseNumbers, row.row.id);
 | 
					 | 
				
			||||||
        return this.$message.success("删除成功");
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
      .catch(() => {
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    selectGoodsInit(val) {
 | 
					 | 
				
			||||||
      return new Promise((reslove) => {
 | 
					 | 
				
			||||||
        val.map((e, index) => {
 | 
					 | 
				
			||||||
          e.merchandiseNumber = 1;
 | 
					 | 
				
			||||||
          e.merchandiseId = e.id;
 | 
					 | 
				
			||||||
          this.$set(this.merchandiseNumbers, e.id, 1);
 | 
					 | 
				
			||||||
          this.$set(this.goodIntegral, e.id, Number(e.costIntegral));
 | 
					 | 
				
			||||||
          if (e.photo) {
 | 
					 | 
				
			||||||
            e.merchandisePhoto = e.photo;
 | 
					 | 
				
			||||||
            e.photo = [{...JSON.parse(e.photo)[0]}];
 | 
					 | 
				
			||||||
          } else {
 | 
					 | 
				
			||||||
            e.photo = [];
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        this.forms.merchandiseList = this.forms.merchandiseList.concat([
 | 
					 | 
				
			||||||
          ...val,
 | 
					 | 
				
			||||||
        ]);
 | 
					 | 
				
			||||||
        reslove();
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    showGoodsList() {
 | 
					 | 
				
			||||||
      this.instance
 | 
					 | 
				
			||||||
      .post(`/app/appvillagerintegralmerchandise/list`, null, {
 | 
					 | 
				
			||||||
        params: {
 | 
					 | 
				
			||||||
          size: 100000,
 | 
					 | 
				
			||||||
          shopId: this.forms.shopId,
 | 
					 | 
				
			||||||
          merchandiseName: this.keyWord,
 | 
					 | 
				
			||||||
          status: "1",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
      .then((res) => {
 | 
					 | 
				
			||||||
        if (res.code == 0) {
 | 
					 | 
				
			||||||
          if (this.forms.merchandiseList.length > 0) {
 | 
					 | 
				
			||||||
            this.forms.merchandiseList.forEach((e1, index1) => {
 | 
					 | 
				
			||||||
              res.data.records.forEach((e2, index2) => {
 | 
					 | 
				
			||||||
                if (e1.id == e2.id) {
 | 
					 | 
				
			||||||
                  res.data.records.splice(index2, 1);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
              });
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
          this.goodList = res.data.records;
 | 
					 | 
				
			||||||
          this.showGoods = true;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    changeNumber(currentValue, oldValue, row) {
 | 
					 | 
				
			||||||
      console.log(currentValue, oldValue, row);
 | 
					 | 
				
			||||||
      this.$set(
 | 
					 | 
				
			||||||
          this.goodIntegral,
 | 
					 | 
				
			||||||
          row.id,
 | 
					 | 
				
			||||||
          Number(currentValue) * Number(row.costIntegral)
 | 
					 | 
				
			||||||
      );
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    getShopList() {
 | 
					 | 
				
			||||||
      this.instance
 | 
					 | 
				
			||||||
      .post(`/app/appvillagerintegralshop/listForOperator`, null, {
 | 
					 | 
				
			||||||
        params: {
 | 
					 | 
				
			||||||
          size: 100000,
 | 
					 | 
				
			||||||
          areaId: this.areaId,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
      .then((res) => {
 | 
					 | 
				
			||||||
        if (res.code == 0) {
 | 
					 | 
				
			||||||
          this.shopList = res.data.records;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    save(formName) {
 | 
					 | 
				
			||||||
      this.$refs[formName].validate((valid) => {
 | 
					 | 
				
			||||||
        if (valid) {
 | 
					 | 
				
			||||||
          this.forms.merchandiseList.forEach((e1, index1) => {
 | 
					 | 
				
			||||||
            Object.keys(this.merchandiseNumbers).forEach((e2, index2) => {
 | 
					 | 
				
			||||||
              if (e1.id == e2) {
 | 
					 | 
				
			||||||
                this.forms.merchandiseList[
 | 
					 | 
				
			||||||
                    index1
 | 
					 | 
				
			||||||
                    ].merchandiseNumber = this.merchandiseNumbers[e2];
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
          this.instance
 | 
					 | 
				
			||||||
          .post(
 | 
					 | 
				
			||||||
              `/app/appvillagerintegralshoporder/addOrder`,
 | 
					 | 
				
			||||||
              {
 | 
					 | 
				
			||||||
                ...this.forms,
 | 
					 | 
				
			||||||
                areaId: this.user.info.areaId,
 | 
					 | 
				
			||||||
                orderIntegral: this.allIntegral,
 | 
					 | 
				
			||||||
              },
 | 
					 | 
				
			||||||
              null
 | 
					 | 
				
			||||||
          )
 | 
					 | 
				
			||||||
          .then((res) => {
 | 
					 | 
				
			||||||
            if (res.code == 0) {
 | 
					 | 
				
			||||||
              this.$message.success("提交成功");
 | 
					 | 
				
			||||||
              this.$emit("goBack");
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
              return this.$message.error(res.msg);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
          return false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    searchDetail(id) {
 | 
					 | 
				
			||||||
      this.instance
 | 
					 | 
				
			||||||
      .post(`/app/appvillagerintegralshoporder/queryDetailById`, null, {
 | 
					 | 
				
			||||||
        params: {
 | 
					 | 
				
			||||||
          id,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
      .then((res) => {
 | 
					 | 
				
			||||||
        if (res.code == 0) {
 | 
					 | 
				
			||||||
          this.detailInfo = {...res.data};
 | 
					 | 
				
			||||||
          this.detailInfo.merchandiseList.map((e) => {
 | 
					 | 
				
			||||||
            let arr = JSON.parse(e.merchandisePhoto);
 | 
					 | 
				
			||||||
            e.merchandisePhoto = [{...arr[0]}];
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
</script>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<style lang="scss" scoped>
 | 
					 | 
				
			||||||
.add_order {
 | 
					 | 
				
			||||||
  height: 100%;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .form_div {
 | 
					 | 
				
			||||||
    padding: 16px 0;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .goods {
 | 
					 | 
				
			||||||
    :deep( .el-table td ){
 | 
					 | 
				
			||||||
      border-bottom: none;
 | 
					 | 
				
			||||||
      padding: 2px 0;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    :deep( .el-table th ){
 | 
					 | 
				
			||||||
      padding: 2px 0;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .total {
 | 
					 | 
				
			||||||
    width: 100%;
 | 
					 | 
				
			||||||
    padding: 32px 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    p {
 | 
					 | 
				
			||||||
      text-align: right;
 | 
					 | 
				
			||||||
      font-size: 14px;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    .num {
 | 
					 | 
				
			||||||
      font-size: 14px;
 | 
					 | 
				
			||||||
      color: #333333;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      span:nth-child(1) {
 | 
					 | 
				
			||||||
        color: #999999;
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      span:nth-child(2) {
 | 
					 | 
				
			||||||
        color: #999999;
 | 
					 | 
				
			||||||
        color: #2266ff;
 | 
					 | 
				
			||||||
        font-size: 20px;
 | 
					 | 
				
			||||||
        font-weight: bold;
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    .tip {
 | 
					 | 
				
			||||||
      color: #ff4466;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .border_div {
 | 
					 | 
				
			||||||
    overflow: hidden;
 | 
					 | 
				
			||||||
    border-radius: 2px;
 | 
					 | 
				
			||||||
    border: 1px solid #d0d4dc;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    header {
 | 
					 | 
				
			||||||
      height: 40px;
 | 
					 | 
				
			||||||
      background: #f5f5f5;
 | 
					 | 
				
			||||||
      padding: 0 8px;
 | 
					 | 
				
			||||||
      box-sizing: border-box;
 | 
					 | 
				
			||||||
      display: flex;
 | 
					 | 
				
			||||||
      justify-content: space-between;
 | 
					 | 
				
			||||||
      align-items: center;
 | 
					 | 
				
			||||||
      border-bottom: 1px solid #d0d4dc;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      span {
 | 
					 | 
				
			||||||
        color: #333333;
 | 
					 | 
				
			||||||
        font-size: 12px;
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .info {
 | 
					 | 
				
			||||||
    padding: 16px 0;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
</style>
 | 
					 | 
				
			||||||
@@ -1,336 +0,0 @@
 | 
				
			|||||||
<template>
 | 
					 | 
				
			||||||
  <section class="order_management">
 | 
					 | 
				
			||||||
    <ai-list isTabs>
 | 
					 | 
				
			||||||
      <template slot="content">
 | 
					 | 
				
			||||||
        <ai-search-bar bottomBorder>
 | 
					 | 
				
			||||||
          <template slot="left">
 | 
					 | 
				
			||||||
            <el-select
 | 
					 | 
				
			||||||
              size="small"
 | 
					 | 
				
			||||||
              v-model="searchObj.shopId"
 | 
					 | 
				
			||||||
              placeholder="请选择店铺"
 | 
					 | 
				
			||||||
              clearable
 | 
					 | 
				
			||||||
              @change="(page.current = 1), getList()">
 | 
					 | 
				
			||||||
              <el-option
 | 
					 | 
				
			||||||
                v-for="(item, i) in shopList"
 | 
					 | 
				
			||||||
                :key="i"
 | 
					 | 
				
			||||||
                :label="item.shopName"
 | 
					 | 
				
			||||||
                :value="item.id">
 | 
					 | 
				
			||||||
              </el-option>
 | 
					 | 
				
			||||||
            </el-select>
 | 
					 | 
				
			||||||
            <el-select
 | 
					 | 
				
			||||||
              size="small"
 | 
					 | 
				
			||||||
              v-model="searchObj.merchandiseType"
 | 
					 | 
				
			||||||
              placeholder="请选择商品类型"
 | 
					 | 
				
			||||||
              clearable
 | 
					 | 
				
			||||||
              @change="(page.current = 1), getList()">
 | 
					 | 
				
			||||||
              <el-option
 | 
					 | 
				
			||||||
                v-for="(item, i) in dict.getDict('integralMerchandiseType')"
 | 
					 | 
				
			||||||
                :key="i"
 | 
					 | 
				
			||||||
                :label="item.dictName"
 | 
					 | 
				
			||||||
                :value="item.dictValue">
 | 
					 | 
				
			||||||
              </el-option>
 | 
					 | 
				
			||||||
            </el-select>
 | 
					 | 
				
			||||||
            <el-select
 | 
					 | 
				
			||||||
              size="small"
 | 
					 | 
				
			||||||
              v-model="searchObj.status"
 | 
					 | 
				
			||||||
              placeholder="请选择状态"
 | 
					 | 
				
			||||||
              clearable
 | 
					 | 
				
			||||||
              @change="(page.current = 1), getList()">
 | 
					 | 
				
			||||||
              <el-option
 | 
					 | 
				
			||||||
                v-for="(item, i) in dict.getDict('integralMerchandiseStatus')"
 | 
					 | 
				
			||||||
                :key="i"
 | 
					 | 
				
			||||||
                :label="item.dictName"
 | 
					 | 
				
			||||||
                :value="item.dictValue">
 | 
					 | 
				
			||||||
              </el-option>
 | 
					 | 
				
			||||||
            </el-select>
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
          <template slot="right">
 | 
					 | 
				
			||||||
            <el-input
 | 
					 | 
				
			||||||
              v-model="searchObj.merchandiseName"
 | 
					 | 
				
			||||||
              size="small"
 | 
					 | 
				
			||||||
              placeholder="商品名"
 | 
					 | 
				
			||||||
              @keyup.enter.native="(page.current = 1), getList()"
 | 
					 | 
				
			||||||
              @clear="(page.current = 1), searchObj.merchandiseName = '', getList()"
 | 
					 | 
				
			||||||
              clearable
 | 
					 | 
				
			||||||
              suffix-icon="iconfont iconSearch" />
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
        </ai-search-bar>
 | 
					 | 
				
			||||||
        <ai-search-bar class="mt10">
 | 
					 | 
				
			||||||
          <template slot="left">
 | 
					 | 
				
			||||||
            <el-button
 | 
					 | 
				
			||||||
              type="primary"
 | 
					 | 
				
			||||||
              icon="iconfont iconAdd"
 | 
					 | 
				
			||||||
              @click="add()"
 | 
					 | 
				
			||||||
              v-if="$permissions('app_appvillagerintegralmerchandise_edit')">
 | 
					 | 
				
			||||||
              添加
 | 
					 | 
				
			||||||
            </el-button>
 | 
					 | 
				
			||||||
            <ai-download
 | 
					 | 
				
			||||||
              :instance="instance"
 | 
					 | 
				
			||||||
              :fileName="'商品列表'"
 | 
					 | 
				
			||||||
              url="/app/appvillagerintegralmerchandise/export"
 | 
					 | 
				
			||||||
              v-if="$permissions('app_appvillagerintegralmerchandise_export')"
 | 
					 | 
				
			||||||
              :params="{ ...searchObj, areaId: areaId }">
 | 
					 | 
				
			||||||
            </ai-download>
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
          <template slot="right"> </template>
 | 
					 | 
				
			||||||
        </ai-search-bar>
 | 
					 | 
				
			||||||
        <ai-table
 | 
					 | 
				
			||||||
          :tableData="tableData"
 | 
					 | 
				
			||||||
          :col-configs="colConfigs"
 | 
					 | 
				
			||||||
          :total="page.total"
 | 
					 | 
				
			||||||
          :current.sync="page.current"
 | 
					 | 
				
			||||||
          :size.sync="page.size"
 | 
					 | 
				
			||||||
          @getList="getList">
 | 
					 | 
				
			||||||
          <el-table-column
 | 
					 | 
				
			||||||
            label="商品图"
 | 
					 | 
				
			||||||
            slot="photo"
 | 
					 | 
				
			||||||
            align="center"
 | 
					 | 
				
			||||||
            width="150">
 | 
					 | 
				
			||||||
            <template v-slot="{ row }">
 | 
					 | 
				
			||||||
              <ai-uploader
 | 
					 | 
				
			||||||
                :disabled="true"
 | 
					 | 
				
			||||||
                :instance="instance"
 | 
					 | 
				
			||||||
                v-model="row.photo"
 | 
					 | 
				
			||||||
                :limit="9">
 | 
					 | 
				
			||||||
              </ai-uploader>
 | 
					 | 
				
			||||||
            </template>
 | 
					 | 
				
			||||||
          </el-table-column>
 | 
					 | 
				
			||||||
          <el-table-column label="操作" slot="options" align="center" width="200" fixed="right">
 | 
					 | 
				
			||||||
            <template v-slot="{ row }">
 | 
					 | 
				
			||||||
              <div class="table-options">
 | 
					 | 
				
			||||||
                <el-button
 | 
					 | 
				
			||||||
                  type="text"
 | 
					 | 
				
			||||||
                  title="编辑"
 | 
					 | 
				
			||||||
                  :disabled="!$permissions('app_appvillagerintegralmerchandise_edit') || row.enable != 1"
 | 
					 | 
				
			||||||
                  @click="edit(row)">
 | 
					 | 
				
			||||||
                  编辑
 | 
					 | 
				
			||||||
                </el-button>
 | 
					 | 
				
			||||||
                <el-button
 | 
					 | 
				
			||||||
                  type="text"
 | 
					 | 
				
			||||||
                  title="详情"
 | 
					 | 
				
			||||||
                  :disabled="!$permissions('app_appvillagerintegralmerchandise_detail') || row.enable != 1"
 | 
					 | 
				
			||||||
                  @click="goDetail(row)">
 | 
					 | 
				
			||||||
                  详情
 | 
					 | 
				
			||||||
                </el-button>
 | 
					 | 
				
			||||||
                <el-button
 | 
					 | 
				
			||||||
                  type="text"
 | 
					 | 
				
			||||||
                  title="上架"
 | 
					 | 
				
			||||||
                  :disabled="row.status != 0 || !$permissions('app_appvillagerintegralmerchandise_edit') || row.enable != 1"
 | 
					 | 
				
			||||||
                  @click="changeStatus(row)">
 | 
					 | 
				
			||||||
                  上架
 | 
					 | 
				
			||||||
                </el-button>
 | 
					 | 
				
			||||||
                <el-button
 | 
					 | 
				
			||||||
                  type="text"
 | 
					 | 
				
			||||||
                  title="下架"
 | 
					 | 
				
			||||||
                  :disabled="row.status != 1 || !$permissions('app_appvillagerintegralmerchandise_edit') || row.enable != 1"
 | 
					 | 
				
			||||||
                  @click="changeStatus(row)">
 | 
					 | 
				
			||||||
                  下架
 | 
					 | 
				
			||||||
                </el-button>
 | 
					 | 
				
			||||||
              </div>
 | 
					 | 
				
			||||||
            </template>
 | 
					 | 
				
			||||||
          </el-table-column>
 | 
					 | 
				
			||||||
        </ai-table>
 | 
					 | 
				
			||||||
      </template>
 | 
					 | 
				
			||||||
    </ai-list>
 | 
					 | 
				
			||||||
  </section>
 | 
					 | 
				
			||||||
</template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<script>
 | 
					 | 
				
			||||||
export default {
 | 
					 | 
				
			||||||
  name: "goodsManagement",
 | 
					 | 
				
			||||||
  props: {
 | 
					 | 
				
			||||||
    instance: Function,
 | 
					 | 
				
			||||||
    dict: Object,
 | 
					 | 
				
			||||||
    permissions: Function,
 | 
					 | 
				
			||||||
    areaId: String,
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  data() {
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
      searchObj: {
 | 
					 | 
				
			||||||
        shopId: "",
 | 
					 | 
				
			||||||
        status: "",
 | 
					 | 
				
			||||||
        merchandiseName: "",
 | 
					 | 
				
			||||||
        merchandiseType: "",
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      page: {
 | 
					 | 
				
			||||||
        size: 10,
 | 
					 | 
				
			||||||
        current: 1,
 | 
					 | 
				
			||||||
        total: 0,
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      tableData: [],
 | 
					 | 
				
			||||||
      shopList: [],
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  computed: {
 | 
					 | 
				
			||||||
    colConfigs() {
 | 
					 | 
				
			||||||
      let _ = this;
 | 
					 | 
				
			||||||
      return [
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "shopId",
 | 
					 | 
				
			||||||
          label: "店铺名称",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          slot: "photo",
 | 
					 | 
				
			||||||
          prop: "photo",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          label: "商品图",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "merchandiseName",
 | 
					 | 
				
			||||||
          align: "left",
 | 
					 | 
				
			||||||
          label: "商品名",
 | 
					 | 
				
			||||||
          width: 180,
 | 
					 | 
				
			||||||
          "show-overflow-tooltip": false,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "costIntegral",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          label: "单价",
 | 
					 | 
				
			||||||
          width: 100,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "inventoryNumber",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          label: "库存",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "saleNumber",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          label: "销量",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "status",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          label: "状态",
 | 
					 | 
				
			||||||
          render(h, { row }) {
 | 
					 | 
				
			||||||
            return h(
 | 
					 | 
				
			||||||
              "span",
 | 
					 | 
				
			||||||
              {
 | 
					 | 
				
			||||||
                style: {
 | 
					 | 
				
			||||||
                  color: _.$dict.getColor(
 | 
					 | 
				
			||||||
                    "integralMerchandiseStatus",
 | 
					 | 
				
			||||||
                    row.status
 | 
					 | 
				
			||||||
                  ),
 | 
					 | 
				
			||||||
                },
 | 
					 | 
				
			||||||
              },
 | 
					 | 
				
			||||||
              _.$dict.getLabel("integralMerchandiseStatus", row.status)
 | 
					 | 
				
			||||||
            );
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
      ];
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  created() {
 | 
					 | 
				
			||||||
    this.dict.load("integralMerchandiseType", "integralMerchandiseStatus");
 | 
					 | 
				
			||||||
    this.getShopList().then(() => {
 | 
					 | 
				
			||||||
      this.getList();
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  methods: {
 | 
					 | 
				
			||||||
    getList() {
 | 
					 | 
				
			||||||
      this.instance
 | 
					 | 
				
			||||||
        .post(`/app/appvillagerintegralmerchandise/list`, null, {
 | 
					 | 
				
			||||||
          params: {
 | 
					 | 
				
			||||||
            ...this.searchObj,
 | 
					 | 
				
			||||||
            ...this.page,
 | 
					 | 
				
			||||||
            areaId: this.areaId,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        .then((res) => {
 | 
					 | 
				
			||||||
          if (res.code == 0) {
 | 
					 | 
				
			||||||
            this.tableData = res.data.records;
 | 
					 | 
				
			||||||
            this.tableData.map((e, index) => {
 | 
					 | 
				
			||||||
              let i = this.shopList.findIndex((item) => item.id == e.shopId);
 | 
					 | 
				
			||||||
              if (i > -1) {
 | 
					 | 
				
			||||||
                e.shopId = this.shopList[i].shopName;
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
              if (e.photo) {
 | 
					 | 
				
			||||||
                e.allPhoto = [...JSON.parse(e.photo)];
 | 
					 | 
				
			||||||
                e.photo = [{ ...e.allPhoto[0] }];
 | 
					 | 
				
			||||||
              } else {
 | 
					 | 
				
			||||||
                e.photo = [];
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
            this.page.total = res.data.total;
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    updateList() {
 | 
					 | 
				
			||||||
      this.getShopList().then(() => {
 | 
					 | 
				
			||||||
        this.getList();
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    reset() {
 | 
					 | 
				
			||||||
      Object.keys(this.searchObj).forEach((e) => {
 | 
					 | 
				
			||||||
        this.searchObj[e] = "";
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
      this.getList();
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    add() {
 | 
					 | 
				
			||||||
      this.$emit("showDetail", { isAdd: true });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    edit(row) {
 | 
					 | 
				
			||||||
      this.$emit("showDetail", { isAdd: true, ...row });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    goDetail(row) {
 | 
					 | 
				
			||||||
      this.$emit("showDetail", { isAdd: false, ...row });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    changeStatus(row) {
 | 
					 | 
				
			||||||
      let status =
 | 
					 | 
				
			||||||
        row.status == 0
 | 
					 | 
				
			||||||
          ? `上架 ${row.shopId}-${row.merchandiseName}`
 | 
					 | 
				
			||||||
          : `下架 ${row.shopId}-${row.merchandiseName}`;
 | 
					 | 
				
			||||||
      this.$confirm(
 | 
					 | 
				
			||||||
        `<p>是否要<span style='color:#2266FF;'>${status}</span>?</p>`,
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          type: "error",
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      )
 | 
					 | 
				
			||||||
        .then(() => {
 | 
					 | 
				
			||||||
          this.instance
 | 
					 | 
				
			||||||
            .post("/app/appvillagerintegralmerchandise/enableOrDisable", null, {
 | 
					 | 
				
			||||||
              params: { id: row.id },
 | 
					 | 
				
			||||||
            })
 | 
					 | 
				
			||||||
            .then((res) => {
 | 
					 | 
				
			||||||
              if (res?.code == 0) {
 | 
					 | 
				
			||||||
                this.$message.success("操作成功!");
 | 
					 | 
				
			||||||
                this.getList();
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        .catch(() => {});
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    getShopList() {
 | 
					 | 
				
			||||||
      return new Promise((reslove) => {
 | 
					 | 
				
			||||||
        this.instance
 | 
					 | 
				
			||||||
          .post(`/app/appvillagerintegralshop/list`, null, {
 | 
					 | 
				
			||||||
            params: {
 | 
					 | 
				
			||||||
              size: 100000,
 | 
					 | 
				
			||||||
              areaId: this.areaId,
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
          })
 | 
					 | 
				
			||||||
          .then((res) => {
 | 
					 | 
				
			||||||
            if (res.code == 0) {
 | 
					 | 
				
			||||||
              this.shopList = res.data.records;
 | 
					 | 
				
			||||||
              reslove();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
</script>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<style lang="scss" scoped>
 | 
					 | 
				
			||||||
.order_management {
 | 
					 | 
				
			||||||
  background: #f3f6f9;
 | 
					 | 
				
			||||||
  height: 100%;
 | 
					 | 
				
			||||||
  overflow: auto;
 | 
					 | 
				
			||||||
  .iconShow {
 | 
					 | 
				
			||||||
    padding: 0 8px;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  .iconfont {
 | 
					 | 
				
			||||||
    cursor: pointer;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
</style>
 | 
					 | 
				
			||||||
@@ -1,501 +0,0 @@
 | 
				
			|||||||
<template>
 | 
					 | 
				
			||||||
  <section class="order_management">
 | 
					 | 
				
			||||||
    <ai-list isTabs>
 | 
					 | 
				
			||||||
      <template slot="content">
 | 
					 | 
				
			||||||
        <ai-search-bar>
 | 
					 | 
				
			||||||
          <template slot="left">
 | 
					 | 
				
			||||||
            <el-select
 | 
					 | 
				
			||||||
                size="small"
 | 
					 | 
				
			||||||
                v-model="searchObj.shopId"
 | 
					 | 
				
			||||||
                placeholder="请选择店铺"
 | 
					 | 
				
			||||||
                clearable
 | 
					 | 
				
			||||||
                @change="(page.current = 1), getList()">
 | 
					 | 
				
			||||||
              <el-option
 | 
					 | 
				
			||||||
                  v-for="(item, i) in shopList"
 | 
					 | 
				
			||||||
                  :key="i"
 | 
					 | 
				
			||||||
                  :label="item.shopName"
 | 
					 | 
				
			||||||
                  :value="item.id">
 | 
					 | 
				
			||||||
              </el-option>
 | 
					 | 
				
			||||||
            </el-select>
 | 
					 | 
				
			||||||
            <el-select
 | 
					 | 
				
			||||||
                size="small"
 | 
					 | 
				
			||||||
                v-model="searchObj.orderStatus"
 | 
					 | 
				
			||||||
                placeholder="请选择状态"
 | 
					 | 
				
			||||||
                clearable
 | 
					 | 
				
			||||||
                @change="(page.current = 1), getList()">
 | 
					 | 
				
			||||||
              <el-option
 | 
					 | 
				
			||||||
                  v-for="(item, i) in dict.getDict('integralOrderStatus')"
 | 
					 | 
				
			||||||
                  :key="i"
 | 
					 | 
				
			||||||
                  :label="item.dictName"
 | 
					 | 
				
			||||||
                  :value="item.dictValue">
 | 
					 | 
				
			||||||
              </el-option>
 | 
					 | 
				
			||||||
            </el-select>
 | 
					 | 
				
			||||||
            <ai-search label="创建时间">
 | 
					 | 
				
			||||||
              <el-date-picker
 | 
					 | 
				
			||||||
                  v-model="searchObj.createTimeStart"
 | 
					 | 
				
			||||||
                  type="date"
 | 
					 | 
				
			||||||
                  size="small"
 | 
					 | 
				
			||||||
                  @change="(page.current = 1), getList()"
 | 
					 | 
				
			||||||
                  value-format="yyyy-MM-dd HH:mm:ss"
 | 
					 | 
				
			||||||
                  placeholder="开始日期">
 | 
					 | 
				
			||||||
              </el-date-picker>
 | 
					 | 
				
			||||||
              <el-date-picker
 | 
					 | 
				
			||||||
                  v-model="searchObj.createTimeEnd"
 | 
					 | 
				
			||||||
                  type="date"
 | 
					 | 
				
			||||||
                  size="small"
 | 
					 | 
				
			||||||
                  @change="(page.current = 1), getList()"
 | 
					 | 
				
			||||||
                  value-format="yyyy-MM-dd HH:mm:ss"
 | 
					 | 
				
			||||||
                  placeholder="结束日期">
 | 
					 | 
				
			||||||
              </el-date-picker>
 | 
					 | 
				
			||||||
            </ai-search>
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          <template slot="right">
 | 
					 | 
				
			||||||
            <el-input
 | 
					 | 
				
			||||||
                v-model="searchObj.name"
 | 
					 | 
				
			||||||
                size="small"
 | 
					 | 
				
			||||||
                placeholder="订单号/商品名/兑换家庭"
 | 
					 | 
				
			||||||
                v-throttle="() => {page.current = 1, getList()}"
 | 
					 | 
				
			||||||
                @clear="page.current = 1, searchObj.name = '', getList()"
 | 
					 | 
				
			||||||
                clearable
 | 
					 | 
				
			||||||
                suffix-icon="iconfont iconSearch"
 | 
					 | 
				
			||||||
            />
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
        </ai-search-bar>
 | 
					 | 
				
			||||||
        <ai-search-bar>
 | 
					 | 
				
			||||||
          <template slot="left">
 | 
					 | 
				
			||||||
            <!-- <el-button type="primary" icon="iconfont iconAdd" @click="add()">添加</el-button> -->
 | 
					 | 
				
			||||||
            <ai-download
 | 
					 | 
				
			||||||
                :instance="instance"
 | 
					 | 
				
			||||||
                url="/app/appvillagerintegralshoporder/listExport"
 | 
					 | 
				
			||||||
                :params="{ ...searchObj, areaId: areaId, ids: ids.join(',') }"
 | 
					 | 
				
			||||||
                fileName="订单管理"
 | 
					 | 
				
			||||||
                v-if="$permissions('app_appvillagerintegralshoporder_export')">
 | 
					 | 
				
			||||||
            </ai-download>
 | 
					 | 
				
			||||||
            <el-dropdown @command="handleCommand">
 | 
					 | 
				
			||||||
              <el-button type="primary">
 | 
					 | 
				
			||||||
                变更状态<i class="el-icon-arrow-down el-icon--right"></i>
 | 
					 | 
				
			||||||
              </el-button>
 | 
					 | 
				
			||||||
              <el-dropdown-menu slot="dropdown">
 | 
					 | 
				
			||||||
                <el-dropdown-item command="1">批量兑换</el-dropdown-item>
 | 
					 | 
				
			||||||
                <el-dropdown-item command="2">批量取消</el-dropdown-item>
 | 
					 | 
				
			||||||
              </el-dropdown-menu>
 | 
					 | 
				
			||||||
            </el-dropdown>
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
          <template slot="right"></template>
 | 
					 | 
				
			||||||
        </ai-search-bar>
 | 
					 | 
				
			||||||
        <ai-table
 | 
					 | 
				
			||||||
            :tableData="tableData"
 | 
					 | 
				
			||||||
            :col-configs="colConfigs"
 | 
					 | 
				
			||||||
            :total="page.total"
 | 
					 | 
				
			||||||
            :current.sync="page.current"
 | 
					 | 
				
			||||||
            @select="onRowClick"
 | 
					 | 
				
			||||||
            @select-all="onRowClick"
 | 
					 | 
				
			||||||
            row-key="id"
 | 
					 | 
				
			||||||
            :default-expand-all="false"
 | 
					 | 
				
			||||||
            :tree-props="{ children: 'merchandiseList' }"
 | 
					 | 
				
			||||||
            :size.sync="page.size"
 | 
					 | 
				
			||||||
            @getList="getList">
 | 
					 | 
				
			||||||
          <el-table-column
 | 
					 | 
				
			||||||
              align="center"
 | 
					 | 
				
			||||||
              type="selection"
 | 
					 | 
				
			||||||
              :selectable="(row,index)=>row.orderStatus==0"
 | 
					 | 
				
			||||||
              width="55"
 | 
					 | 
				
			||||||
              slot="selection">
 | 
					 | 
				
			||||||
          </el-table-column>
 | 
					 | 
				
			||||||
          <el-table-column
 | 
					 | 
				
			||||||
              label="订单号/创建时间"
 | 
					 | 
				
			||||||
              slot="orderCode"
 | 
					 | 
				
			||||||
              align="center"
 | 
					 | 
				
			||||||
              width="150">
 | 
					 | 
				
			||||||
            <template v-slot="{ row }">
 | 
					 | 
				
			||||||
              <el-row>
 | 
					 | 
				
			||||||
                <el-col>{{ row.orderCode }}</el-col>
 | 
					 | 
				
			||||||
                <el-col style="color: #999999">{{ row.createTime }}</el-col>
 | 
					 | 
				
			||||||
              </el-row>
 | 
					 | 
				
			||||||
            </template>
 | 
					 | 
				
			||||||
          </el-table-column>
 | 
					 | 
				
			||||||
          <el-table-column
 | 
					 | 
				
			||||||
              label="商品图"
 | 
					 | 
				
			||||||
              slot="merchandisePhoto"
 | 
					 | 
				
			||||||
              align="center"
 | 
					 | 
				
			||||||
              width="130">
 | 
					 | 
				
			||||||
            <template v-slot="{ row }">
 | 
					 | 
				
			||||||
              <ai-uploader
 | 
					 | 
				
			||||||
                  :disabled="true"
 | 
					 | 
				
			||||||
                  :instance="instance"
 | 
					 | 
				
			||||||
                  v-model="row.merchandisePhoto"
 | 
					 | 
				
			||||||
                  :limit="9">
 | 
					 | 
				
			||||||
              </ai-uploader>
 | 
					 | 
				
			||||||
            </template>
 | 
					 | 
				
			||||||
          </el-table-column>
 | 
					 | 
				
			||||||
          <el-table-column label="兑换家庭" slot="familyName" align="left">
 | 
					 | 
				
			||||||
            <template v-slot="{ row }">
 | 
					 | 
				
			||||||
              <el-row>
 | 
					 | 
				
			||||||
                <el-col style="width: 100%">{{ row.familyName }}</el-col>
 | 
					 | 
				
			||||||
                <el-col style="color: #999999">{{ row.familyPhone }}</el-col>
 | 
					 | 
				
			||||||
              </el-row>
 | 
					 | 
				
			||||||
            </template>
 | 
					 | 
				
			||||||
          </el-table-column>
 | 
					 | 
				
			||||||
          <el-table-column label="操作人" slot="createUserName" align="left">
 | 
					 | 
				
			||||||
            <template v-slot="{ row }">
 | 
					 | 
				
			||||||
              <el-row>
 | 
					 | 
				
			||||||
                <el-col style="width: 100%">{{ row.createUserName }}</el-col>
 | 
					 | 
				
			||||||
                <el-col style="color: #999999">{{
 | 
					 | 
				
			||||||
                    row.createUserPhone
 | 
					 | 
				
			||||||
                  }}
 | 
					 | 
				
			||||||
                </el-col>
 | 
					 | 
				
			||||||
              </el-row>
 | 
					 | 
				
			||||||
            </template>
 | 
					 | 
				
			||||||
          </el-table-column>
 | 
					 | 
				
			||||||
          <el-table-column
 | 
					 | 
				
			||||||
              label="订单状态"
 | 
					 | 
				
			||||||
              slot="orderStatus"
 | 
					 | 
				
			||||||
              align="center"
 | 
					 | 
				
			||||||
              width="130"
 | 
					 | 
				
			||||||
              fixed="right">
 | 
					 | 
				
			||||||
            <template v-slot="{ row }">
 | 
					 | 
				
			||||||
              <el-row v-if="row.isParent">
 | 
					 | 
				
			||||||
                <el-col
 | 
					 | 
				
			||||||
                    style="width: 100%"
 | 
					 | 
				
			||||||
                    :style="{
 | 
					 | 
				
			||||||
                    color: dict.getColor(
 | 
					 | 
				
			||||||
                      'integralOrderStatus',
 | 
					 | 
				
			||||||
                      row.orderStatus
 | 
					 | 
				
			||||||
                    ),
 | 
					 | 
				
			||||||
                  }"
 | 
					 | 
				
			||||||
                >{{
 | 
					 | 
				
			||||||
                    dict.getLabel("integralOrderStatus", row.orderStatus)
 | 
					 | 
				
			||||||
                  }}
 | 
					 | 
				
			||||||
                </el-col
 | 
					 | 
				
			||||||
                >
 | 
					 | 
				
			||||||
                <el-col style="width: 100%" v-if="row.orderStatus == 0"
 | 
					 | 
				
			||||||
                >{{ row.reserveDate }} {{ row.reserveTime }}
 | 
					 | 
				
			||||||
                </el-col
 | 
					 | 
				
			||||||
                >
 | 
					 | 
				
			||||||
                <el-col style="color: #2266ff; width: 100%" v-if="row.remark">
 | 
					 | 
				
			||||||
                  <el-tooltip
 | 
					 | 
				
			||||||
                      :disabled="!row.remark"
 | 
					 | 
				
			||||||
                      class="item"
 | 
					 | 
				
			||||||
                      effect="light"
 | 
					 | 
				
			||||||
                      :content="row.remark"
 | 
					 | 
				
			||||||
                      placement="left-end"
 | 
					 | 
				
			||||||
                  >
 | 
					 | 
				
			||||||
                    <el-link type="primary">备注</el-link>
 | 
					 | 
				
			||||||
                  </el-tooltip>
 | 
					 | 
				
			||||||
                </el-col>
 | 
					 | 
				
			||||||
              </el-row>
 | 
					 | 
				
			||||||
            </template>
 | 
					 | 
				
			||||||
          </el-table-column>
 | 
					 | 
				
			||||||
          <el-table-column
 | 
					 | 
				
			||||||
              label="操作"
 | 
					 | 
				
			||||||
              slot="options"
 | 
					 | 
				
			||||||
              align="center"
 | 
					 | 
				
			||||||
              width="120"
 | 
					 | 
				
			||||||
              fixed="right">
 | 
					 | 
				
			||||||
            <template v-slot="{ row }">
 | 
					 | 
				
			||||||
              <div class="table-options">
 | 
					 | 
				
			||||||
                <el-button v-if="row.orderCode" type="text" @click="goDetail(row)" title="详情"
 | 
					 | 
				
			||||||
                           :disabled="!$permissions('app_appvillagerintegralshoporder_detail')">详情
 | 
					 | 
				
			||||||
                </el-button>
 | 
					 | 
				
			||||||
                <template v-if="row.orderStatus==0 || row.orderStatus==3">
 | 
					 | 
				
			||||||
                  <el-button type="text" v-if="row.orderStatus==0" @click="handlePendingOrder(row.id,1)">确认兑换</el-button>
 | 
					 | 
				
			||||||
                  <el-button type="text" v-if="row.orderStatus==0 || row.orderStatus==3" @click="handlePendingOrder(row.id,2)">取消订单</el-button>
 | 
					 | 
				
			||||||
                </template>
 | 
					 | 
				
			||||||
              </div>
 | 
					 | 
				
			||||||
            </template>
 | 
					 | 
				
			||||||
          </el-table-column>
 | 
					 | 
				
			||||||
        </ai-table>
 | 
					 | 
				
			||||||
      </template>
 | 
					 | 
				
			||||||
    </ai-list>
 | 
					 | 
				
			||||||
  </section>
 | 
					 | 
				
			||||||
</template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<script>
 | 
					 | 
				
			||||||
export default {
 | 
					 | 
				
			||||||
  name: "orderManagement",
 | 
					 | 
				
			||||||
  props: {
 | 
					 | 
				
			||||||
    instance: Function,
 | 
					 | 
				
			||||||
    dict: Object,
 | 
					 | 
				
			||||||
    permissions: Function,
 | 
					 | 
				
			||||||
    areaId: String,
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  data() {
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
      searchObj: {
 | 
					 | 
				
			||||||
        name: "",
 | 
					 | 
				
			||||||
        orderStatus: "",
 | 
					 | 
				
			||||||
        createTimeStart: null,
 | 
					 | 
				
			||||||
        createTimeEnd: null,
 | 
					 | 
				
			||||||
        shopId: "",
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      page: {
 | 
					 | 
				
			||||||
        size: 10,
 | 
					 | 
				
			||||||
        current: 1,
 | 
					 | 
				
			||||||
        total: 0,
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      tableData: [],
 | 
					 | 
				
			||||||
      shopList: [],
 | 
					 | 
				
			||||||
      ids: [],
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  computed: {
 | 
					 | 
				
			||||||
    colConfigs() {
 | 
					 | 
				
			||||||
      let _ = this;
 | 
					 | 
				
			||||||
      return [
 | 
					 | 
				
			||||||
        {slot: "selection"},
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "orderCode",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          slot: "orderCode",
 | 
					 | 
				
			||||||
          label: "订单号/创建时间",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "merchandisePhoto",
 | 
					 | 
				
			||||||
          slot: "merchandisePhoto",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          label: "商品图",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "merchandiseName",
 | 
					 | 
				
			||||||
          align: "left",
 | 
					 | 
				
			||||||
          label: "商品名",
 | 
					 | 
				
			||||||
          width: 180,
 | 
					 | 
				
			||||||
          "show-overflow-tooltip": false,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "costIntegral",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          label: "单价",
 | 
					 | 
				
			||||||
          width: 100,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "merchandiseNumber",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          label: "数量",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "allCostIntegral",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          label: "消耗积分",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "familyName",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          label: "兑换家庭",
 | 
					 | 
				
			||||||
          slot: "familyName",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "createUserName",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          label: "操作人",
 | 
					 | 
				
			||||||
          slot: "createUserName",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "orderStatus",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          label: "订单状态",
 | 
					 | 
				
			||||||
          fixed: "right",
 | 
					 | 
				
			||||||
          slot: "orderStatus",
 | 
					 | 
				
			||||||
          // render(h, {row}) {
 | 
					 | 
				
			||||||
          //     return h('span', {style: {color: _.dict.getColor('integralOrderStatus', row.orderStatus)}}, _.dict.getLabel('integralOrderStatus', row.orderStatus))
 | 
					 | 
				
			||||||
          // }
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
      ];
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  created() {
 | 
					 | 
				
			||||||
    this.getList();
 | 
					 | 
				
			||||||
    this.dict.load("integralOrderStatus");
 | 
					 | 
				
			||||||
    this.getShopList();
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  methods: {
 | 
					 | 
				
			||||||
    onRowClick(row) {
 | 
					 | 
				
			||||||
      this.ids = row.map(e => e.id)
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    handleCommand(val) {
 | 
					 | 
				
			||||||
      if (this.ids.length == 0) {
 | 
					 | 
				
			||||||
        return this.$message.error("请选择商品")
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      this.instance.post(`/app/appvillagerintegralshoporder/changeOrderStatus`, null, {
 | 
					 | 
				
			||||||
        params: {
 | 
					 | 
				
			||||||
          ids: this.ids.join(","),
 | 
					 | 
				
			||||||
          status: val
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      }).then(res => {
 | 
					 | 
				
			||||||
        if (res.code == 0) {
 | 
					 | 
				
			||||||
          this.$message.success(`批量${val == 1 ? '兑换' : '取消'}成功`)
 | 
					 | 
				
			||||||
          this.getList()
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    handlePendingOrder(ids, status) {
 | 
					 | 
				
			||||||
      let text = status == 1 ? "确认兑换" : "取消订单"
 | 
					 | 
				
			||||||
      this.$confirm(`是否${text}?`).then(() => {
 | 
					 | 
				
			||||||
        this.instance.post(`/app/appvillagerintegralshoporder/changeOrderStatus`, null, {
 | 
					 | 
				
			||||||
          params: {ids, status}
 | 
					 | 
				
			||||||
        }).then(res => {
 | 
					 | 
				
			||||||
          if (res.code == 0) {
 | 
					 | 
				
			||||||
            this.$message.success(`${text}成功`)
 | 
					 | 
				
			||||||
            this.getList()
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
      }).catch(() => 0)
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    getList() {
 | 
					 | 
				
			||||||
      this.instance.post(`/app/appvillagerintegralshoporder/list`, null, {
 | 
					 | 
				
			||||||
        params: {
 | 
					 | 
				
			||||||
          ...this.searchObj,
 | 
					 | 
				
			||||||
          ...this.page,
 | 
					 | 
				
			||||||
          areaId: this.areaId,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
      .then((res) => {
 | 
					 | 
				
			||||||
        if (res.code == 0) {
 | 
					 | 
				
			||||||
          this.tableData = res.data.records;
 | 
					 | 
				
			||||||
          this.tableData.map((e) => {
 | 
					 | 
				
			||||||
            e.merchandiseName = e.merchandiseList[0].merchandiseName;
 | 
					 | 
				
			||||||
            e.merchandiseNumber = e.merchandiseList[0].merchandiseNumber;
 | 
					 | 
				
			||||||
            e.merchandisePhoto = [
 | 
					 | 
				
			||||||
              {...JSON.parse(e.merchandiseList[0].merchandisePhoto)[0]},
 | 
					 | 
				
			||||||
            ];
 | 
					 | 
				
			||||||
            e.idForWeb = e.merchandiseList[0].idForWeb;
 | 
					 | 
				
			||||||
            e.costIntegral = e.merchandiseList[0].costIntegral;
 | 
					 | 
				
			||||||
            e.allCostIntegral =
 | 
					 | 
				
			||||||
                Number(e.merchandiseList[0].costIntegral) *
 | 
					 | 
				
			||||||
                Number(e.merchandiseNumber);
 | 
					 | 
				
			||||||
            e.merchandiseList.splice(0, 1);
 | 
					 | 
				
			||||||
            e.isParent = true;
 | 
					 | 
				
			||||||
            if (e.merchandiseList.length > 0) {
 | 
					 | 
				
			||||||
              e.merchandiseList.map((e2) => {
 | 
					 | 
				
			||||||
                e2.createTime = "";
 | 
					 | 
				
			||||||
                let arr = JSON.parse(e2.merchandisePhoto);
 | 
					 | 
				
			||||||
                e2.merchandisePhoto = [{...arr[0]}];
 | 
					 | 
				
			||||||
                e2.allCostIntegral =
 | 
					 | 
				
			||||||
                    Number(e2.costIntegral) * Number(e2.merchandiseNumber);
 | 
					 | 
				
			||||||
                e2.isParent = false;
 | 
					 | 
				
			||||||
                // e2.id = e2.orderId
 | 
					 | 
				
			||||||
              });
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
          this.page.total = res.data.total;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    getShopList() {
 | 
					 | 
				
			||||||
      return new Promise((reslove) => {
 | 
					 | 
				
			||||||
        this.instance
 | 
					 | 
				
			||||||
        .post(`/app/appvillagerintegralshop/list`, null, {
 | 
					 | 
				
			||||||
          params: {
 | 
					 | 
				
			||||||
            size: 100000,
 | 
					 | 
				
			||||||
            areaId: this.areaId,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        .then((res) => {
 | 
					 | 
				
			||||||
          if (res.code == 0) {
 | 
					 | 
				
			||||||
            this.shopList = res.data.records;
 | 
					 | 
				
			||||||
            reslove();
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    reset() {
 | 
					 | 
				
			||||||
      Object.keys(this.searchObj).forEach((e) => {
 | 
					 | 
				
			||||||
        this.searchObj[e] = "";
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
      this.searchObj.createTimeStart = null;
 | 
					 | 
				
			||||||
      this.searchObj.createTimeEnd = null;
 | 
					 | 
				
			||||||
      this.getList();
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    add() {
 | 
					 | 
				
			||||||
      this.$emit("showDetail", {isAdd: true});
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    goDetail(row) {
 | 
					 | 
				
			||||||
      console.log(row);
 | 
					 | 
				
			||||||
      this.$emit("showDetail", {isAdd: false, ...row});
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    finishOrder(row) {
 | 
					 | 
				
			||||||
      this.$confirm(`是否完成此订单?`, {
 | 
					 | 
				
			||||||
        type: "error",
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
      .then(() => {
 | 
					 | 
				
			||||||
        this.instance
 | 
					 | 
				
			||||||
        .post(`/app/appvillagerintegralshoporder/FinishOrder`, null, {
 | 
					 | 
				
			||||||
          params: {
 | 
					 | 
				
			||||||
            orderId: row.id,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        .then((res) => {
 | 
					 | 
				
			||||||
          if (res.code == 0) {
 | 
					 | 
				
			||||||
            this.$message.success("已完成!");
 | 
					 | 
				
			||||||
            this.getList();
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
      .catch(() => {
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    overOrder(row) {
 | 
					 | 
				
			||||||
      this.$confirm(`是否结束此订单?`, {
 | 
					 | 
				
			||||||
        type: "error",
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
      .then(() => {
 | 
					 | 
				
			||||||
        this.instance
 | 
					 | 
				
			||||||
        .post(`/app/appvillagerintegralshoporder/overOrder`, null, {
 | 
					 | 
				
			||||||
          params: {
 | 
					 | 
				
			||||||
            orderId: row.id,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        .then((res) => {
 | 
					 | 
				
			||||||
          if (res.code == 0) {
 | 
					 | 
				
			||||||
            this.$message.success("已结束!");
 | 
					 | 
				
			||||||
            this.getList();
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
      .catch(() => {
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
</script>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<style lang="scss" scoped>
 | 
					 | 
				
			||||||
.order_management {
 | 
					 | 
				
			||||||
  height: 100%;
 | 
					 | 
				
			||||||
  overflow: auto;
 | 
					 | 
				
			||||||
  background: #f3f6f9;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .times_div {
 | 
					 | 
				
			||||||
    display: flex;
 | 
					 | 
				
			||||||
    align-items: center;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    .times {
 | 
					 | 
				
			||||||
      display: block;
 | 
					 | 
				
			||||||
      width: 72px;
 | 
					 | 
				
			||||||
      height: 30px;
 | 
					 | 
				
			||||||
      line-height: 30px;
 | 
					 | 
				
			||||||
      margin: 0;
 | 
					 | 
				
			||||||
      text-align: center;
 | 
					 | 
				
			||||||
      background: #f5f5f5;
 | 
					 | 
				
			||||||
      border-radius: 2px 0px 0px 2px;
 | 
					 | 
				
			||||||
      border: 1px solid #d0d4dc;
 | 
					 | 
				
			||||||
      font-size: 14px;
 | 
					 | 
				
			||||||
      color: #666666;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .iconfont {
 | 
					 | 
				
			||||||
    cursor: pointer;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .iconCorrect {
 | 
					 | 
				
			||||||
    color: #53b43b;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .iconReject {
 | 
					 | 
				
			||||||
    color: #e75555;
 | 
					 | 
				
			||||||
    padding: 0 8px;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
</style>
 | 
					 | 
				
			||||||
@@ -1,474 +0,0 @@
 | 
				
			|||||||
<template>
 | 
					 | 
				
			||||||
  <section class="storeManagement">
 | 
					 | 
				
			||||||
    <ai-list isTabs>
 | 
					 | 
				
			||||||
      <template slot="content">
 | 
					 | 
				
			||||||
        <ai-search-bar bottomBorder>
 | 
					 | 
				
			||||||
          <template slot="left">
 | 
					 | 
				
			||||||
            <el-button
 | 
					 | 
				
			||||||
              :disabled="!isLevel5"
 | 
					 | 
				
			||||||
              type="primary"
 | 
					 | 
				
			||||||
              icon="iconfont iconAdd"
 | 
					 | 
				
			||||||
              @click="onAdd">
 | 
					 | 
				
			||||||
              添加
 | 
					 | 
				
			||||||
            </el-button>
 | 
					 | 
				
			||||||
          </template>
 | 
					 | 
				
			||||||
        </ai-search-bar>
 | 
					 | 
				
			||||||
        <ai-table
 | 
					 | 
				
			||||||
          :tableData="tableData"
 | 
					 | 
				
			||||||
          :col-configs="colConfigs"
 | 
					 | 
				
			||||||
          :total="total"
 | 
					 | 
				
			||||||
          ref="aitableex"
 | 
					 | 
				
			||||||
          :current.sync="search.current"
 | 
					 | 
				
			||||||
          :size.sync="search.size"
 | 
					 | 
				
			||||||
          @getList="getList">
 | 
					 | 
				
			||||||
          <el-table-column
 | 
					 | 
				
			||||||
            slot="changeIntegral"
 | 
					 | 
				
			||||||
            label="积分"
 | 
					 | 
				
			||||||
            align="center">
 | 
					 | 
				
			||||||
            <template slot-scope="{ row }">
 | 
					 | 
				
			||||||
              <span>{{ row.doType > 0 ? "+" : ""}}{{ row.changeIntegral }}</span>
 | 
					 | 
				
			||||||
            </template>
 | 
					 | 
				
			||||||
          </el-table-column>
 | 
					 | 
				
			||||||
          <el-table-column slot="options" label="操作" align="center" width="120" fixed="right">
 | 
					 | 
				
			||||||
            <template slot-scope="{ row }">
 | 
					 | 
				
			||||||
              <div class="table-options">
 | 
					 | 
				
			||||||
                <el-button
 | 
					 | 
				
			||||||
                  type="text"
 | 
					 | 
				
			||||||
                  title="编辑"
 | 
					 | 
				
			||||||
                  style="margin-right: 8px;"
 | 
					 | 
				
			||||||
                  :disabled="!$permissions('app_appvillagerintegralshop_edit')"
 | 
					 | 
				
			||||||
                  @click="editItem(row)">
 | 
					 | 
				
			||||||
                  编辑
 | 
					 | 
				
			||||||
                </el-button>
 | 
					 | 
				
			||||||
                <ai-wechat-selecter :instance="instance" v-model="dialogInfo.operators" @change="getSelect">
 | 
					 | 
				
			||||||
                  <el-button
 | 
					 | 
				
			||||||
                    type="text"
 | 
					 | 
				
			||||||
                    @click="statusChage(row)"
 | 
					 | 
				
			||||||
                    title="授权"
 | 
					 | 
				
			||||||
                    v-if="$permissions('app_appvillagerintegralshop_edit')">
 | 
					 | 
				
			||||||
                    授权
 | 
					 | 
				
			||||||
                  </el-button>
 | 
					 | 
				
			||||||
                </ai-wechat-selecter>
 | 
					 | 
				
			||||||
              </div>
 | 
					 | 
				
			||||||
            </template>
 | 
					 | 
				
			||||||
          </el-table-column>
 | 
					 | 
				
			||||||
        </ai-table>
 | 
					 | 
				
			||||||
      </template>
 | 
					 | 
				
			||||||
    </ai-list>
 | 
					 | 
				
			||||||
    <ai-dialog
 | 
					 | 
				
			||||||
      :title="dialog.title"
 | 
					 | 
				
			||||||
      :visible.sync="dialog.visible"
 | 
					 | 
				
			||||||
      :customFooter="true"
 | 
					 | 
				
			||||||
      :destroyOnClose="true"
 | 
					 | 
				
			||||||
      @close="init('ruleForm')"
 | 
					 | 
				
			||||||
      width="520px"
 | 
					 | 
				
			||||||
    >
 | 
					 | 
				
			||||||
      <div class="form_div">
 | 
					 | 
				
			||||||
        <el-form
 | 
					 | 
				
			||||||
          ref="ruleForm"
 | 
					 | 
				
			||||||
          :model="dialogInfo"
 | 
					 | 
				
			||||||
          :rules="formRules"
 | 
					 | 
				
			||||||
          size="small"
 | 
					 | 
				
			||||||
          label-suffix=":"
 | 
					 | 
				
			||||||
          label-width="100px"
 | 
					 | 
				
			||||||
        >
 | 
					 | 
				
			||||||
          <el-form-item label="店铺名称" prop="shopName">
 | 
					 | 
				
			||||||
            <el-input
 | 
					 | 
				
			||||||
              placeholder="请输入…"
 | 
					 | 
				
			||||||
              v-model="dialogInfo.shopName"
 | 
					 | 
				
			||||||
            ></el-input>
 | 
					 | 
				
			||||||
          </el-form-item>
 | 
					 | 
				
			||||||
          <el-form-item label="店主" prop="shopkeeper">
 | 
					 | 
				
			||||||
            <el-input
 | 
					 | 
				
			||||||
              placeholder="请输入…"
 | 
					 | 
				
			||||||
              v-model="dialogInfo.shopkeeper"
 | 
					 | 
				
			||||||
            ></el-input>
 | 
					 | 
				
			||||||
          </el-form-item>
 | 
					 | 
				
			||||||
          <el-form-item label="联系电话" prop="phone">
 | 
					 | 
				
			||||||
            <el-input
 | 
					 | 
				
			||||||
              placeholder="请输入…"
 | 
					 | 
				
			||||||
              v-model="dialogInfo.phone"
 | 
					 | 
				
			||||||
              maxlength="11"
 | 
					 | 
				
			||||||
            ></el-input>
 | 
					 | 
				
			||||||
          </el-form-item>
 | 
					 | 
				
			||||||
          <el-form-item label="店铺地址" prop="shopAddress">
 | 
					 | 
				
			||||||
            <el-input
 | 
					 | 
				
			||||||
              placeholder="请输入…"
 | 
					 | 
				
			||||||
              v-model="dialogInfo.shopAddress"
 | 
					 | 
				
			||||||
            ></el-input>
 | 
					 | 
				
			||||||
          </el-form-item>
 | 
					 | 
				
			||||||
          <el-form-item label="状态" prop="status">
 | 
					 | 
				
			||||||
            <el-radio-group v-model="dialogInfo.status">
 | 
					 | 
				
			||||||
              <el-radio label="1">启用</el-radio>
 | 
					 | 
				
			||||||
              <el-radio label="0">停用</el-radio>
 | 
					 | 
				
			||||||
            </el-radio-group>
 | 
					 | 
				
			||||||
          </el-form-item>
 | 
					 | 
				
			||||||
        </el-form>
 | 
					 | 
				
			||||||
      </div>
 | 
					 | 
				
			||||||
      <div class="dialog-footer" slot="footer">
 | 
					 | 
				
			||||||
        <el-button @click="dialog.visible = false" size="medium"
 | 
					 | 
				
			||||||
          >取消</el-button
 | 
					 | 
				
			||||||
        >
 | 
					 | 
				
			||||||
        <el-button @click="onConfirm('ruleForm')" type="primary" size="medium"
 | 
					 | 
				
			||||||
          >确认</el-button
 | 
					 | 
				
			||||||
        >
 | 
					 | 
				
			||||||
      </div>
 | 
					 | 
				
			||||||
    </ai-dialog>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    <ai-dialog
 | 
					 | 
				
			||||||
      title="操作人授权"
 | 
					 | 
				
			||||||
      :visible.sync="dialog.visibleStatus"
 | 
					 | 
				
			||||||
      :customFooter="true"
 | 
					 | 
				
			||||||
      :destroyOnClose="true"
 | 
					 | 
				
			||||||
      @close="init('ruleStatus')"
 | 
					 | 
				
			||||||
      width="720px"
 | 
					 | 
				
			||||||
    >
 | 
					 | 
				
			||||||
      <div class="form_div">
 | 
					 | 
				
			||||||
        <el-form
 | 
					 | 
				
			||||||
          ref="ruleStatus"
 | 
					 | 
				
			||||||
          :model="dialogInfo"
 | 
					 | 
				
			||||||
          :rules="formRules"
 | 
					 | 
				
			||||||
          size="small"
 | 
					 | 
				
			||||||
          label-suffix=":"
 | 
					 | 
				
			||||||
          label-width="100px"
 | 
					 | 
				
			||||||
        >
 | 
					 | 
				
			||||||
          <el-form-item label="事件区域" prop="areaId">
 | 
					 | 
				
			||||||
            <ai-area-select
 | 
					 | 
				
			||||||
              clearable
 | 
					 | 
				
			||||||
              always-show
 | 
					 | 
				
			||||||
              :instance="instance"
 | 
					 | 
				
			||||||
              v-model="dialogInfo.areaId"
 | 
					 | 
				
			||||||
              :hide-level="2"
 | 
					 | 
				
			||||||
              :disabled-level="user.info.areaList.length"
 | 
					 | 
				
			||||||
            />
 | 
					 | 
				
			||||||
          </el-form-item>
 | 
					 | 
				
			||||||
          <el-form-item label="操作员" required>
 | 
					 | 
				
			||||||
            <el-col :span="14" style="width: 60%; margin-right: 8px">
 | 
					 | 
				
			||||||
              <el-form-item prop="operators">
 | 
					 | 
				
			||||||
                <div class="organ">
 | 
					 | 
				
			||||||
                  <span v-if="dialogInfo.operators.length">
 | 
					 | 
				
			||||||
                    <span
 | 
					 | 
				
			||||||
                      v-for="(item, i) in dialogInfo.operators"
 | 
					 | 
				
			||||||
                      :key="i"
 | 
					 | 
				
			||||||
                      class="organzation"
 | 
					 | 
				
			||||||
                      >{{ item.userName }}
 | 
					 | 
				
			||||||
                      <span
 | 
					 | 
				
			||||||
                        class="iconfont iconOverrule"
 | 
					 | 
				
			||||||
                        @click.stop="delate(i)"
 | 
					 | 
				
			||||||
                      ></span>
 | 
					 | 
				
			||||||
                    </span>
 | 
					 | 
				
			||||||
                  </span>
 | 
					 | 
				
			||||||
                  <span v-else style="color: #999">请选择</span>
 | 
					 | 
				
			||||||
                </div>
 | 
					 | 
				
			||||||
              </el-form-item>
 | 
					 | 
				
			||||||
            </el-col>
 | 
					 | 
				
			||||||
            <el-col :span="7" style="width: 30%">
 | 
					 | 
				
			||||||
              <ai-person-select
 | 
					 | 
				
			||||||
                :instance="instance"
 | 
					 | 
				
			||||||
                :url="peopleAjaxUrl"
 | 
					 | 
				
			||||||
                :isMultiple="true"
 | 
					 | 
				
			||||||
                v-if="$permissions('app_appvillagerintegralshopoperator_edit')"
 | 
					 | 
				
			||||||
                @selectPerson="getSelect"
 | 
					 | 
				
			||||||
                :chooseUserList="dialogInfo.operators"
 | 
					 | 
				
			||||||
              >
 | 
					 | 
				
			||||||
                <template name="option" v-slot:option="{ item }">
 | 
					 | 
				
			||||||
                  <span class="iconfont iconProlife">{{ item.userName }}</span>
 | 
					 | 
				
			||||||
                </template>
 | 
					 | 
				
			||||||
              </ai-person-select>
 | 
					 | 
				
			||||||
            </el-col>
 | 
					 | 
				
			||||||
          </el-form-item>
 | 
					 | 
				
			||||||
        </el-form>
 | 
					 | 
				
			||||||
      </div>
 | 
					 | 
				
			||||||
      <div class="dialog-footer" slot="footer">
 | 
					 | 
				
			||||||
        <el-button @click="dialog.visibleStatus = false" size="medium"
 | 
					 | 
				
			||||||
          >取消</el-button
 | 
					 | 
				
			||||||
        >
 | 
					 | 
				
			||||||
        <el-button @click="onConfirm('ruleStatus')" type="primary" size="medium"
 | 
					 | 
				
			||||||
          >确认</el-button
 | 
					 | 
				
			||||||
        >
 | 
					 | 
				
			||||||
      </div>
 | 
					 | 
				
			||||||
    </ai-dialog>
 | 
					 | 
				
			||||||
  </section>
 | 
					 | 
				
			||||||
</template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<script>
 | 
					 | 
				
			||||||
import { mapState } from "vuex";
 | 
					 | 
				
			||||||
export default {
 | 
					 | 
				
			||||||
  name: "storeManagement",
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  props: {
 | 
					 | 
				
			||||||
    instance: Function,
 | 
					 | 
				
			||||||
    dict: Object,
 | 
					 | 
				
			||||||
    areaId: String,
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  data() {
 | 
					 | 
				
			||||||
    return {
 | 
					 | 
				
			||||||
      searchDotime: [],
 | 
					 | 
				
			||||||
      search: {
 | 
					 | 
				
			||||||
        current: 1,
 | 
					 | 
				
			||||||
        size: 10,
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      unitId: "",
 | 
					 | 
				
			||||||
      total: 10,
 | 
					 | 
				
			||||||
      colConfigs: [
 | 
					 | 
				
			||||||
        { prop: "shopName", label: "店铺名称", align: "left" },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "shopkeeper",
 | 
					 | 
				
			||||||
          label: "店主",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "phone",
 | 
					 | 
				
			||||||
          label: "联系电话",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "shopAddress",
 | 
					 | 
				
			||||||
          label: "店铺地址",
 | 
					 | 
				
			||||||
          align: "left",
 | 
					 | 
				
			||||||
          width: 280,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "names",
 | 
					 | 
				
			||||||
          label: "店铺操作员",
 | 
					 | 
				
			||||||
          align: "left",
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          prop: "status",
 | 
					 | 
				
			||||||
          label: "状态",
 | 
					 | 
				
			||||||
          align: "center",
 | 
					 | 
				
			||||||
          render: (h, params) => {
 | 
					 | 
				
			||||||
            return h(
 | 
					 | 
				
			||||||
              "span",
 | 
					 | 
				
			||||||
              {
 | 
					 | 
				
			||||||
                class: "status-" + params.row.status,
 | 
					 | 
				
			||||||
              },
 | 
					 | 
				
			||||||
              this.$dict.getLabel("assessmentStartStatus", params.row.status)
 | 
					 | 
				
			||||||
            );
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        { slot: "options", label: "操作", align: "center" },
 | 
					 | 
				
			||||||
      ],
 | 
					 | 
				
			||||||
      tableData: [],
 | 
					 | 
				
			||||||
      dialog: {
 | 
					 | 
				
			||||||
        title: "",
 | 
					 | 
				
			||||||
        visible: false,
 | 
					 | 
				
			||||||
        visibleStatus: false,
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      dialogInfo: {
 | 
					 | 
				
			||||||
        shopName: "",
 | 
					 | 
				
			||||||
        shopkeeper: "",
 | 
					 | 
				
			||||||
        phone: "",
 | 
					 | 
				
			||||||
        shopAddress: "",
 | 
					 | 
				
			||||||
        status: "1",
 | 
					 | 
				
			||||||
        areaId: "",
 | 
					 | 
				
			||||||
        operators: [],
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      formRules: {
 | 
					 | 
				
			||||||
        shopName: [
 | 
					 | 
				
			||||||
          { required: true, message: "请输入店铺名称", trigger: "change" },
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
        shopkeeper: [
 | 
					 | 
				
			||||||
          { required: true, message: "请输入店主", trigger: "blur" },
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
        phone: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
 | 
					 | 
				
			||||||
        shopAddress: [
 | 
					 | 
				
			||||||
          { required: true, message: "请输入店铺地址", trigger: "blur" },
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
        status: [{ required: true, message: "请选择状态", trigger: "blur" }],
 | 
					 | 
				
			||||||
        areaId: [
 | 
					 | 
				
			||||||
          { required: true, message: "请选择事件区域", trigger: "blur" },
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
        operators: [
 | 
					 | 
				
			||||||
          { required: true, message: "请选择操作员", trigger: "blur" },
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      peopleAjaxUrl: "/admin/user/page",
 | 
					 | 
				
			||||||
      isLevel5: false,
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  computed: {
 | 
					 | 
				
			||||||
    ...mapState(["user"]),
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  mounted() {
 | 
					 | 
				
			||||||
    this.unitId = this.user.info.unitId;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    this.$dict.load(["assessmentStartStatus"]).then(() => {
 | 
					 | 
				
			||||||
      this.getList();
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  methods: {
 | 
					 | 
				
			||||||
    getList() {
 | 
					 | 
				
			||||||
      this.isLevel5 = this.areaId.substring(this.areaId.length - 3) != "000";
 | 
					 | 
				
			||||||
      this.instance
 | 
					 | 
				
			||||||
        .post(`/app/appvillagerintegralshop/list`, null, {
 | 
					 | 
				
			||||||
          params: {
 | 
					 | 
				
			||||||
            ...this.search,
 | 
					 | 
				
			||||||
            areaId: this.areaId,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        .then((res) => {
 | 
					 | 
				
			||||||
          if (res.code == 0) {
 | 
					 | 
				
			||||||
            this.tableData = res.data.records;
 | 
					 | 
				
			||||||
            this.total = res.data.total;
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    timeChange() {
 | 
					 | 
				
			||||||
      if (this.searchDotime) {
 | 
					 | 
				
			||||||
        this.search.doTimeStart = this.searchDotime[0];
 | 
					 | 
				
			||||||
        this.search.doTimeEnd = this.searchDotime[1];
 | 
					 | 
				
			||||||
      } else {
 | 
					 | 
				
			||||||
        this.search.doTimeStart = null;
 | 
					 | 
				
			||||||
        this.search.doTimeEnd = null;
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      this.search.current = 1;
 | 
					 | 
				
			||||||
      this.getList();
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    editItem(row) {
 | 
					 | 
				
			||||||
      this.dialogInfo = { ...row };
 | 
					 | 
				
			||||||
      this.dialog.visible = true;
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    statusChage(row) {
 | 
					 | 
				
			||||||
      this.dialogInfo = { ...row };
 | 
					 | 
				
			||||||
      if (this.dialogInfo.operators.length) {
 | 
					 | 
				
			||||||
        this.dialogInfo.operators.map((item) => {
 | 
					 | 
				
			||||||
          item.userName = item.name;
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      } else {
 | 
					 | 
				
			||||||
        this.dialogInfo.operators = [];
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    onReset() {
 | 
					 | 
				
			||||||
      this.search.current = 1;
 | 
					 | 
				
			||||||
      this.getList();
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    onConfirm(formName) {
 | 
					 | 
				
			||||||
      if (this.dialogInfo.operators.length) {
 | 
					 | 
				
			||||||
        this.dialogInfo.operators.map((item) => {
 | 
					 | 
				
			||||||
          if (!item.name) {
 | 
					 | 
				
			||||||
            item.name = item.userName;
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      this.$refs[formName].validate((valid) => {
 | 
					 | 
				
			||||||
        if (valid) {
 | 
					 | 
				
			||||||
          this.instance
 | 
					 | 
				
			||||||
            .post(`/app/appvillagerintegralshop/addOrUpdate`, this.dialogInfo)
 | 
					 | 
				
			||||||
            .then((res) => {
 | 
					 | 
				
			||||||
              if (res.code == 0) {
 | 
					 | 
				
			||||||
                this.onReset();
 | 
					 | 
				
			||||||
                this.onCancel();
 | 
					 | 
				
			||||||
              }
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
          return false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    onCancel() {
 | 
					 | 
				
			||||||
      this.dialog.visible = false;
 | 
					 | 
				
			||||||
      this.dialog.visibleStatus = false;
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    init(formName) {
 | 
					 | 
				
			||||||
      this.$refs[formName].clearValidate();
 | 
					 | 
				
			||||||
      Object.keys(this.dialogInfo).forEach((e) => {
 | 
					 | 
				
			||||||
        this.dialogInfo[e] = "";
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
      this.dialogInfo.status = "1";
 | 
					 | 
				
			||||||
      this.dialogInfo.operators = [];
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    getSelect(e) {
 | 
					 | 
				
			||||||
      this.dialogInfo.operators = e;
 | 
					 | 
				
			||||||
      this.dialogInfo.operators.map((item) => {
 | 
					 | 
				
			||||||
        if (!item.name) {
 | 
					 | 
				
			||||||
          item.name = item.userName;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
      this.instance
 | 
					 | 
				
			||||||
        .post(`/app/appvillagerintegralshop/addOrUpdate`, this.dialogInfo)
 | 
					 | 
				
			||||||
        .then((res) => {
 | 
					 | 
				
			||||||
          this.dialogInfo.operators = []
 | 
					 | 
				
			||||||
          if (res.code == 0) {
 | 
					 | 
				
			||||||
            this.onReset();
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        }).catch(() => {
 | 
					 | 
				
			||||||
          this.dialogInfo.operators = []
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    delate(index) {
 | 
					 | 
				
			||||||
      this.dialogInfo.operators.splice(index, 1);
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    onAdd() {
 | 
					 | 
				
			||||||
      Object.keys(this.dialogInfo).forEach((e) => {
 | 
					 | 
				
			||||||
        this.dialogInfo[e] = "";
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
      this.dialogInfo.status = "1";
 | 
					 | 
				
			||||||
      this.dialogInfo.operators = [];
 | 
					 | 
				
			||||||
      this.dialog.visible = true;
 | 
					 | 
				
			||||||
      this.dialogInfo.areaId = this.areaId;
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
</script>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<style lang="scss">
 | 
					 | 
				
			||||||
.storeManagement {
 | 
					 | 
				
			||||||
  height: 100%;
 | 
					 | 
				
			||||||
  overflow: auto;
 | 
					 | 
				
			||||||
  background: #f3f6f9;
 | 
					 | 
				
			||||||
  .status-0 {
 | 
					 | 
				
			||||||
    color: #ff4466;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .table-options {
 | 
					 | 
				
			||||||
    display: flex;
 | 
					 | 
				
			||||||
    justify-content: center;
 | 
					 | 
				
			||||||
    align-items: center;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .status-1 {
 | 
					 | 
				
			||||||
    color: #2ea222;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .status-2 {
 | 
					 | 
				
			||||||
    color: #999999;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .ai-dialog__content--wrapper {
 | 
					 | 
				
			||||||
    overflow-x: hidden;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .organ {
 | 
					 | 
				
			||||||
    width: auto;
 | 
					 | 
				
			||||||
    height: auto;
 | 
					 | 
				
			||||||
    padding: 0px 10px;
 | 
					 | 
				
			||||||
    line-height: 32px;
 | 
					 | 
				
			||||||
    border: 1px solid #d0d4dc;
 | 
					 | 
				
			||||||
    border-radius: 5px;
 | 
					 | 
				
			||||||
    cursor: pointer;
 | 
					 | 
				
			||||||
    box-sizing: border-box;
 | 
					 | 
				
			||||||
    color: #666;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    .organzation {
 | 
					 | 
				
			||||||
      background-color: #eee;
 | 
					 | 
				
			||||||
      margin-right: 4px;
 | 
					 | 
				
			||||||
      padding: 4px;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
</style>
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user