xuwenqiang1992 2 gadi atpakaļ
vecāks
revīzija
296e8eb54f

+ 1 - 1
src/api/store/index.ts

@@ -82,7 +82,7 @@ export function addStoreInfo(data) {
     });
 }
 
-//获取门店
+//获取门店列表
 export function queryViewStoreInfo(data) {
     return request({
         url: "/store/queryViewStoreInfo",

+ 1 - 2
src/views/baseInfo/platform/compt/childDialog.vue

@@ -31,7 +31,7 @@
             </el-form-item>
           </el-col>
           <el-col :span="24">
-            <el-form-item prop="requireList" label="平台编码">
+            <el-form-item prop="platformCode" label="平台编码">
               <el-select v-model="formData.platformCode" placeholder="请选择" style="width: 320px">
                 <el-option
                     v-for="type in callModuleOptions"
@@ -164,7 +164,6 @@ onMounted(() => {
   if(callModuleOptions.value.length<=0){
     getCallDoc()
   }
-
 })
 defineExpose({
   dialogVisible,

+ 6 - 6
src/views/store/storeBrand/index.vue

@@ -32,8 +32,8 @@
               <i-ep-edit/>
               编辑
             </el-button>
-            <el-button v-if="row.enable==1" link @click="handleDisable(row.id,0)" type="warning">禁用</el-button>
-            <el-button v-if="row.enable==0" type="success" link @click="handleDisable(row.id,1)">启用</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
@@ -47,7 +47,7 @@
         <el-table-column prop="brandName" width="150" label="品牌名称"/>
         <el-table-column prop="startingPrice" width="150" label="基础费用"/>
         <el-table-column prop="packagingFee" width="150" label="打包费用"/>
-        <el-table-column prop="brandMemo" width="150" label="备注"/>
+        <el-table-column prop="brandMemo" show-overflow-tooltip width="150" label="备注"/>
         <el-table-column
           prop="status"
           label="状态">
@@ -120,7 +120,7 @@ function handleDisable(id, status) {
       voidFlag: status
     }
     const params = {
-      "industryInfo": JSON.stringify(postData)
+      "storeBrand": JSON.stringify(postData)
     }
     voidStoreBrand(params).then((response) => {
       if (response.httpCode == 200) {
@@ -145,10 +145,10 @@ watch(
   () => disableLock.value,
   (disableLock) => {
     if (disableLock) {
-      queryForm.enable = 0
+      queryForm.voidFlag = 1
       getTableData()
     } else {
-      queryForm.enable = 1
+      queryForm.voidFlag = 0
       getTableData()
     }
   }

+ 86 - 8
src/views/store/storeList/compt/childDialog.vue

@@ -14,8 +14,20 @@
       >
         <el-row>
           <el-col :span="24">
-            <el-form-item prop="clientName" label="客户名称">
-              <el-input v-model="formData.clientName"/>
+            <el-form-item prop="storeName" label="门店名称">
+              <el-input v-model="formData.storeName"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item prop="idBrand" label="选择品牌">
+              <el-select v-model="formData.idBrand" placeholder="请选择" style="width: 320px">
+                <el-option
+                    v-for="type in optionsList"
+                    :key="type.storeInfo.id"
+                    :label="type.storeInfo"
+                    :value="type.storeInfo">
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
         </el-row>
@@ -32,7 +44,7 @@
   </div>
 </template>
 <script setup lang="ts">
-import {queryViewStoreInfo} from "@/api/store";
+import {getViewStoreInfo, addStoreInfo, updateStoreInfo,queryStoreBrandList} from "@/api/store";
 import type {FormInstance} from 'element-plus'
 
 let dialogVisible = ref(false)
@@ -40,18 +52,84 @@ let dialogTitle = ref("")
 const formRef = ref<FormInstance>()
 const emit = defineEmits(['dialogChange'])
 const formData = reactive({
-  clientName:'',
+  storeName:'',
+  idBrand:0,
+  brandName:'',
+  deliverSettleKind:0,
+  storeCodeInput:'',
+  storeProvince:'',
+  storeCity:'',
+  storeDistrict:'',
+  storeAddress:'',
+  contractPhone:'',
   id: ""
 })
 const rules = reactive({
-  clientName: [{required: true, message: "请输入客户名称", trigger: "blur"}],
+  storeName: [{required: true, message: "请输入名称", trigger: "blur"}],
 });
+let optionsList = ref(new Array<any>())
 function handleSubmit() {
-
+  formRef.value.validate((valid: any) => {
+    if (valid) {
+      const itemId = formData.id;
+      if (itemId) {
+        //修改
+        const postData = JSON.stringify(formData)
+        const params = {
+          "storeInfo": postData
+        }
+        updateStoreInfo(params).then((response) => {
+          dialogVisible.value = false
+          if (response.httpCode == 200) {
+            emit('dialogChange');
+            ElMessage.success("操作成功");
+          }
+        })
+      } else {
+        //增加
+        const postData = JSON.stringify(formData)
+        const params = {
+          "storeInfo": postData
+        }
+        addStoreInfo(params).then((response) => {
+          dialogVisible.value = false
+          if (response.httpCode == 200) {
+            emit('dialogChange');
+            ElMessage.success("操作成功");
+          }
+        })
+      }
+    }
+  });
+}
+function getOptionsList() {
+  const page = {
+    pageIndex: 1,
+    pageSize: 100
+  };
+  const data = {
+    'params': JSON.stringify({
+      'voidFlag': 0
+    }),
+    "page": JSON.stringify(page)
+  }
+  queryStoreBrandList(data).then((response) => {
+    if (response.httpCode == 200) {
+      const { data } = response
+      optionsList.value = JSON.parse(data)
+    }
+  })
 }
-
 function getItemData(item) {
-
+  const data = {
+    idStore: item
+  }
+  getViewStoreInfo(data).then(response => {
+    if (response.httpCode == 200) {
+      const data = response.data
+      Object.assign(formData, {...data});
+    }
+  })
 }
 
 /**  重置表单 */

+ 56 - 28
src/views/store/storeList/index.vue

@@ -12,7 +12,7 @@
       </div>
       <el-button @click="openDialog()" color="#11a983">
         <i-ep-plus/>
-        增加门店
+        增加门店品牌
       </el-button>
       <el-button type="primary" @click="refreshTableInfo">
         <i-ep-refresh/>
@@ -20,6 +20,8 @@
     </div>
     <div class="table-con">
       <el-table
+          :max-height="tableHeight"
+          v-loading="loading"
           :data="tableData"
           highlight-current-row
           border
@@ -30,8 +32,8 @@
               <i-ep-edit/>
               编辑
             </el-button>
-            <el-button v-if="row.enable==1" link @click="handleDisable(row.id,0)" type="warning">禁用</el-button>
-            <el-button v-if="row.enable==0" type="success" link @click="handleDisable(row.id,1)">启用</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>
           </template>
         </el-table-column>
         <el-table-column
@@ -66,10 +68,10 @@
             prop="status"
             label="状态">
           <template #default="{row}">
-            <el-tag v-if="row.storeInfo.voidFlag==0" type="success">
+            <el-tag v-if="row.voidFlag==0" type="success">
               正常
             </el-tag>
-            <el-tag v-else="row.storeInfo.voidFlag==1" type="danger">
+            <el-tag v-else="row.voidFlag==1" type="danger">
               停用
             </el-tag>
           </template>
@@ -85,17 +87,25 @@
           </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>-->
+    <child-dialog ref="childDialog" @dialogChange="dialogChange"></child-dialog>
   </div>
 </template>
 <script setup lang="ts">
-import {queryViewStoreInfo} from "@/api/store";
-// import ChildDialog from './compt/childDialog.vue'
+import {queryViewStoreInfo,voidStoreBrand} from "@/api/store";
+import ChildDialog from './compt/childDialog.vue'
+import {useTable} from '@/hooks/useTable'
 
 let disableLock = ref('')
 const childDialog = ref<any>()
-let tableData = ref([])
+
 //增加编辑
 function openDialog(item?: any) {
   childDialog.value.dialogVisible = true;
@@ -113,43 +123,61 @@ function openDialog(item?: any) {
 
   }
 }
-function getTableData() {
-  const params = {}
-  queryViewStoreInfo(params).then((response) => {
-    if (response.httpCode == 200) {
-      const { data } = response
-      console.log(data);
-      tableData.value = data
-    }
-  })
-}
-function handleSearch() {
 
-}
+//禁用删除
 function handleDisable(id, status) {
+  ElMessageBox.confirm("确认操作?", "警告", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(() => {
+    const postData = {
+      id: id,
+      voidFlag: status
+    }
+    const params = {
+      "storeBrand": JSON.stringify(postData)
+    }
+    voidStoreBrand(params).then((response) => {
+      if (response.httpCode == 200) {
+        ElMessage.success("操作成功");
+        getTableData();
+      }
 
+    })
+  })
 }
-function refreshTableInfo() {
 
+//修改成功后传递事件
+function dialogChange() {
+  getTableData()
 }
-onMounted(() => {
-  getTableData();
-});
+
 const queryForm = reactive({
   keyWord: '',
-  enable: 1
+  voidFlag: 0
 })
 watch(
     () => disableLock.value,
     (disableLock) => {
       if (disableLock) {
-        queryForm.enable = 0
+        queryForm.voidFlag = 1
         getTableData()
       } else {
-        queryForm.enable = 1
+        queryForm.voidFlag = 0
         getTableData()
       }
     }
 );
+const {
+  tableData,
+  queryPage,
+  total,
+  loading,
+  getTableData,
+  tableHeight,
+  handleSearch,//搜索
+  refreshTableInfo,//刷新
+} = useTable(queryViewStoreInfo, queryForm);
 </script>
 

+ 1 - 1
vite.config.ts

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