Prechádzať zdrojové kódy

订单平台 外卖平台

xuwenqiang1992 2 rokov pred
rodič
commit
38c611407b

+ 1 - 0
package.json

@@ -21,6 +21,7 @@
     "@wangeditor/editor-for-vue": "5.1.10",
     "@wangeditor/editor-for-vue": "5.1.10",
     "axios": "^1.6.5",
     "axios": "^1.6.5",
     "echarts": "^5.4.3",
     "echarts": "^5.4.3",
+    "element-china-area-data": "^6.1.0",
     "element-plus": "^2.5.0",
     "element-plus": "^2.5.0",
     "js-cookie": "^3.0.5",
     "js-cookie": "^3.0.5",
     "lodash-es": "^4.17.21",
     "lodash-es": "^4.17.21",

+ 10 - 0
src/api/order/index.ts

@@ -0,0 +1,10 @@
+// @ts-nocheck
+import request from "@/utils/request";
+//订单列表
+export function queryOrderList(data) {
+  return request({
+    url: '/orderOperation/queryOrderList',
+    method: 'post',
+    params: data
+  })
+}

+ 28 - 5
src/api/store/index.ts

@@ -1,6 +1,29 @@
 // @ts-nocheck
 // @ts-nocheck
 import request from "@/utils/request";
 import request from "@/utils/request";
-
+//生成门店平台授权地址
+export function generateStorePlatformAuthUrl(data) {
+    return request({
+        url: "/store/generateStorePlatformAuthUrl",
+        method: "post",
+        params: data,
+    });
+}
+//获取门店平台授权信息列表
+export function getStorePlatformList(data) {
+    return request({
+        url: "/store/getStorePlatformList",
+        method: "post",
+        params: data,
+    });
+}
+//获取门店平台授权信息列表
+export function queryStorePlatformList(data) {
+    return request({
+        url: "/store/queryStorePlatformList",
+        method: "post",
+        params: data,
+    });
+}
 //生成门店平台授权地址
 //生成门店平台授权地址
 export function generateStoreAuthUrl_Douyin(data) {
 export function generateStoreAuthUrl_Douyin(data) {
     return request({
     return request({
@@ -83,18 +106,18 @@ export function addStoreInfo(data) {
 }
 }
 
 
 //获取门店列表
 //获取门店列表
-export function queryViewStoreInfo(data) {
+export function queryStoreInfoList(data) {
     return request({
     return request({
-        url: "/store/queryViewStoreInfo",
+        url: "/store/queryStoreInfoList",
         method: "get",
         method: "get",
         params: data,
         params: data,
     });
     });
 }
 }
 
 
 //获取门店详情
 //获取门店详情
-export function getViewStoreInfo(data) {
+export function getStoreInfo(data) {
     return request({
     return request({
-        url: "/store/getViewStoreInfo",
+        url: "/store/getStoreInfo",
         method: "get",
         method: "get",
         params: data,
         params: data,
     });
     });

+ 5 - 0
src/styles/index.scss

@@ -33,3 +33,8 @@
   width: 100%;
   width: 100%;
   margin-bottom: 10px;
   margin-bottom: 10px;
 }
 }
+.ellipsis{
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}

+ 28 - 0
src/utils/area-data.ts

@@ -0,0 +1,28 @@
+import {pcaTextArr} from "element-china-area-data";
+var areaData = {pcaTextArr}
+// 需要填补缺省数据 台湾省、香港、澳门;
+// pcaTextArr[0].children[0].value = "ceshi"
+// pcaTextArr[0].children[0].label = "ceshi"
+pcaTextArr[31]= {"value":"台湾省","label":"台湾省","children":[
+    {"label": "台北","value": "台北"},
+    {"label": "高雄","value": "高雄"},
+    {"label": "基隆","value": "基隆"},
+    {"label": "台中","value": "台中"},
+    {"label": "台南","value": "台南"},
+    {"label": "新竹","value": "新竹"},
+    {"label": "嘉义","value": "嘉义"},
+    {"label": "宜兰","value": "宜兰"},
+    {"label": "桃园","value": "桃园"},
+    {"label": "苗栗","value": "苗栗"},
+    {"label": "彰化","value": "彰化"},
+    {"label": "南投","value": "南投"},
+    {"label": "云林","value": "云林"},
+    {"label": "屏东","value": "屏东"},
+    {"label": "台东","value": "台东"},
+    {"label": "花莲","value": "花莲"},
+    {"label": "澎湖","value": "澎湖"}]
+}
+pcaTextArr[32]={"value":"香港","label":"香港","children":[{"value":"香港","label":"香港"}]}
+pcaTextArr[33]={"value":"澳门","label":"澳门","children":[{"value":"澳门","label":"澳门"}]}
+// 一般我们用areaData.regionData就够了;
+export default areaData;

+ 117 - 0
src/views/order/orderList/compt/childDialog.vue

@@ -0,0 +1,117 @@
+<template>
+  <div class="dialog">
+    <el-dialog
+        v-model="dialogVisible"
+        :title="dialogTitle"
+        width="480"
+        @close="closeDialog()"
+    >
+      <el-form
+          ref="formRef"
+          :model="formData"
+          :rules="rules"
+          label-width="120px"
+      >
+        <el-row>
+          <el-col :span="24">
+            <el-form-item prop="clientName" label="客户名称">
+              <el-input v-model="formData.clientName"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+      </el-form>
+
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button v-throttle type="primary" @click="handleSubmit">确 定</el-button>
+          <el-button @click="closeDialog()">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+<script setup lang="ts">
+import {getRoleInfo, getRoleMenuTreeData,updateRole} from "@/api/system";
+import type {FormInstance} from 'element-plus'
+
+let dialogVisible = ref(false)
+let dialogTitle = ref("")
+const formRef = ref<FormInstance>()
+const emit = defineEmits(['dialogChange'])
+const formData = reactive({
+  clientName:'',
+  id: ""
+})
+const rules = reactive({
+  clientName: [{required: true, message: "请输入客户名称", trigger: "blur"}],
+});
+function handleSubmit() {
+  formRef.value.validate((valid: any) => {
+    if (valid) {
+      const itemId = formData.id;
+      if (itemId) {
+        //修改
+        const postData = JSON.stringify(formData)
+        const params = {
+          "clientInfo": postData
+        }
+        updateClientInfo(params).then((response) => {
+          dialogVisible.value = false
+          if (response.httpCode == 200) {
+            emit('dialogChange');
+            ElMessage.success("操作成功");
+          }
+        })
+      } else {
+        //增加
+        const postData = JSON.stringify(formData)
+        const params = {
+          "clientInfo": postData
+        }
+        addClientInfo(params).then((response) => {
+          dialogVisible.value = false
+          if (response.httpCode == 200) {
+            emit('dialogChange');
+            ElMessage.success("操作成功");
+          }
+        })
+      }
+    }
+  });
+}
+
+function getItemData(item) {
+  const data = {
+    id: item
+  }
+  getClientInfo(data).then(response => {
+    if (response.httpCode == 200) {
+      const data = response.data
+      Object.assign(formData, {...data});
+    }
+  })
+}
+
+/**  重置表单 */
+function resetForm() {
+  formRef.value.resetFields();
+  formData.id = ''
+}
+
+/**关闭弹窗 */
+function closeDialog() {
+  dialogVisible.value = false
+  formRef.value.resetFields();
+  formData.id = undefined;
+}
+defineExpose({
+  dialogVisible,
+  dialogTitle,
+  getItemData,
+  resetForm
+})
+</script>
+<style scoped lang="scss">
+
+</style>

+ 164 - 0
src/views/order/orderList/index.vue

@@ -0,0 +1,164 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-input @keyup.enter="handleSearch" class="w200px mr5px" v-model="queryForm.keyWord" placeholder="关键字搜索"/>
+      <el-button type="primary" @click="handleSearch">
+        <i-ep-search/>
+        搜索
+      </el-button>
+      <div class="w100px ml10px" style="display: inline-block;">
+        <el-checkbox style="position: absolute;top: 11px" v-model="disableLock" label="已禁用"
+                     border></el-checkbox>
+      </div>
+      <el-button @click="openDialog()" color="#11a983">
+        <i-ep-plus/>
+        创建订单
+      </el-button>
+      <el-button type="primary" @click="refreshTableInfo">
+        <i-ep-refresh/>
+      </el-button>
+    </div>
+    <div class="table-con">
+      <el-table
+        :max-height="tableHeight"
+        v-loading="loading"
+        :data="tableData"
+        highlight-current-row
+        border
+      >
+        <el-table-column label="操作" width="140">
+          <template #default="{row}">
+            <el-button link @click="openDialog(row.id)" type="primary">
+              <i-ep-edit/>
+              编辑
+            </el-button>
+            <el-button v-if="row.voidFlag==0" link @click="handleDisable(row.id,1)" type="warning">禁用</el-button>
+            <el-button v-if="row.voidFlag==1" type="success" link @click="handleDisable(row.id,0)">启用</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+          type="index"
+          label="#"
+          width="50">
+          <template #default="scope">
+            <span>{{ scope.$index + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="orderName" width="200" label="订单名称"/>
+        <el-table-column prop="storeName" width="150" label="门店名称"/>
+        <el-table-column prop="deliverAddressAll" show-overflow-tooltip width="350" label="配送地址"/>
+        <el-table-column
+          prop="status"
+          label="状态">
+          <template #default="{row}">
+            <el-tag v-if="row.voidFlag==0" type="success">
+              正常
+            </el-tag>
+            <el-tag v-else="row.voidFlag==1" type="danger">
+              停用
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="createTime"
+          label="创建时间"
+          width="155">
+          <template #default="{row}">
+          <span v-if="row.createTime">
+           {{ $filters.getTime(row.createTime)}}
+          </span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-if="total > 0"
+        v-model:total="total"
+        v-model:page="queryPage.pageIndex"
+        v-model:limit="queryPage.pageSize"
+        @pagination="getTableData"
+      />
+    </div>
+    <child-dialog ref="childDialog" @dialogChange="dialogChange"></child-dialog>
+  </div>
+</template>
+<script setup lang="ts">
+import {queryOrderList} from "@/api/order";
+import ChildDialog from './compt/childDialog.vue'
+import {useTable} from '@/hooks/useTable'
+
+let disableLock = ref('')
+const childDialog = ref<any>()
+
+//增加编辑
+function openDialog(item?: any) {
+  childDialog.value.dialogVisible = true;
+  if (item) {
+    childDialog.value.dialogTitle = "编辑";
+    nextTick(() => {
+      childDialog.value.getItemData(item)
+    });
+  } else {
+    nextTick(() => {
+      childDialog.value.dialogTitle = "增加";
+      childDialog.value.resetForm()
+    })
+  }
+}
+
+//禁用删除
+function handleDisable(id, status) {
+  ElMessageBox.confirm("确认操作?", "警告", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(() => {
+    const postData = {
+      id: id,
+      enable: status
+    }
+    const params = {
+      "industryInfo": JSON.stringify(postData)
+    }
+    enableClientIndustryInfo(params).then((response) => {
+      if (response.httpCode == 200) {
+        ElMessage.success("操作成功");
+        getTableData();
+      }
+
+    })
+  })
+}
+
+//修改成功后传递事件
+function dialogChange() {
+  getTableData()
+}
+
+const queryForm = reactive({
+  keyWord: '',
+  voidFlag: 0
+})
+watch(
+  () => disableLock.value,
+  (disableLock) => {
+    if (disableLock) {
+      queryForm.voidFlag = 1
+      getTableData()
+    } else {
+      queryForm.voidFlag = 0
+      getTableData()
+    }
+  }
+);
+const {
+  tableData,
+  queryPage,
+  total,
+  loading,
+  getTableData,
+  tableHeight,
+  handleSearch,//搜索
+  refreshTableInfo,//刷新
+} = useTable(queryOrderList, queryForm);
+</script>
+

+ 120 - 0
src/views/store/orderPlatform/compt/childDialog.vue

@@ -0,0 +1,120 @@
+<template>
+  <div class="dialog">
+    <el-dialog
+        v-model="dialogVisible"
+        :title="dialogTitle"
+        width="700px"
+        @close="closeDialog()"
+    >
+      <el-form
+          ref="formRef"
+          :model="formData"
+          :rules="rules"
+          label-width="120px"
+      >
+        <el-row>
+          <el-col :span="24">
+            <el-descriptions>
+              <el-descriptions-item :label="storeName">{{storeId}}</el-descriptions-item>
+            </el-descriptions>
+            <el-descriptions v-if="sognUrl">
+              <el-descriptions-item label="授权URL">
+                <span style="width: 500px !important;display: inline-block;line-height: 10px" class="ellipsis">{{sognUrl}}</span>
+                <el-button type="primary" @click="copyBtn()">复 制</el-button>
+              </el-descriptions-item>
+            </el-descriptions>
+          </el-col>
+        </el-row>
+
+      </el-form>
+
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button v-throttle type="primary" @click="handleSubmit">生成门店平台授权地址</el-button>
+          <el-button @click="closeDialog()">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+<script setup lang="ts">
+import {getStorePlatformList,generateStorePlatformAuthUrl} from "@/api/store";
+import type {FormInstance} from 'element-plus'
+
+let dialogVisible = ref(false)
+let dialogTitle = ref("")
+let storeName = ref("")
+let storeId = ref("")
+let rowData = ref({})
+let sognCode = ref('')
+let sognUrl = ref('')
+const formRef = ref<FormInstance>()
+const emit = defineEmits(['dialogChange'])
+const formData = reactive({
+  clientName:'',
+  id: ""
+})
+const rules = reactive({
+  clientName: [{required: true, message: "请输入客户名称", trigger: "blur"}],
+});
+function handleSubmit() {
+  const data = {
+    "idStore": rowData.value.id,
+    "platformCode": sognCode.value,
+  }
+  generateStorePlatformAuthUrl(data).then(response => {
+    if (response.httpCode == 200) {
+      const data = response.data
+      sognUrl.value = data.resultStr
+    }
+  })
+}
+
+function getItemData(row, platformCode,name) {
+  rowData.value = row
+  sognCode.value = platformCode
+  const data = {
+    "idStore": row.id,
+    "platformCode": platformCode,
+  }
+  storeName.value = name+'店铺id:'
+  storeId.value = row.id
+  getStorePlatformList(data).then(response => {
+    if (response.httpCode == 200) {
+      const data = response.data
+    }
+  })
+}
+function copyBtn() {
+  let url = sognUrl.value
+  let oInput = document.createElement('input');
+  oInput.value = url;
+  document.body.appendChild(oInput);
+  oInput.select(); // 选择对象;
+  document.execCommand("Copy"); // 执行浏览器复制命令
+  ElMessage.success("复制成功")
+  document.body.removeChild(oInput);  //移除oInput 框
+}
+
+/**  重置表单 */
+function resetForm() {
+  formRef.value.resetFields();
+  formData.id = ''
+}
+
+/**关闭弹窗 */
+function closeDialog() {
+  dialogVisible.value = false
+  formRef.value.resetFields();
+  formData.id = undefined;
+}
+defineExpose({
+  dialogVisible,
+  dialogTitle,
+  getItemData,
+  resetForm
+})
+</script>
+<style scoped lang="scss">
+
+</style>

+ 191 - 0
src/views/store/orderPlatform/index.vue

@@ -0,0 +1,191 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-input @keyup.enter="handleSearch" class="w200px mr5px" v-model="queryForm.keyWord" placeholder="关键字搜索"/>
+      <el-button type="primary" @click="handleSearch">
+        <i-ep-search/>
+        搜索
+      </el-button>
+      <div class="w100px ml10px" style="display: inline-block;">
+        <el-checkbox style="position: absolute;top: 11px" v-model="disableLock" label="已禁用"
+                     border></el-checkbox>
+      </div>
+      <el-button @click="openDialog()" color="#11a983">
+        <i-ep-plus/>
+        增加
+      </el-button>
+      <el-button type="primary" @click="refreshTableInfo">
+        <i-ep-refresh/>
+      </el-button>
+    </div>
+    <div class="table-con">
+      <el-table
+          :max-height="tableHeight"
+          v-loading="loading"
+          :data="tableData"
+          highlight-current-row
+          border
+      >
+        <el-table-column label="操作" width="140">
+          <template #default="{row}">
+            <el-button link @click="openDialog(row.id)" type="primary">
+              <i-ep-edit/>
+              编辑
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            type="index"
+            label="#"
+            width="50">
+          <template #default="scope">
+            <span>{{ scope.$index + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="storeName" width="150" label="门店名称"/>
+        <el-table-column prop="brandName" width="150" label="品牌名称"/>
+        <el-table-column
+            prop="flag_DYLK"
+            label="抖音来客">
+          <template #default="{row}">
+            <el-button size="small" v-if="row.flag_DYLK==1" type="success">
+              已授权
+            </el-button>
+            <el-button @click="openDialog(row,'DYLK','抖音来客')" size="small" v-else="row.flag_DYLK==0" type="info">
+              未授权
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="flag_MTWM"
+            label="美团外卖">
+          <template #default="{row}">
+            <el-button size="small" v-if="row.flag_MTWM==1" type="success">
+              已授权
+            </el-button>
+            <el-button @click="openDialog(row,'MTWM','美团外卖')" size="small" v-else="row.flag_MTWM==0" type="info">
+              未授权
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="flag_ELMLS"
+            label="饿了么零售">
+          <template #default="{row}">
+            <el-button size="small" v-if="row.flag_ELMLS==1" type="success">
+              已授权
+            </el-button>
+            <el-button @click="openDialog(row,'ELMLS','饿了么零售')" size="small" v-else="row.flag_ELMLS==0" type="info">
+              未授权
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="flag_MEITUAN"
+            label="美团闪购">
+          <template #default="{row}">
+            <el-button size="small" v-if="row.flag_MEITUAN==1" type="success">
+              已授权
+            </el-button>
+            <el-button @click="openDialog(row,'MEITUAN','美团闪购')" size="small" v-else="row.flag_MEITUAN==0" type="info">
+              未授权
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="flag_SFTC"
+            label="顺丰同城">
+          <template #default="{row}">
+            <el-button size="small" v-if="row.flag_SFTC==1" type="success">
+              已授权
+            </el-button>
+            <el-button @click="openDialog(row,'SFTC','顺丰同城')" size="small" v-else="row.flag_SFTC==0" type="info">
+              未授权
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="flag_DDPT"
+            label="达达跑腿">
+          <template #default="{row}">
+            <el-button size="small" v-if="row.flag_DDPT==1" type="success">
+              已授权
+            </el-button>
+            <el-button @click="openDialog(row,'DDPT','达达跑腿')" size="small" v-else="row.flag_DDPT==0" type="info">
+              未授权
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="createTime"
+            label="创建时间"
+            width="155">
+          <template #default="{row}">
+          <span v-if="row.createTime">
+           {{ $filters.getTime(row.createTime) }}
+          </span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+          v-if="total > 0"
+          v-model:total="total"
+          v-model:page="queryPage.pageIndex"
+          v-model:limit="queryPage.pageSize"
+          @pagination="getTableData"
+      />
+    </div>
+    <child-dialog ref="childDialog" @dialogChange="dialogChange"></child-dialog>
+  </div>
+</template>
+<script setup lang="ts">
+import {queryStorePlatformList} from "@/api/store";
+import ChildDialog from './compt/childDialog.vue'
+import {useTable} from '@/hooks/useTable'
+
+let disableLock = ref('')
+const childDialog = ref<any>()
+
+//增加编辑
+function openDialog(row, platformCode,name) {
+  childDialog.value.dialogVisible = true;
+  childDialog.value.dialogTitle = "获取门店某平台授权信息-"+row.storeName;
+  nextTick(() => {
+    childDialog.value.getItemData(row, platformCode,name)
+  });
+}
+
+//禁用删除
+
+//修改成功后传递事件
+function dialogChange() {
+  getTableData()
+}
+
+const queryForm = reactive({
+  keyWord: '',
+  voidFlag: 0
+})
+watch(
+    () => disableLock.value,
+    (disableLock) => {
+      if (disableLock) {
+        queryForm.voidFlag = 1
+        getTableData()
+      } else {
+        queryForm.voidFlag = 0
+        getTableData()
+      }
+    }
+);
+const {
+  tableData,
+  queryPage,
+  total,
+  loading,
+  getTableData,
+  tableHeight,
+  handleSearch,//搜索
+  refreshTableInfo,//刷新
+} = useTable(queryStorePlatformList, queryForm);
+</script>

+ 120 - 0
src/views/store/runningPlatform/compt/childDialog.vue

@@ -0,0 +1,120 @@
+<template>
+  <div class="dialog">
+    <el-dialog
+        v-model="dialogVisible"
+        :title="dialogTitle"
+        width="700px"
+        @close="closeDialog()"
+    >
+      <el-form
+          ref="formRef"
+          :model="formData"
+          :rules="rules"
+          label-width="120px"
+      >
+        <el-row>
+          <el-col :span="24">
+            <el-descriptions>
+              <el-descriptions-item :label="storeName">{{storeId}}</el-descriptions-item>
+            </el-descriptions>
+            <el-descriptions v-if="sognUrl">
+              <el-descriptions-item label="授权URL">
+                <span style="width: 500px !important;display: inline-block;line-height: 10px" class="ellipsis">{{sognUrl}}</span>
+                <el-button type="primary" @click="copyBtn()">复 制</el-button>
+              </el-descriptions-item>
+            </el-descriptions>
+          </el-col>
+        </el-row>
+
+      </el-form>
+
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button v-throttle type="primary" @click="handleSubmit">生成门店平台授权地址</el-button>
+          <el-button @click="closeDialog()">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+<script setup lang="ts">
+import {getStorePlatformList,generateStorePlatformAuthUrl} from "@/api/store";
+import type {FormInstance} from 'element-plus'
+
+let dialogVisible = ref(false)
+let dialogTitle = ref("")
+let storeName = ref("")
+let storeId = ref("")
+let rowData = ref({})
+let sognCode = ref('')
+let sognUrl = ref('')
+const formRef = ref<FormInstance>()
+const emit = defineEmits(['dialogChange'])
+const formData = reactive({
+  clientName:'',
+  id: ""
+})
+const rules = reactive({
+  clientName: [{required: true, message: "请输入客户名称", trigger: "blur"}],
+});
+function handleSubmit() {
+  const data = {
+    "idStore": rowData.value.id,
+    "platformCode": sognCode.value,
+  }
+  generateStorePlatformAuthUrl(data).then(response => {
+    if (response.httpCode == 200) {
+      const data = response.data
+      sognUrl.value = data.resultStr
+    }
+  })
+}
+
+function getItemData(row, platformCode,name) {
+  rowData.value = row
+  sognCode.value = platformCode
+  const data = {
+    "idStore": row.id,
+    "platformCode": platformCode,
+  }
+  storeName.value = name+'店铺id:'
+  storeId.value = row.id
+  getStorePlatformList(data).then(response => {
+    if (response.httpCode == 200) {
+      const data = response.data
+    }
+  })
+}
+function copyBtn() {
+  let url = sognUrl.value
+  let oInput = document.createElement('input');
+  oInput.value = url;
+  document.body.appendChild(oInput);
+  oInput.select(); // 选择对象;
+  document.execCommand("Copy"); // 执行浏览器复制命令
+  ElMessage.success("复制成功")
+  document.body.removeChild(oInput);  //移除oInput 框
+}
+
+/**  重置表单 */
+function resetForm() {
+  formRef.value.resetFields();
+  formData.id = ''
+}
+
+/**关闭弹窗 */
+function closeDialog() {
+  dialogVisible.value = false
+  formRef.value.resetFields();
+  formData.id = undefined;
+}
+defineExpose({
+  dialogVisible,
+  dialogTitle,
+  getItemData,
+  resetForm
+})
+</script>
+<style scoped lang="scss">
+
+</style>

+ 191 - 0
src/views/store/runningPlatform/index.vue

@@ -0,0 +1,191 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-input @keyup.enter="handleSearch" class="w200px mr5px" v-model="queryForm.keyWord" placeholder="关键字搜索"/>
+      <el-button type="primary" @click="handleSearch">
+        <i-ep-search/>
+        搜索
+      </el-button>
+      <div class="w100px ml10px" style="display: inline-block;">
+        <el-checkbox style="position: absolute;top: 11px" v-model="disableLock" label="已禁用"
+                     border></el-checkbox>
+      </div>
+      <el-button @click="openDialog()" color="#11a983">
+        <i-ep-plus/>
+        增加
+      </el-button>
+      <el-button type="primary" @click="refreshTableInfo">
+        <i-ep-refresh/>
+      </el-button>
+    </div>
+    <div class="table-con">
+      <el-table
+          :max-height="tableHeight"
+          v-loading="loading"
+          :data="tableData"
+          highlight-current-row
+          border
+      >
+        <el-table-column label="操作" width="140">
+          <template #default="{row}">
+            <el-button link @click="openDialog(row.id)" type="primary">
+              <i-ep-edit/>
+              编辑
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            type="index"
+            label="#"
+            width="50">
+          <template #default="scope">
+            <span>{{ scope.$index + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="storeName" width="150" label="门店名称"/>
+        <el-table-column prop="brandName" width="150" label="品牌名称"/>
+        <el-table-column
+            prop="flag_DYLK"
+            label="抖音来客">
+          <template #default="{row}">
+            <el-button size="small" v-if="row.flag_DYLK==1" type="success">
+              已授权
+            </el-button>
+            <el-button @click="openDialog(row,'DYLK','抖音来客')" size="small" v-else="row.flag_DYLK==0" type="info">
+              未授权
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="flag_MTWM"
+            label="美团外卖">
+          <template #default="{row}">
+            <el-button size="small" v-if="row.flag_MTWM==1" type="success">
+              已授权
+            </el-button>
+            <el-button @click="openDialog(row,'MTWM','美团外卖')" size="small" v-else="row.flag_MTWM==0" type="info">
+              未授权
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="flag_ELMLS"
+            label="饿了么零售">
+          <template #default="{row}">
+            <el-button size="small" v-if="row.flag_ELMLS==1" type="success">
+              已授权
+            </el-button>
+            <el-button @click="openDialog(row,'ELMLS','饿了么零售')" size="small" v-else="row.flag_ELMLS==0" type="info">
+              未授权
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="flag_MEITUAN"
+            label="美团闪购">
+          <template #default="{row}">
+            <el-button size="small" v-if="row.flag_MEITUAN==1" type="success">
+              已授权
+            </el-button>
+            <el-button @click="openDialog(row,'MEITUAN','美团闪购')" size="small" v-else="row.flag_MEITUAN==0" type="info">
+              未授权
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="flag_SFTC"
+            label="顺丰同城">
+          <template #default="{row}">
+            <el-button size="small" v-if="row.flag_SFTC==1" type="success">
+              已授权
+            </el-button>
+            <el-button @click="openDialog(row,'SFTC','顺丰同城')" size="small" v-else="row.flag_SFTC==0" type="info">
+              未授权
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="flag_DDPT"
+            label="达达跑腿">
+          <template #default="{row}">
+            <el-button size="small" v-if="row.flag_DDPT==1" type="success">
+              已授权
+            </el-button>
+            <el-button @click="openDialog(row,'DDPT','达达跑腿')" size="small" v-else="row.flag_DDPT==0" type="info">
+              未授权
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="createTime"
+            label="创建时间"
+            width="155">
+          <template #default="{row}">
+          <span v-if="row.createTime">
+           {{ $filters.getTime(row.createTime) }}
+          </span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+          v-if="total > 0"
+          v-model:total="total"
+          v-model:page="queryPage.pageIndex"
+          v-model:limit="queryPage.pageSize"
+          @pagination="getTableData"
+      />
+    </div>
+    <child-dialog ref="childDialog" @dialogChange="dialogChange"></child-dialog>
+  </div>
+</template>
+<script setup lang="ts">
+import {queryStorePlatformList} from "@/api/store";
+import ChildDialog from './compt/childDialog.vue'
+import {useTable} from '@/hooks/useTable'
+
+let disableLock = ref('')
+const childDialog = ref<any>()
+
+//增加编辑
+function openDialog(row, platformCode,name) {
+  childDialog.value.dialogVisible = true;
+  childDialog.value.dialogTitle = "获取门店某平台授权信息-"+row.storeName;
+  nextTick(() => {
+    childDialog.value.getItemData(row, platformCode,name)
+  });
+}
+
+//禁用删除
+
+//修改成功后传递事件
+function dialogChange() {
+  getTableData()
+}
+
+const queryForm = reactive({
+  keyWord: '',
+  voidFlag: 0
+})
+watch(
+    () => disableLock.value,
+    (disableLock) => {
+      if (disableLock) {
+        queryForm.voidFlag = 1
+        getTableData()
+      } else {
+        queryForm.voidFlag = 0
+        getTableData()
+      }
+    }
+);
+const {
+  tableData,
+  queryPage,
+  total,
+  loading,
+  getTableData,
+  tableHeight,
+  handleSearch,//搜索
+  refreshTableInfo,//刷新
+} = useTable(queryStorePlatformList, queryForm);
+</script>

+ 80 - 11
src/views/store/storeList/compt/childDialog.vue

@@ -19,17 +19,43 @@
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
           <el-col :span="24">
           <el-col :span="24">
+            <el-form-item prop="contractPhone" label="门店账号/手机号">
+              <el-input v-model="formData.contractPhone"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
             <el-form-item prop="idBrand" label="选择品牌">
             <el-form-item prop="idBrand" label="选择品牌">
               <el-select v-model="formData.idBrand" placeholder="请选择" style="width: 320px">
               <el-select v-model="formData.idBrand" placeholder="请选择" style="width: 320px">
                 <el-option
                 <el-option
                     v-for="type in optionsList"
                     v-for="type in optionsList"
-                    :key="type.storeInfo.id"
-                    :label="type.storeInfo"
-                    :value="type.storeInfo">
+                    :key="type.id"
+                    :label="type.brandName"
+                    :value="type.id">
                 </el-option>
                 </el-option>
               </el-select>
               </el-select>
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
+          <el-col :span="24">
+            <el-form-item prop="storeCodeInput" label="门店编码">
+              <el-input v-model="formData.storeCodeInput"/>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="24">
+            <el-form-item prop="" label="省市区">
+              <el-cascader
+                class="w320px"
+                :options="areaTree"
+                v-model="selectedOptions"
+                @change="handleChange">
+              </el-cascader>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item prop="storeAddress" label="详细地址">
+              <el-input v-model="formData.storeAddress"/>
+            </el-form-item>
+          </el-col>
         </el-row>
         </el-row>
 
 
       </el-form>
       </el-form>
@@ -44,16 +70,19 @@
   </div>
   </div>
 </template>
 </template>
 <script setup lang="ts">
 <script setup lang="ts">
-import {getViewStoreInfo, addStoreInfo, updateStoreInfo,queryStoreBrandList} from "@/api/store";
+import {getStoreInfo, addStoreInfo, updateStoreInfo,queryStoreBrandList} from "@/api/store";
 import type {FormInstance} from 'element-plus'
 import type {FormInstance} from 'element-plus'
 
 
 let dialogVisible = ref(false)
 let dialogVisible = ref(false)
 let dialogTitle = ref("")
 let dialogTitle = ref("")
 const formRef = ref<FormInstance>()
 const formRef = ref<FormInstance>()
 const emit = defineEmits(['dialogChange'])
 const emit = defineEmits(['dialogChange'])
+import areaData from '@/utils/area-data.ts';//地址数据
+let selectedOptions = ref([])
+let areaTree = ref([])
 const formData = reactive({
 const formData = reactive({
   storeName:'',
   storeName:'',
-  idBrand:0,
+  idBrand:'',
   brandName:'',
   brandName:'',
   deliverSettleKind:0,
   deliverSettleKind:0,
   storeCodeInput:'',
   storeCodeInput:'',
@@ -62,6 +91,7 @@ const formData = reactive({
   storeDistrict:'',
   storeDistrict:'',
   storeAddress:'',
   storeAddress:'',
   contractPhone:'',
   contractPhone:'',
+  loginAccount:'',
   id: ""
   id: ""
 })
 })
 const rules = reactive({
 const rules = reactive({
@@ -74,7 +104,23 @@ function handleSubmit() {
       const itemId = formData.id;
       const itemId = formData.id;
       if (itemId) {
       if (itemId) {
         //修改
         //修改
-        const postData = JSON.stringify(formData)
+        const data = {
+          id:formData.id,
+          storeName: formData.storeName,
+          idBrand: formData.idBrand,
+          idStoreType:1,
+          deliverSettleKind:0,
+          brandName: optionsList.value.find(x => x.id === formData.idBrand).brandName,
+          storeProvince: selectedOptions.value[0],
+          storeCity: selectedOptions.value[1],
+          storeDistrict: selectedOptions.value[2],
+          storeAddress: formData.storeAddress,
+          contractPhone: formData.contractPhone,
+          loginAccount: formData.contractPhone,
+          storeCodeInput: formData.storeCodeInput
+        }
+        console.log(data);
+        const postData = JSON.stringify(data)
         const params = {
         const params = {
           "storeInfo": postData
           "storeInfo": postData
         }
         }
@@ -86,8 +132,23 @@ function handleSubmit() {
           }
           }
         })
         })
       } else {
       } else {
+        const data = {
+          storeName: formData.storeName,
+          idBrand: formData.idBrand,
+          idStoreType:1,
+          deliverSettleKind:0,
+          brandName: optionsList.value.find(x => x.id === formData.idBrand).brandName,
+          storeProvince: selectedOptions.value[0],
+          storeCity: selectedOptions.value[1],
+          storeDistrict: selectedOptions.value[2],
+          storeAddress: formData.storeAddress,
+          contractPhone: formData.contractPhone,
+          loginAccount: formData.contractPhone,
+          storeCodeInput: formData.storeCodeInput
+        }
+        console.log(data);
         //增加
         //增加
-        const postData = JSON.stringify(formData)
+        const postData = JSON.stringify(data)
         const params = {
         const params = {
           "storeInfo": postData
           "storeInfo": postData
         }
         }
@@ -116,7 +177,8 @@ function getOptionsList() {
   queryStoreBrandList(data).then((response) => {
   queryStoreBrandList(data).then((response) => {
     if (response.httpCode == 200) {
     if (response.httpCode == 200) {
       const { data } = response
       const { data } = response
-      optionsList.value = JSON.parse(data)
+      optionsList.value = data
+      console.log(optionsList.value);
     }
     }
   })
   })
 }
 }
@@ -124,20 +186,27 @@ function getItemData(item) {
   const data = {
   const data = {
     idStore: item
     idStore: item
   }
   }
-  getViewStoreInfo(data).then(response => {
+  getStoreInfo(data).then(response => {
     if (response.httpCode == 200) {
     if (response.httpCode == 200) {
       const data = response.data
       const data = response.data
       Object.assign(formData, {...data});
       Object.assign(formData, {...data});
     }
     }
   })
   })
 }
 }
-
+function handleChange (value) {
+  selectedOptions.value = value
+}
 /**  重置表单 */
 /**  重置表单 */
 function resetForm() {
 function resetForm() {
   formRef.value.resetFields();
   formRef.value.resetFields();
   formData.id = ''
   formData.id = ''
 }
 }
-
+onMounted(() => {
+  areaTree.value = areaData.pcaTextArr;
+  if(optionsList.value.length<=0){
+    getOptionsList()
+  }
+})
 /**关闭弹窗 */
 /**关闭弹窗 */
 function closeDialog() {
 function closeDialog() {
   dialogVisible.value = false
   dialogVisible.value = false

+ 63 - 13
src/views/store/storeList/index.vue

@@ -12,7 +12,7 @@
       </div>
       </div>
       <el-button @click="openDialog()" color="#11a983">
       <el-button @click="openDialog()" color="#11a983">
         <i-ep-plus/>
         <i-ep-plus/>
-        增加门店品牌
+        增加门店
       </el-button>
       </el-button>
       <el-button type="primary" @click="refreshTableInfo">
       <el-button type="primary" @click="refreshTableInfo">
         <i-ep-refresh/>
         <i-ep-refresh/>
@@ -26,14 +26,24 @@
           highlight-current-row
           highlight-current-row
           border
           border
       >
       >
-        <el-table-column label="操作" width="140">
+        <el-table-column label="操作" width="280">
           <template #default="{row}">
           <template #default="{row}">
             <el-button link @click="openDialog(row.id)" type="primary">
             <el-button link @click="openDialog(row.id)" type="primary">
               <i-ep-edit/>
               <i-ep-edit/>
               编辑
               编辑
             </el-button>
             </el-button>
-            <el-button v-if="row.storeInfo.voidFlag==0" link @click="handleDisable(row.id,1)" type="warning">禁用</el-button>
-            <el-button v-if="row.storeInfo.voidFlag==1" type="success" link @click="handleDisable(row.id,0)">启用</el-button>
+            <el-button v-if="row.voidFlag==0" link @click="handleDisable(row.id,1)" type="warning">
+              禁用
+            </el-button>
+            <el-button v-if="row.voidFlag==1" type="success" link @click="handleDisable(row.id,0)">
+              启用
+            </el-button>
+            <el-button link type="primary">
+              开票信息
+            </el-button>
+            <el-button @click="getAuthUrl(row.id)" link type="primary">
+              授权地址
+            </el-button>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column
         <el-table-column
@@ -46,22 +56,32 @@
         </el-table-column>
         </el-table-column>
         <el-table-column prop="storeName" width="150" label="门店名称">
         <el-table-column prop="storeName" width="150" label="门店名称">
           <template #default="{row}">
           <template #default="{row}">
-            {{row.storeInfo.storeName}}
+            {{ row.storeName }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="storeName" width="150" label="门店账号/手机号">
+          <template #default="{row}">
+            {{ row.loginAccount }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="storeCodeInput" width="150" label="门店编码">
+          <template #default="{row}">
+            {{ row.storeCodeInput }}
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column prop="storeName" width="150" label="门店品牌">
         <el-table-column prop="storeName" width="150" label="门店品牌">
           <template #default="{row}">
           <template #default="{row}">
-            {{row.storeInfo.brandName}}
+            {{ row.brandName }}
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column prop="storeName" width="150" label="联系电话">
         <el-table-column prop="storeName" width="150" label="联系电话">
           <template #default="{row}">
           <template #default="{row}">
-            {{row.storeInfo.contractPhone}}
+            {{ row.contractPhone }}
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column prop="storeName" show-overflow-tooltip width="350" label="地址">
         <el-table-column prop="storeName" show-overflow-tooltip width="350" label="地址">
           <template #default="{row}">
           <template #default="{row}">
-            {{row.storeInfo.storeProvince}}{{row.storeInfo.storeDistrict}}{{row.storeInfo.storeAddress}}
+            {{ row.storeProvince }}{{ row.storeDistrict }}{{ row.storeAddress }}
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column
         <el-table-column
@@ -82,7 +102,7 @@
             width="155">
             width="155">
           <template #default="{row}">
           <template #default="{row}">
           <span v-if="row.createTime">
           <span v-if="row.createTime">
-           {{ $filters.getTime(row.createTime)}}
+           {{ $filters.getTime(row.createTime) }}
           </span>
           </span>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
@@ -99,13 +119,43 @@
   </div>
   </div>
 </template>
 </template>
 <script setup lang="ts">
 <script setup lang="ts">
-import {queryViewStoreInfo,voidStoreBrand} from "@/api/store";
+import {queryStoreInfoList, voidStoreInfo, generateStoreAuthUrl_Douyin} from "@/api/store";
 import ChildDialog from './compt/childDialog.vue'
 import ChildDialog from './compt/childDialog.vue'
 import {useTable} from '@/hooks/useTable'
 import {useTable} from '@/hooks/useTable'
 
 
 let disableLock = ref('')
 let disableLock = ref('')
 const childDialog = ref<any>()
 const childDialog = ref<any>()
 
 
+function getAuthUrl(id) {
+  const params = {
+    idStore: id
+  }
+  generateStoreAuthUrl_Douyin(params).then((response) => {
+    if (response.httpCode == 200) {
+      const {data} = response
+      console.log(data);
+      ElMessageBox.alert(
+          '<p class="ellipsis">'+data.resultStr+'</p>',
+          '授权地址', {
+            // if you want to disable its autofocus
+            // autofocus: false,
+            confirmButtonText: '复制',
+            dangerouslyUseHTMLString: true,
+            callback: () => {
+              let url = data.resultStr;
+              let oInput = document.createElement('input');
+              oInput.value = url;
+              document.body.appendChild(oInput);
+              oInput.select(); // 选择对象;
+              document.execCommand("Copy"); // 执行浏览器复制命令
+              ElMessage.success("复制成功")
+              document.body.removeChild(oInput);  //移除oInput 框
+            },
+          })
+    }
+  })
+}
+
 //增加编辑
 //增加编辑
 function openDialog(item?: any) {
 function openDialog(item?: any) {
   childDialog.value.dialogVisible = true;
   childDialog.value.dialogVisible = true;
@@ -136,9 +186,9 @@ function handleDisable(id, status) {
       voidFlag: status
       voidFlag: status
     }
     }
     const params = {
     const params = {
-      "storeBrand": JSON.stringify(postData)
+      "storeInfo": JSON.stringify(postData)
     }
     }
-    voidStoreBrand(params).then((response) => {
+    voidStoreInfo(params).then((response) => {
       if (response.httpCode == 200) {
       if (response.httpCode == 200) {
         ElMessage.success("操作成功");
         ElMessage.success("操作成功");
         getTableData();
         getTableData();
@@ -178,6 +228,6 @@ const {
   tableHeight,
   tableHeight,
   handleSearch,//搜索
   handleSearch,//搜索
   refreshTableInfo,//刷新
   refreshTableInfo,//刷新
-} = useTable(queryViewStoreInfo, queryForm);
+} = useTable(queryStoreInfoList, queryForm);
 </script>
 </script>
 
 

+ 1 - 1
vite.config.ts

@@ -54,7 +54,7 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
           // // 线上接口地址
           // // 线上接口地址
           // target: "http://vapi.youlai.tech",
           // target: "http://vapi.youlai.tech",
           // 开发接口地址
           // 开发接口地址
-          target: "http://192.168.1.44:12991",//24涛哥//44春禾//25小梁
+          target: "http://192.168.1.24:12991",//24涛哥//44春禾//25小梁
           rewrite: (path) =>
           rewrite: (path) =>
             path.replace(new RegExp("^" + env.VITE_APP_BASE_API), ""),
             path.replace(new RegExp("^" + env.VITE_APP_BASE_API), ""),
         },
         },