Jelajahi Sumber

1.环境变量。2.叫料历史。

jiaxiaoqiang 11 bulan lalu
induk
melakukan
b31e76a5b7

+ 0 - 2
.env.development

@@ -10,8 +10,6 @@ VITE_APP_BASE_API = '/dev-api'
 # 上传文件接口地址
 VITE_APP_UPLOAD_URL = 'http://192.168.101.4:9000'
 
-# 线上接口地址
-# VITE_APP_API_URL = http://vapi.youlai.tech
 # 开发接口地址
 VITE_APP_API_URL = 'http://192.168.101.4:8079'
 # Websocket地址

+ 7 - 1
.env.production

@@ -4,6 +4,12 @@ NODE_ENV='production'
 # 代理前缀 三江环境
 VITE_APP_BASE_API = '/client-server'
 
+# 上传文件接口地址
+VITE_APP_UPLOAD_URL = 'http://192.168.101.4:9000'
+
+# 开发接口地址
+VITE_APP_API_URL = 'http://192.168.101.4:8079'
+
 
 # Websocket地址
-VITE_WEBSOCKET_URL = 'ws://192.168.101.4:8079'
+VITE_WEBSOCKET_URL = 'ws://192.168.101.4:8079'

+ 8 - 2
.env.test

@@ -1,8 +1,14 @@
-## 生产环境
+## 测试环境
 NODE_ENV='test'
 
 # 代理前缀 测试环境
 VITE_APP_BASE_API = '/prod-api'
 
+# 上传文件接口地址
+VITE_APP_UPLOAD_URL = 'http://192.168.101.4:9000'
+
+# 开发接口地址
+VITE_APP_API_URL = 'http://192.168.101.4:8079'
+
 # Websocket地址
-VITE_WEBSOCKET_URL = 'ws://192.168.101.4:8079'
+VITE_WEBSOCKET_URL = 'ws://192.168.101.4:8079'

+ 9 - 0
src/api/process/callMateriel.ts

@@ -52,3 +52,12 @@ export function sporadicCallItem(p: object) {
     data: p,
   });
 }
+
+// 叫料历史分页查询
+export function callHistoryList(p: object) {
+  return request({
+    url: `/api/v1/api/v1/process/callItem/page`,
+    method: "post",
+    data: p,
+  });
+}

File diff ditekan karena terlalu besar
+ 4 - 0
src/assets/icons/jiaoliaolishi.svg


+ 44 - 21
src/views/pro-operation/call-materiel/components/call-history.vue

@@ -15,19 +15,29 @@
             <div
               v-for="(item, index) in historyList"
               :key="index"
+              v-loading="loading"
               class="item-container"
             >
               <div>
-                <div class="item-header">{{ item?.header }}header</div>
-                <div class="item-describe">{{ item?.describe1 }}header</div>
-                <div class="item-describe">{{ item?.describe2 }}header</div>
+                <div class="item-header">{{ item?.itemName }}</div>
+                <div class="item-describe">{{ item?.itemCode }}</div>
+                <div class="item-describe">{{ item?.itemModel }}</div>
               </div>
               <div>
-                <span class="item-count">{{ item?.count }}50</span>
-                <span class="item-unit">{{ item?.unit }}卷</span>
+                <span class="item-count">{{ item?.itemNum }}</span>
+                <span class="item-unit">{{
+                  dictS.getLableByValue("danwei_type", item?.itemUnit)
+                }}</span>
               </div>
             </div>
           </el-scrollbar>
+          <Pagination
+            v-model:limit="page.pageSize"
+            v-model:page="page.pageNo"
+            :total="page.total"
+            size="large"
+            @pagination="paginationChange"
+          />
         </div>
       </div>
     </el-drawer>
@@ -35,27 +45,40 @@
 </template>
 
 <script lang="ts" setup>
+import { callHistoryList } from "@/api/process/callMateriel";
+import { useDictionaryStore } from "@/store";
+
+const dictS = useDictionaryStore();
 const drawerVisible = ref(false);
 
-const historyList = ref<any>([
-  {},
-  {},
-  {},
-  {},
-  {},
-  {},
-  {},
-  {},
-  {},
-  {},
-  {},
-  {},
-  {},
-  {},
-]);
+const historyList = ref<any[]>([]);
+
+const loading = ref(false);
+const page = reactive({
+  pageSize: 10,
+  pageNo: 1,
+  total: 0,
+});
 
 const showDrawer = () => {
   drawerVisible.value = true;
+  getData();
+};
+
+const paginationChange = () => {
+  getData();
+};
+
+const getData = () => {
+  loading.value = true;
+  callHistoryList({
+    pageNo: page.pageNo,
+    pageSize: page.pageSize,
+  }).then((res) => {
+    loading.value = false;
+    historyList.value = res.data.records;
+    page.total = res.data.totalCount;
+  });
 };
 
 const hideDrawer = () => {

+ 19 - 0
src/views/pro-operation/call-materiel/index.vue

@@ -22,6 +22,10 @@
         </div>
       </el-tab-pane>
     </el-tabs>
+    <div class="call-history">
+      <svg-icon icon-class="jiaoliaolishi" size="80" @click="showHistory" />
+    </div>
+    <CallHistory ref="callHistoryRef" />
   </div>
 </template>
 
@@ -30,12 +34,18 @@ import { ref } from "vue";
 import type { TabsPaneContext } from "element-plus";
 import CompleteSuit from "@/views/pro-operation/call-materiel/complete-suit.vue";
 import Desperse from "@/views/pro-operation/call-materiel/desperse.vue";
+import CallHistory from "@/views/pro-operation/call-materiel/components/call-history.vue";
 
 const activeName = ref("first");
 
+const callHistoryRef = ref<InstanceType<typeof CallHistory>>();
 const handleClick = (tab: TabsPaneContext, event: Event) => {
   console.log(tab, event);
 };
+
+const showHistory = () => {
+  callHistoryRef.value?.showDrawer();
+};
 </script>
 
 <style lang="scss" scoped>
@@ -75,4 +85,13 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
   height: calc(100vh - 225px);
   overflow-y: auto;
 }
+
+.call-history {
+  position: fixed;
+  top: 80px;
+  right: 20px;
+  height: 80px;
+  width: 80px;
+  font-size: 24px;
+}
 </style>