Sfoglia il codice sorgente

修改bug及公共部分链接

yangg 1 anno fa
parent
commit
5d20dea794
9 ha cambiato i file con 32 aggiunte e 11 eliminazioni
  1. 1 1
      .env
  2. 1 0
      .env.dev
  3. 1 1
      .env.development
  4. 1 1
      .env.test
  5. 1 1
      src/api/api.ts
  6. 1 1
      src/main.ts
  7. 2 1
      src/utils/axios.ts
  8. 8 5
      src/views/InoutStorage/inStorage.vue
  9. 16 0
      vite.config.ts

+ 1 - 1
.env

@@ -1 +1 @@
-VITE_API_URL=http://192.168.8.103:9999
+VITE_API_URL = https://api.v3rental.com

+ 1 - 0
.env.dev

@@ -0,0 +1 @@
+VUE_APP_IMAGE_HOST = https://api.v3rental.com

+ 1 - 1
.env.development

@@ -1 +1 @@
-VITE_API_URL=http://192.168.8.103:9999
+VITE_API_URL=https://api.v3rental.com

+ 1 - 1
.env.test

@@ -1 +1 @@
-VITE_API_URL=http://192.168.8.103:9999
+VITE_API_URL=https://api.v3rental.com

+ 1 - 1
src/api/api.ts

@@ -10,7 +10,7 @@ export class UserService {       // 模块一
      * @return {HttpResponse} result
      */
     static async login1(uuid) {   // 获取验证码
-        return  `https://apidoc.raycos.net/captchas/${uuid}/LOGIN?rmd=${new Date().getTime()}`
+        return  `${import.meta.env.VITE_API_URL}/captchas/${uuid}/LOGIN?rmd=${new Date().getTime()}`
     }
     static async login(params) {   // 登录
         params.password = Md5.hashStr(params.password)

+ 1 - 1
src/main.ts

@@ -3,7 +3,7 @@ import App from '@/App.vue';
 import axios from 'axios';
 const app = createApp(App);
 // 设置 axios 基础 URL
-console.log(import.meta.env.VITE_API_URL);
+console.log(import.meta.env.VUE_APP_IMAGE_HOST);
 //axios.defaults.baseURL = import.meta.env.VITE_API_URL;
 // 将 axios 实例添加到 Vue 的全局属性中,使其在所有组件中可通过 this.$axios 访问
 app.config.globalProperties.$axios = axios;

+ 2 - 1
src/utils/axios.ts

@@ -7,9 +7,10 @@ import router from '@/router'
 // 设置接口超时时间
 axios.defaults.timeout = 60000;
 
+console.log(import.meta.env.VITE_API_URL);
 // 请求地址,这里是动态赋值的的环境变量,下一篇会细讲,这里跳过
 // @ts-ignore
-axios.defaults.baseURL = 'https://apidoc.raycos.net'//import.meta.env.VITE_API_URL; http://192.168.8.103:9999  https://apidoc.raycos.net
+axios.defaults.baseURL = import.meta.env.VITE_API_URL//import.meta.env.VITE_API_URL; http://192.168.8.103:9999  https://apidoc.raycos.net
 
 // 请求拦截器
 axios.interceptors.request.use(function (config) {

+ 8 - 5
src/views/InoutStorage/inStorage.vue

@@ -36,7 +36,8 @@
                         </span>
                     </template>
                 </el-table-column>
-                <el-table-column prop="orderNum" label="待入库数量" />
+                <el-table-column prop="orderNum" label="待入库数量"
+                    v-if="goodsExchangeAddForm.type == 'TRANSFER_ENTRY' || goodsExchangeAddForm.type == 'HAIL_ENTRY' || goodsExchangeAddForm.type == 'SALE_AFTER'" />
             </el-table>
         </el-form>
         <el-dialog v-model="dialogVisible" :modal=false title="扫码入库" :close-on-click-modal="false" top="80px"
@@ -165,7 +166,7 @@ const toSearch = async () => {
             } else {
                 ElMessage.warning("请扫描订单内的商品!")
             }
-            
+
         } else {
             index.value = indexs;
         }
@@ -207,8 +208,8 @@ const toSnCode = async () => {
             })
         }
         if (goodsExchangeAddForm.type == 'TRANSFER_ENTRY' || goodsExchangeAddForm.type == 'HAIL_ENTRY' || goodsExchangeAddForm.type == 'SALE_AFTER') {
-           if(goodsExchangeAddForm.product_list[index.value].num >=goodsExchangeAddForm.product_list[index.value].not_entry_num) return ElMessage.warning("录入数量大于未入库数量!")
-          }
+            if (goodsExchangeAddForm.product_list[index.value].num >= goodsExchangeAddForm.product_list[index.value].not_entry_num) return ElMessage.warning("录入数量大于未入库数量!")
+        }
         goodsExchangeAddForm.product_list[index.value].num = goodsExchangeAddForm.product_list[index.value].sn_code_list.length;
         snCodeForm.bar_code = "";
         nextTick(() => {
@@ -318,7 +319,9 @@ const init = async () => {
         await infoApi.skuRedis({ send_order_id: id.value, type: 'enter' }).then((response: any) => {
             res.data.product_list.map(el => {
                 el.orderNum = el.num
-                el.num = 0
+                if (res.data.type == 'TRANSFER_ENTRY' || res.data.type == 'HAIL_ENTRY' || res.data.type == 'SALE_AFTER') {
+                    el.num = 0
+                }
                 Object.keys(response.data).map(item => {
                     if (el.id == item) {
                         el.sn_code_list = response.data[item]

+ 16 - 0
vite.config.ts

@@ -20,6 +20,22 @@ export default defineConfig({
             include: path.resolve(__dirname, './src/locales/**'),
         }),
     ],
+    /*  // 配置前端服务地址和端口
+     server: {
+        host: '0.0.0.0',
+        port: 5173,
+        // 是否开启 https
+        https: false,
+        // 设置反向代理,跨域
+        proxy: {
+            '/api1': {
+                // 后台地址
+                target: 'http://127.0.0.1:8990/',
+                changeOrigin: true,
+                rewrite: path => path.replace(/^\/api1/, '')
+            },
+        }
+    }, */
     resolve: {
         alias: {
             '@': path.resolve(__dirname, './src'),