huang_an hace 2 años
padre
commit
05bd81ce47

+ 2 - 1
src/App.vue

@@ -9,7 +9,8 @@
 
   export default {
     name: 'App',
-    created() {
+    async created() {
+      await this.$store.dispatch('userPage/fetchUserPage');
       // 恢复主题
       this.$store.dispatch('theme/recoverTheme');
     },

+ 9 - 0
src/api/classifyManage/itemInformation.js

@@ -95,3 +95,12 @@ export async function ledgerPage(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+//库存台账详情出入单分页
+export async function inventorybookPage(params) {
+  const res = await request.get(`/wms/inventorybook/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 4 - 4
src/main.js

@@ -33,7 +33,7 @@ Vue.use(VueClipboard);
 
 let instance = null;
 
-function render (props = {}) {
+function render(props = {}) {
   const { container, routerBase } = props;
   // const router = new VueRouter({
   //   base: window.__POWERED_BY_QIANKUN__ ? routerBase : process.env.BASE_URL,
@@ -54,11 +54,11 @@ if (!window.__POWERED_BY_QIANKUN__) {
   render();
 }
 
-export async function bootstrap () {
+export async function bootstrap() {
   console.log('[vue] vue app bootstraped');
 }
 
-export async function mount (props) {
+export async function mount(props) {
   console.log('[vue] props from main framework', props);
 
   initParentStore(props.store);
@@ -70,7 +70,7 @@ export async function mount (props) {
   render(props);
 }
 
-export async function unmount () {
+export async function unmount() {
   instance.$destroy();
   instance.$el.innerHTML = '';
   instance = null;

+ 3 - 1
src/store/index.js

@@ -8,6 +8,7 @@ import dict from './modules/dict';
 import user from './modules/user';
 import theme from './modules/theme';
 import createPersistedState from 'vuex-persistedstate';
+import userPageModule from './modules/userPage'; // 引入用户列表模块
 
 Vue.use(Vuex);
 
@@ -18,7 +19,8 @@ export default new Vuex.Store({
   modules: {
     dict,
     user,
-    theme
+    theme,
+    userPage: userPageModule
   },
   getters,
   plugins: [

+ 36 - 0
src/store/modules/userPage.js

@@ -0,0 +1,36 @@
+// store/userPage.js
+import { getUserPage } from '@/api/system/organization';
+const state = {
+  userList: [] // 用户列表数据
+};
+
+const mutations = {
+  setUserList(state, userList) {
+    state.userList = userList;
+  }
+};
+
+const actions = {
+  async fetchUserPage({ commit }, id) {
+    try {
+      // 调用接口请求的方法
+      const res = await getUserPage({
+        pageNum: 1,
+        size: -1,
+        executeGroupId: id
+      });
+
+      // 在请求成功时,提交 mutation 将用户列表数据存储到 state
+      commit('setUserList', res.list);
+    } catch (error) {
+      console.error('获取用户列表失败:', error);
+    }
+  }
+};
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions
+};

+ 6 - 19
src/views/dashboard.vue

@@ -1,30 +1,17 @@
 <template>
-  <div class="ele-body ele-body-card">
-
-  </div>
+  <div class="ele-body ele-body-card"> </div>
 </template>
 
 <script>
-
-
   export default {
     name: '',
-    components: {
-
-    },
+    components: {},
     data() {
-      return {
-
-      }
-    },
-    computed: {
-
+      return {};
     },
-    methods: {
-
-    }
+    computed: {},
+    methods: {}
   };
 </script>
 
-<style lang="scss" scoped>
-</style>
+<style lang="scss" scoped></style>

+ 2 - 6
src/views/warehouseManagement/stockLedger/components/details/BaseInfo.vue

@@ -81,12 +81,8 @@
         this.idata = { ...data, groupName: dep.groupName, name: dep.name };
       },
       async getDepUser(id, depId) {
-        const res = await getUserPage({
-          pageNum: 1,
-          size: -1,
-          executeGroupId: id
-        });
-        const list = res.list;
+        // 获取存储在 Vuex 中的用户列表数据
+        const list = this.$store.state.userPage.userList;
         for (const key in list) {
           if (list[key].id == depId) {
             return list[key];

+ 8 - 7
src/views/warehouseManagement/stockLedger/components/details/InWarehouse.vue

@@ -1,7 +1,7 @@
 <!-- 入库 -->
 <template>
   <div class="detail-box">
-    <el-form label-width="100px">
+    <!-- <el-form label-width="100px">
       <el-row>
         <el-col :span="6">
           <el-form-item label="入库场景"
@@ -108,7 +108,7 @@
           >
         </el-col>
       </el-row>
-    </el-form>
+    </el-form> -->
     <el-table
       :data="tableData"
       @cell-click="handleCellClick"
@@ -154,6 +154,7 @@
   // import { getInWarehouseDetail } from '@/api/stockManagement/stockLedger'
   // import { sceneState } from '@/utils/dict/index'
   import InWarehouseDialog from './InWarehouseDialog';
+  import { inventorybookPage } from '@/api/classifyManage/itemInformation';
   // import { useDictLabel } from '@/utils/dict/index'
   export default {
     components: { Pagination, InWarehouseDialog },
@@ -204,13 +205,13 @@
         this.getList();
       },
       async getList() {
-        const res = await getInWarehouseDetail({
+        const res = await inventorybookPage({
           bizStatus: 1,
           size: this.size,
-          page: this.page,
-          ...this.baseParams,
-          ...this.searchForm,
-          batchNum: this.baseParams.batchNum || this.searchForm.batchNum
+          page: this.page
+          // ...this.baseParams,
+          // ...this.searchForm,
+          // batchNum: this.baseParams.batchNum || this.searchForm.batchNum
         });
         if (res?.success) {
           this.tableData = res.data.records;

+ 8 - 6
src/views/warehouseManagement/stockLedger/components/details/InventoryAllocation.vue

@@ -1,7 +1,7 @@
 <!-- 调拨 -->
 <template>
   <div class="detail-box">
-    <el-form label-width="70px">
+    <!-- <el-form label-width="70px">
       <el-row>
         <el-col :span="6">
           <el-form-item label="关键字">
@@ -25,7 +25,7 @@
           >
         </el-col>
       </el-row>
-    </el-form>
+    </el-form> -->
     <el-table
       :data="tableData"
       :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
@@ -85,6 +85,7 @@
   import Pagination from '@/components/Pagination';
   // import { getTransferDetail } from '@/api/stockManagement/stockLedger'
   import InventoryAllocationDialog from './InventoryAllocationDialog';
+  import { inventorybookPage } from '@/api/classifyManage/itemInformation';
   // import dictMixins from '@/mixins/dictMixins'
   export default {
     components: { Pagination, InventoryAllocationDialog },
@@ -130,12 +131,13 @@
         this.getList();
       },
       async getList() {
-        const res = await getTransferDetail({
+        const res = await inventorybookPage({
           size: this.size,
           page: this.page,
-          ...this.baseParams,
-          ...this.searchForm,
-          batchNum: this.baseParams.batchNum || this.searchForm.batchNum
+          bizStatus: 3
+          // ...this.baseParams,
+          // ...this.searchForm,
+          // batchNum: this.baseParams.batchNum || this.searchForm.batchNum
           // bizNum,
           // batchNum,
           // inventoryCode: this.assetCode

+ 8 - 7
src/views/warehouseManagement/stockLedger/components/details/OutWarehouse.vue

@@ -1,7 +1,7 @@
 <!-- 出库 -->
 <template>
   <div class="detail-box">
-    <el-form label-width="100px">
+    <!-- <el-form label-width="100px">
       <el-row>
         <el-col :span="6">
           <el-form-item label="出库场景"
@@ -108,7 +108,7 @@
           >
         </el-col>
       </el-row>
-    </el-form>
+    </el-form> -->
     <el-table
       :data="tableData"
       @cell-click="handleCellClick"
@@ -163,6 +163,7 @@
   // import { getInWarehouseDetail } from '@/api/stockManagement/stockLedger'
   // import { outputSceneState } from '@/utils/dict/index'
   import OutWarehouseDialg from './OutWarehouseDialg.vue';
+  import { inventorybookPage } from '@/api/classifyManage/itemInformation';
   // import { useDictLabel } from '@/utils/dict/index'
   // import dictMixin from '@/mixins/dictMixins'
   export default {
@@ -216,13 +217,13 @@
         this.getList();
       },
       async getList() {
-        const res = await getInWarehouseDetail({
+        const res = await inventorybookPage({
           bizStatus: 2,
           size: this.size,
-          page: this.page,
-          ...this.baseParams,
-          ...this.searchForm,
-          batchNum: this.baseParams.batchNum || this.searchForm.batchNum
+          page: this.page
+          // ...this.baseParams,
+          // ...this.searchForm,
+          // batchNum: this.baseParams.batchNum || this.searchForm.batchNum
         });
         if (res?.success) {
           this.tableData = res.data.records;

+ 1 - 1
src/views/warehouseManagement/stockLedger/index.vue

@@ -70,7 +70,7 @@
         treeLoading: false
       };
     },
-    created() {
+    async created() {
       this.getTreeData();
     },
     methods: {

+ 6 - 5
src/views/warehouseManagement/stockManagement/details.vue

@@ -383,10 +383,11 @@
     computed: {
       ...mapGetters(['getDictValue']),
       curDateType() {
-        console.log(this.materialCodeReqList[0]);
-        return this.materialCodeReqList[0].manufactureTime
-          ? 'manufactureTime'
-          : 'procurementTime';
+        if (this.materialCodeReqList) {
+          return this.materialCodeReqList[0].manufactureTime
+            ? 'manufactureTime'
+            : 'procurementTime';
+        }
       },
       tableHeader() {
         return tableHeader(this.infoData.assetType);
@@ -411,7 +412,7 @@
       getSceneState: useDictLabel(sceneState),
       handleAssetType(r) {
         const code = this.codeList.find((item) => item.dictCode == r);
-        return code.dictValue;
+        return code?.dictValue;
       },
       rowClass({ row, column, rowIndex, columnIndex }) {
         if (rowIndex === 1) {

+ 2 - 2
src/views/warehouseManagement/stockManagement/index.vue

@@ -238,13 +238,13 @@
             showOverflowTooltip: true
           },
           {
-            prop: '',
+            prop: 'createUserName',
             label: '入库人',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            prop: '',
+            prop: 'createTime',
             label: '入库时间',
             align: 'center',
             showOverflowTooltip: true