sunlupeng hace 7 meses
padre
commit
a478fffe43

+ 4 - 4
config/dev.env.js

@@ -2,12 +2,12 @@ module.exports = {
 	NODE_ENV: '"development"',
 	ENV_CONFIG: '"dev"',
   // 本地数据库:登录用户名 admin123,密码 admin123
-  // BASE_API: '"http://192.168.100.188:9085/admin"',
-  // OS_API: '"http://192.168.100.188:9085/admin"',
+  BASE_API: '"http://192.168.100.188:9085/admin"',
+  OS_API: '"http://192.168.100.188:9085/admin"',
   // BASE_API: '"http://47.103.79.143:9085/admin"',
   // OS_API: '"http://47.103.79.143:9085/admin"',
-  OS_API: '"https://xiaoyou.dgtis.com/admin"',
-  BASE_API: '"https://xiaoyou.dgtis.com/admin"',
+  // OS_API: '"https://xiaoyou.dgtis.com/admin"',
+  // BASE_API: '"https://xiaoyou.dgtis.com/admin"',
   
   
   

+ 12 - 12
src/api/express.js

@@ -1,48 +1,48 @@
 import request from '@/utils/request'
 
-export function listBrand(query) {
+export function listExpress(query) {
   return request({
-    url: '/brand/list',
+    url: 'logistics-company/page',
     method: 'get',
     params: query
   })
 }
 
-export function createBrand(data) {
+export function createExpress(data) {
   return request({
-    url: '/brand/create',
+    url: 'logistics-company/add',
     method: 'post',
     data
   })
 }
 
-export function readBrand(data) {
+export function readExpress(data) {
   return request({
-    url: '/brand/read',
+    url: 'logistics-company/info',
     method: 'get',
     data
   })
 }
 
-export function updateBrand(data) {
+export function updateExpress(data) {
   return request({
-    url: '/brand/update',
+    url: 'logistics-company/edit',
     method: 'post',
     data
   })
 }
 
-export function deleteBrand(data) {
+export function deleteExpress(query) {
   return request({
-    url: '/brand/delete',
+    url: 'logistics-company/remove',
     method: 'post',
-    data
+    params:query
   })
 }
 
 export function setState(query) {
   return request({
-    url: '/brand/status',
+    url: 'logistics-company/updateStatus',
     method: 'post',
     params:query
   })

+ 11 - 11
src/api/store.js

@@ -1,41 +1,41 @@
 import request from '@/utils/request'
 
-export function listBrand(query) {
+export function listStore(query) {
   return request({
-    url: '/brand/list',
+    url: '/store-info/page',
     method: 'get',
     params: query
   })
 }
 
-export function createBrand(data) {
+export function createStore(data) {
   return request({
-    url: '/brand/create',
+    url: '/store-info/add',
     method: 'post',
     data
   })
 }
 
-export function readBrand(data) {
+export function readStore(data) {
   return request({
-    url: '/brand/read',
+    url: '/store-info/info',
     method: 'get',
     data
   })
 }
 
-export function updateBrand(data) {
+export function updateStore(data) {
   return request({
-    url: '/brand/update',
+    url: '/store-info/edit',
     method: 'post',
     data
   })
 }
 
-export function deleteBrand(data) {
+export function deleteStore(query) {
   return request({
-    url: '/brand/delete',
+    url: '/store-info/remove',
     method: 'post',
-    data
+    params:query
   })
 }

+ 11 - 11
src/api/warehouse.js

@@ -1,41 +1,41 @@
 import request from '@/utils/request'
 
-export function listBrand(query) {
+export function listWarehouse(query) {
   return request({
-    url: '/brand/list',
+    url: '/warehouse-info/page',
     method: 'get',
     params: query
   })
 }
 
-export function createBrand(data) {
+export function createWarehouse(data) {
   return request({
-    url: '/brand/create',
+    url: '/warehouse-info/add',
     method: 'post',
     data
   })
 }
 
-export function readBrand(data) {
+export function readWarehouse(data) {
   return request({
-    url: '/brand/read',
+    url: '/warehouse-info/info',
     method: 'get',
     data
   })
 }
 
-export function updateBrand(data) {
+export function updateWarehouse(data) {
   return request({
-    url: '/brand/update',
+    url: '/warehouse-info/edit',
     method: 'post',
     data
   })
 }
 
-export function deleteBrand(data) {
+export function deleteWarehouse(query) {
   return request({
-    url: '/brand/delete',
+    url: '/warehouse-info/remove',
     method: 'post',
-    data
+    params:query
   })
 }

+ 29 - 20
src/views/basicSetting/express.vue

@@ -12,7 +12,7 @@ rookieCode<template>
       <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleQuery">查找</el-button>
       <el-button class="filter-item" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       <el-button class="filter-item" type="primary" icon="el-icon-plus" @click="handleCreate">添加</el-button>
-      <el-button class="filter-item" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button>
+      <!-- <el-button class="filter-item" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button> -->
     </div>
 
     <!-- 查询结果 -->
@@ -43,10 +43,10 @@ rookieCode<template>
       <el-table-column align="center" label="操作" width="250" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button type="primary" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
-          <el-button v-if="scope.row.status == 0" type="success" size="small"
-                        @click="changeState(scope.row.id, 1)">启用</el-button>
-          <el-button v-if="scope.row.status == 1" type="warning" size="small"
-                        @click="changeState(scope.row.id, 0)">停用</el-button>
+          <el-button v-if="scope.row.status == 1" type="success" size="small"
+                        @click="changeState(scope.row.id, scope.row.status)">启用</el-button>
+          <el-button v-if="scope.row.status == 0" type="warning" size="small"
+                        @click="changeState(scope.row.id, scope.row.status)">停用</el-button>
           <el-button type="danger" size="small" @click="handleDelete(scope.row)">删除</el-button>
         </template>
       </el-table-column>
@@ -88,7 +88,7 @@ rookieCode<template>
   </div>
 </template>
 <script>
-import { listBrand, createBrand, updateBrand, deleteBrand, setState } from '@/api/express'
+import { listExpress, createExpress, updateExpress, deleteExpress, setState } from '@/api/express'
 import waves from '@/directive/waves' // 水波纹指令
 
 export default {
@@ -149,7 +149,7 @@ export default {
     },
     getList() {
       this.listLoading = true
-      listBrand(this.listQuery).then(response => {
+      listExpress(this.listQuery).then(response => {
         this.list = response.data.data.items
         this.total = response.data.data.total
         this.listLoading = false
@@ -190,7 +190,7 @@ export default {
     createData() {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
-          createBrand(this.dataForm).then(response => {
+          createExpress(this.dataForm).then(response => {
             this.list.unshift(response.data.data)
             this.dialogFormVisible = false
             this.$notify({
@@ -199,6 +199,7 @@ export default {
               type: 'success',
               duration: 2000
             })
+            this.getList()
           })
         }
       })
@@ -214,7 +215,7 @@ export default {
     updateData() {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
-          updateBrand(this.dataForm).then(() => {
+          updateExpress(this.dataForm).then(() => {
             for (const v of this.list) {
               if (v.id === this.dataForm.id) {
                 const index = this.list.indexOf(v)
@@ -229,27 +230,35 @@ export default {
               type: 'success',
               duration: 2000
             })
+            this.getList()
           })
         }
       })
     },
     handleDelete(row) {
-      deleteBrand(row).then(response => {
-        this.$notify({
-          title: '成功',
-          message: '删除成功',
-          type: 'success',
-          duration: 2000
+      this.$confirm('确认删除吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          deleteExpress({id:row.id}).then(response => {
+            this.$notify({
+              title: '成功',
+              message: '删除成功',
+              type: 'success',
+              duration: 2000
+            })
+            this.getList()
+          })
+        }).catch(() => {
+  
         })
-        const index = this.list.indexOf(row)
-        this.list.splice(index, 1)
-      })
     },
     handleDownload() {
       window.location.href = process.env.BASE_API + '/product/export';
     },
-    changeState(id, index) {
-            setState({ id: id, status: index }).then(response => {
+    changeState(id, status) {
+            setState({ id: id, status: status }).then(response => {
                 this.$notify({
                     title: '成功',
                     message: '状态修改成功',

+ 23 - 14
src/views/basicSetting/store.vue

@@ -12,7 +12,7 @@ contactsId<template>
       <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleQuery">查找</el-button>
       <el-button class="filter-item" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       <el-button class="filter-item" type="primary" icon="el-icon-plus" @click="handleCreate">添加</el-button>
-      <el-button class="filter-item" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button>
+      <!-- <el-button class="filter-item" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button> -->
     </div>
 
     <!-- 查询结果 -->
@@ -93,7 +93,7 @@ contactsId<template>
   </div>
 </template>
 <script>
-import { listBrand, createBrand, updateBrand, deleteBrand } from '@/api/store'
+import { listStore, createStore, updateStore, deleteStore } from '@/api/store'
 import waves from '@/directive/waves' // 水波纹指令
 
 export default {
@@ -150,7 +150,7 @@ export default {
     },
     getList() {
       this.listLoading = true
-      listBrand(this.listQuery).then(response => {
+      listStore(this.listQuery).then(response => {
         this.list = response.data.data.items
         this.total = response.data.data.total
         this.listLoading = false
@@ -193,7 +193,7 @@ export default {
     createData() {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
-          createBrand(this.dataForm).then(response => {
+          createStore(this.dataForm).then(response => {
             this.list.unshift(response.data.data)
             this.dialogFormVisible = false
             this.$notify({
@@ -202,6 +202,7 @@ export default {
               type: 'success',
               duration: 2000
             })
+            this.getList()
           })
         }
       })
@@ -217,7 +218,7 @@ export default {
     updateData() {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
-          updateBrand(this.dataForm).then(() => {
+          updateStore(this.dataForm).then(() => {
             for (const v of this.list) {
               if (v.id === this.dataForm.id) {
                 const index = this.list.indexOf(v)
@@ -232,21 +233,29 @@ export default {
               type: 'success',
               duration: 2000
             })
+            this.getList()
           })
         }
       })
     },
     handleDelete(row) {
-      deleteBrand(row).then(response => {
-        this.$notify({
-          title: '成功',
-          message: '删除成功',
-          type: 'success',
-          duration: 2000
+      this.$confirm('确认删除吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          deleteStore({id:row.id}).then(response => {
+            this.$notify({
+              title: '成功',
+              message: '删除成功',
+              type: 'success',
+              duration: 2000
+            })
+            this.getList()
+          })
+        }).catch(() => {
+  
         })
-        const index = this.list.indexOf(row)
-        this.list.splice(index, 1)
-      })
     },
     handleDownload() {
       window.location.href = process.env.BASE_API + '/product/export';

+ 23 - 14
src/views/basicSetting/warehouse.vue

@@ -12,7 +12,7 @@ adminId<template>
       <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleQuery">查找</el-button>
       <el-button class="filter-item" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       <el-button class="filter-item" type="primary" icon="el-icon-plus" @click="handleCreate">添加</el-button>
-      <el-button class="filter-item" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button>
+      <!-- <el-button class="filter-item" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button> -->
     </div>
 
     <!-- 查询结果 -->
@@ -90,7 +90,7 @@ adminId<template>
   </div>
 </template>
 <script>
-import { listBrand, createBrand, updateBrand, deleteBrand } from '@/api/warehouse'
+import { listWarehouse, createWarehouse, updateWarehouse, deleteWarehouse } from '@/api/warehouse'
 import waves from '@/directive/waves' // 水波纹指令
 
 export default {
@@ -147,7 +147,7 @@ export default {
     },
     getList() {
       this.listLoading = true
-      listBrand(this.listQuery).then(response => {
+      listWarehouse(this.listQuery).then(response => {
         this.list = response.data.data.items
         this.total = response.data.data.total
         this.listLoading = false
@@ -190,7 +190,7 @@ export default {
     createData() {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
-          createBrand(this.dataForm).then(response => {
+          createWarehouse(this.dataForm).then(response => {
             this.list.unshift(response.data.data)
             this.dialogFormVisible = false
             this.$notify({
@@ -199,6 +199,7 @@ export default {
               type: 'success',
               duration: 2000
             })
+            this.getList()
           })
         }
       })
@@ -214,7 +215,7 @@ export default {
     updateData() {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
-          updateBrand(this.dataForm).then(() => {
+          updateWarehouse(this.dataForm).then(() => {
             for (const v of this.list) {
               if (v.id === this.dataForm.id) {
                 const index = this.list.indexOf(v)
@@ -229,21 +230,29 @@ export default {
               type: 'success',
               duration: 2000
             })
+            this.getList()
           })
         }
       })
     },
     handleDelete(row) {
-      deleteBrand(row).then(response => {
-        this.$notify({
-          title: '成功',
-          message: '删除成功',
-          type: 'success',
-          duration: 2000
+      this.$confirm('确认删除吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          deleteWarehouse({id:row.id}).then(response => {
+            this.$notify({
+              title: '成功',
+              message: '删除成功',
+              type: 'success',
+              duration: 2000
+            })
+            this.getList()
+          })
+        }).catch(() => {
+  
         })
-        const index = this.list.indexOf(row)
-        this.list.splice(index, 1)
-      })
     },
     handleDownload() {
       window.location.href = process.env.BASE_API + '/product/export';

+ 11 - 11
src/views/goodsManage/goodsList.vue

@@ -179,7 +179,7 @@ categoryOptions<template>
                         <el-form-item label="陈华年份">
                             <el-input v-model="dataForm.teaAgingYear" placeholder="输入陈华年份"></el-input>
                         </el-form-item>
-                        <el-form-item label="溯源信息" prop="teaFileUrl">
+                        <el-form-item label="溯源信息" prop="teaFiles">
                             <el-upload :limit="1" :action="fileImgUrl" :file-list="dataForm.files" :on-success="handleFileSuccess"
                                 :before-upload="beforeUploadFile" :on-remove="handleRemoveFile">
                                 <el-button size="small" type="primary">点击上传</el-button>
@@ -276,7 +276,7 @@ export default {
                 teaGuaranteeUnit: '年',
                 productDate: undefined,
                 teaAgingYear: undefined,
-                teaFileUrl: undefined,
+                teaFiles: undefined,
                 files: [],
                 teaStorageRequire: [],
             },
@@ -381,12 +381,12 @@ export default {
         },
         handleRemoveFile(file, fileList) {
             console.log(file, fileList);
-            let teaFileUrl = [];
+            let teaFiles = [];
             for (let i in fileList) {
                 let id = fileList[i].response.data.id;
-                teaFileUrl.push(id);
+                teaFiles.push(id);
             }
-            this.dataForm.teaFileUrl = teaFileUrl.join(",");
+            this.dataForm.teaFiles = teaFiles.join(",");
         },
         beforeUploadFile(file) {
             console.log(file);
@@ -402,7 +402,7 @@ export default {
             console.log("------", "==========");
             console.log("res = ", res);
 
-            let teaFileUrl = [];
+            let teaFiles = [];
             for (let i in fileList) {
                 let response = fileList[i].response;
                 if (response.errno && response.errno != "0") {
@@ -411,10 +411,10 @@ export default {
                 fileList.splice(i, 1);
                 } else {
                 let id = fileList[i].response.data.id;
-                teaFileUrl.push(id);
+                teaFiles.push(id);
                 }
             }
-            this.dataForm.teaFileUrl = teaFileUrl.join(",");
+            this.dataForm.teaFiles = teaFiles.join(",");
         },
         handleRemoveImg(file, fileList) {
             console.log(file, fileList);
@@ -478,7 +478,7 @@ export default {
                 teaGuaranteeUnit: '年',
                 productDate: undefined,
                 teaAgingYear: undefined,
-                teaFileUrl: undefined,
+                teaFiles: undefined,
                 files: [],
                 teaStorageRequire: [],
             };
@@ -531,8 +531,8 @@ export default {
                     });
                 }
             }
-            if (this.dataForm.teaFileUrl) {
-                let files = this.dataForm.teaFileUrl;
+            if (this.dataForm.teaFiles) {
+                let files = this.dataForm.files;
                 this.dataForm.files = [];
                 for (let i in files) {
                     let url = files[i].url;