Prechádzať zdrojové kódy

Merge tag 'Hotfix-zh-102' into develop

Finish Hotfix-zh-102
howie 3 rokov pred
rodič
commit
d51a91b8e5

+ 11 - 0
src/api/stock.js

@@ -35,3 +35,14 @@ export function getReservedList(params) {
     params
   })
 }
+
+
+
+// 获取仓库现存列表
+export function getListStockToDay(params) {
+  return request({
+    url: '/stock/manager/listStockToDay',
+    method: 'get',
+    params
+  })
+}

+ 9 - 15
src/layout/components/Navbar.vue

@@ -144,20 +144,14 @@
 </template>
 
 <script>
-import { getRebateOrderMsg } from "@/api/dashboard";
-import { mapGetters } from "vuex";
-import Breadcrumb from "@/components/Breadcrumb";
-import Hamburger from "@/components/Hamburger";
-import Screenfull from "@/components/Screenfull";
-import NavMenu from "@/components/NavMenu";
-import { getNoticeListCount } from "@/api/notice";
-import {
-  checkEngineAccount,
-  bindEngineAccount,
-  delEngineAccount,
-} from "@/api/setting";
-import request from "@/utils/request";
-import { getToken } from '@/utils/auth'
+import { getRebateOrderMsg } from '@/api/dashboard'
+import { mapGetters } from 'vuex'
+import Breadcrumb from '@/components/Breadcrumb'
+import Hamburger from '@/components/Hamburger'
+import Screenfull from '@/components/Screenfull'
+import NavMenu from '@/components/NavMenu'
+import { getNoticeListCount } from '@/api/notice'
+import { bindEngineAccount, checkEngineAccount } from '@/api/setting'
 
 export default {
   data() {
@@ -234,7 +228,7 @@ export default {
     async logout() {
       await this.$store.dispatch("user/logout");
       // this.$router.push(`/login?redirect=${this.$route.fullPath}`)
-      location.reload()
+      this.$store.commit('tagsView/SET_RESET_VIES')
       this.$router.push(`/login`);
 
     },

+ 80 - 78
src/store/modules/tagsView.js

@@ -1,160 +1,162 @@
 const state = {
   visitedViews: [],
-  cachedViews: []
-}
+  cachedViews: [],
+};
 
 const mutations = {
   ADD_VISITED_VIEW: (state, view) => {
-    if (state.visitedViews.some(v => v.path === view.path)) return
+    if (state.visitedViews.some((v) => v.path === view.path)) return;
     state.visitedViews.push(
       Object.assign({}, view, {
-        title: view.meta.title || 'no-name'
+        title: view.meta.title || "no-name",
       })
-    )
+    );
   },
   ADD_CACHED_VIEW: (state, view) => {
-    if (state.cachedViews.includes(view.name)) return
+    if (state.cachedViews.includes(view.name)) return;
     if (!view.meta.noCache) {
-      state.cachedViews.push(view.name)
+      state.cachedViews.push(view.name);
     }
   },
-
+  SET_RESET_VIES: (state, view) => {
+    state.visitedViews = [];
+  },
   DEL_VISITED_VIEW: (state, view) => {
     for (const [i, v] of state.visitedViews.entries()) {
       if (v.path === view.path) {
-        state.visitedViews.splice(i, 1)
-        break
+        state.visitedViews.splice(i, 1);
+        break;
       }
     }
   },
   DEL_CACHED_VIEW: (state, view) => {
-    const index = state.cachedViews.indexOf(view.name)
-    index > -1 && state.cachedViews.splice(index, 1)
+    const index = state.cachedViews.indexOf(view.name);
+    index > -1 && state.cachedViews.splice(index, 1);
   },
 
   DEL_OTHERS_VISITED_VIEWS: (state, view) => {
-    state.visitedViews = state.visitedViews.filter(v => {
-      return v.meta.affix || v.path === view.path
-    })
+    state.visitedViews = state.visitedViews.filter((v) => {
+      return v.meta.affix || v.path === view.path;
+    });
   },
   DEL_OTHERS_CACHED_VIEWS: (state, view) => {
-    const index = state.cachedViews.indexOf(view.name)
+    const index = state.cachedViews.indexOf(view.name);
     if (index > -1) {
-      state.cachedViews = state.cachedViews.slice(index, index + 1)
+      state.cachedViews = state.cachedViews.slice(index, index + 1);
     } else {
       // if index = -1, there is no cached tags
-      state.cachedViews = []
+      state.cachedViews = [];
     }
   },
 
-  DEL_ALL_VISITED_VIEWS: state => {
+  DEL_ALL_VISITED_VIEWS: (state) => {
     // keep affix tags
-    const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
-    state.visitedViews = affixTags
+    const affixTags = state.visitedViews.filter((tag) => tag.meta.affix);
+    state.visitedViews = affixTags;
   },
-  DEL_ALL_CACHED_VIEWS: state => {
-    state.cachedViews = []
+  DEL_ALL_CACHED_VIEWS: (state) => {
+    state.cachedViews = [];
   },
 
   UPDATE_VISITED_VIEW: (state, view) => {
     for (let v of state.visitedViews) {
       if (v.path === view.path) {
-        v = Object.assign(v, view)
-        break
+        v = Object.assign(v, view);
+        break;
       }
     }
-  }
-}
+  },
+};
 
 const actions = {
   addView({ dispatch }, view) {
-    dispatch('addVisitedView', view)
-    dispatch('addCachedView', view)
+    dispatch("addVisitedView", view);
+    dispatch("addCachedView", view);
   },
   addVisitedView({ commit }, view) {
-    commit('ADD_VISITED_VIEW', view)
+    commit("ADD_VISITED_VIEW", view);
   },
   addCachedView({ commit }, view) {
-    commit('ADD_CACHED_VIEW', view)
+    commit("ADD_CACHED_VIEW", view);
   },
 
   delView({ dispatch, state }, view) {
-    return new Promise(resolve => {
-      dispatch('delVisitedView', view)
-      dispatch('delCachedView', view)
+    return new Promise((resolve) => {
+      dispatch("delVisitedView", view);
+      dispatch("delCachedView", view);
       resolve({
         visitedViews: [...state.visitedViews],
-        cachedViews: [...state.cachedViews]
-      })
-    })
+        cachedViews: [...state.cachedViews],
+      });
+    });
   },
   delVisitedView({ commit, state }, view) {
-    return new Promise(resolve => {
-      commit('DEL_VISITED_VIEW', view)
-      resolve([...state.visitedViews])
-    })
+    return new Promise((resolve) => {
+      commit("DEL_VISITED_VIEW", view);
+      resolve([...state.visitedViews]);
+    });
   },
   delCachedView({ commit, state }, view) {
-    return new Promise(resolve => {
-      commit('DEL_CACHED_VIEW', view)
-      resolve([...state.cachedViews])
-    })
+    return new Promise((resolve) => {
+      commit("DEL_CACHED_VIEW", view);
+      resolve([...state.cachedViews]);
+    });
   },
 
   delOthersViews({ dispatch, state }, view) {
-    return new Promise(resolve => {
-      dispatch('delOthersVisitedViews', view)
-      dispatch('delOthersCachedViews', view)
+    return new Promise((resolve) => {
+      dispatch("delOthersVisitedViews", view);
+      dispatch("delOthersCachedViews", view);
       resolve({
         visitedViews: [...state.visitedViews],
-        cachedViews: [...state.cachedViews]
-      })
-    })
+        cachedViews: [...state.cachedViews],
+      });
+    });
   },
   delOthersVisitedViews({ commit, state }, view) {
-    return new Promise(resolve => {
-      commit('DEL_OTHERS_VISITED_VIEWS', view)
-      resolve([...state.visitedViews])
-    })
+    return new Promise((resolve) => {
+      commit("DEL_OTHERS_VISITED_VIEWS", view);
+      resolve([...state.visitedViews]);
+    });
   },
   delOthersCachedViews({ commit, state }, view) {
-    return new Promise(resolve => {
-      commit('DEL_OTHERS_CACHED_VIEWS', view)
-      resolve([...state.cachedViews])
-    })
+    return new Promise((resolve) => {
+      commit("DEL_OTHERS_CACHED_VIEWS", view);
+      resolve([...state.cachedViews]);
+    });
   },
 
   delAllViews({ dispatch, state }, view) {
-    return new Promise(resolve => {
-      dispatch('delAllVisitedViews', view)
-      dispatch('delAllCachedViews', view)
+    return new Promise((resolve) => {
+      dispatch("delAllVisitedViews", view);
+      dispatch("delAllCachedViews", view);
       resolve({
         visitedViews: [...state.visitedViews],
-        cachedViews: [...state.cachedViews]
-      })
-    })
+        cachedViews: [...state.cachedViews],
+      });
+    });
   },
   delAllVisitedViews({ commit, state }) {
-    return new Promise(resolve => {
-      commit('DEL_ALL_VISITED_VIEWS')
-      resolve([...state.visitedViews])
-    })
+    return new Promise((resolve) => {
+      commit("DEL_ALL_VISITED_VIEWS");
+      resolve([...state.visitedViews]);
+    });
   },
   delAllCachedViews({ commit, state }) {
-    return new Promise(resolve => {
-      commit('DEL_ALL_CACHED_VIEWS')
-      resolve([...state.cachedViews])
-    })
+    return new Promise((resolve) => {
+      commit("DEL_ALL_CACHED_VIEWS");
+      resolve([...state.cachedViews]);
+    });
   },
 
   updateVisitedView({ commit }, view) {
-    commit('UPDATE_VISITED_VIEW', view)
-  }
-}
+    commit("UPDATE_VISITED_VIEW", view);
+  },
+};
 
 export default {
   namespaced: true,
   state,
   mutations,
-  actions
-}
+  actions,
+};

+ 296 - 0
src/views/basic_data/stock/product_list.vue

@@ -0,0 +1,296 @@
+<template>
+  <div class="app-container">
+    <!-- 筛选条件 -->
+    <div class="screen-container">
+      <el-form
+        ref="screenForm"
+        :model="screenForm"
+        label-width="90px"
+        size="mini"
+        label-position="left"
+      >
+        <el-row :gutter="20">
+
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="产品编码" prop="materialNumber">
+              <el-input
+                v-model="screenForm.materialNumber"
+                placeholder="请输入产品编码"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="厂产品代码" prop="materialOldNumber">
+              <el-input
+                v-model="screenForm.materialOldNumber"
+                placeholder="请输入厂产品代码"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="产品名称" prop="materialName">
+              <el-input
+                v-model="screenForm.materialName"
+                placeholder="请输入产品名称"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="规格型号" prop="specification">
+              <el-input
+                v-model="screenForm.specification"
+                placeholder="请输入产品名称"
+              />
+            </el-form-item>
+          </el-col>
+
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="仓库" prop="correspondId">
+              <el-select v-model="screenForm.correspondId" style="width: 100%" placeholder="请选择仓库" size="mini" filterable clearable>
+                <el-option v-for="(item, index) in warehouseList" :key="index" :label="item.name" :value="item.id" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="存货类别" >
+              <el-select v-model="screenForm.categoryId" style="width: 100%" placeholder="选择存货类别">
+                <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.id" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col class="tr">
+            <el-form-item>
+              <el-button @click="resetScreenForm">清空</el-button>
+              <el-button type="primary" @click="submitScreenForm">搜索</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+    <div class="mymain-container">
+      <div class="btn-group clearfix">
+        <div >
+          <ExportButton
+            :ex-url="'stock/manager/export'"
+            :ex-params="exParams"
+          />
+        </div>
+      </div>
+      <div class="table">
+        <el-table
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
+        >
+          <el-table-column
+            align="left"
+            label="仓库"
+            prop="correspondName"
+            min-width="100"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            align="left"
+            label="产品编码"
+            prop="materialNumber"
+            min-width="150"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.materialNumber" />
+              <span>{{ scope.row.materialNumber }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="left"
+            label="厂产品代码"
+            prop="materialOldNumber"
+            min-width="150"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.materialOldNumber" />
+              <span>{{ scope.row.materialOldNumber }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="left"
+            label="产品名称"
+            prop="materialName"
+            min-width="200"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.materialName" />
+              <span>{{ scope.row.materialName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="left"
+            label="规格型号"
+            prop="specification"
+            min-width="300"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <CopyButton :copy-text="scope.row.specification" />
+              <span>{{ scope.row.specification }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="right"
+            label="可用数量"
+            prop="stockAdequate"
+            min-width="100"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            align="right"
+            label="开单未提数量"
+            prop="num"
+            min-width="100"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            align="right"
+            label="结存数量"
+            prop="balanceNumber"
+            min-width="100"
+            show-overflow-tooltip
+          />
+        </el-table>
+
+      </div>
+    </div>
+    <div class="pagination clearfix">
+      <div class="fr">
+        <el-pagination
+          :current-page="currentPage"
+          :page-sizes="[10, 20, 30, 50]"
+          :page-size="10"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="listTotal"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+        />
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getListStockToDay } from '@/api/stock'
+import { getCategoryList } from '@/api/common'
+import { getWarehouseList } from '@/api/supply/apply'
+
+export default {
+  data() {
+    return {
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      dataList: null, // 列表数据
+      listLoading: false, // 列表加载loading
+      screenForm: {
+        categoryId: '',
+        correspondId: '',
+        materialName: '',
+        materialNumber: '',
+        materialOldNumber: '',
+        specification: ''
+      },
+      typeList: [],
+      warehouseList: [],
+      categoryList: []
+    }
+  },
+
+  computed: {
+    exParams() {
+      return {
+        categoryId: this.screenForm.categoryId,
+        correspondId: this.screenForm.correspondId,
+        materialName: this.screenForm.materialName,
+        materialNumber: this.screenForm.materialNumber,
+        materialOldNumber: this.screenForm.materialOldNumber,
+        specification: this.screenForm.specification
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+
+    getList() {
+      const params = {
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        categoryId: this.screenForm.categoryId,
+        correspondId: this.screenForm.correspondId,
+        materialName: this.screenForm.materialName,
+        materialNumber: this.screenForm.materialNumber,
+        materialOldNumber: this.screenForm.materialOldNumber,
+        specification: this.screenForm.specification
+      }
+      this.listLoading = true
+      getListStockToDay(params).then(res => {
+        this.dataList = res.data.records
+        this.listTotal = res.data.total
+        this.listLoading = false
+      })
+      this.getWarehouseList()
+      this.getCategoryList()
+    },
+    // 获取仓库列表
+    getWarehouseList() {
+      getWarehouseList({
+        pageNum: 1,
+        pageSize: -1
+      }).then((res) => {
+        this.warehouseList = res.data.records
+      })
+    },
+
+    // 获取存货类别列表
+    getCategoryList() {
+      getCategoryList({
+        pageNum: 1,
+        pageSize: -1
+      }).then(res => {
+        this.categoryList = res.data.records
+      })
+    },
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1
+      this.getList()
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields()
+      this.currentPage = 1
+      this.getList()
+    },
+
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val
+      this.currentPage = 1
+      this.getList()
+    },
+
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val
+      this.getList()
+    }
+  }
+}
+</script>

+ 15 - 8
src/views/supply/deliver/sum_list.vue

@@ -68,6 +68,11 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="发货单号" prop="mainOrderId">
+                <el-input v-model="screenForm.mainOrderId" placeholder="请输入发货单号"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="存货类别" prop="type">
                 <el-select v-model="screenForm.type" placeholder="选择存货类别" style="width: 100%" clearable>
                   <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.name"></el-option>
@@ -179,22 +184,22 @@
             </el-table-column>
             <el-table-column align="right" label="发货折扣金额" prop="discAmount" min-width="110" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{scope.row.discAmount | numToFixed}}
+                {{scope.row.totalDiscAmount | numToFixed}}
               </template>
             </el-table-column>
             <el-table-column align="right" label="折扣额合计" prop="totalDiscAmount" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{scope.row.totalDiscAmount | numToFixed}}
+                {{(scope.row.totalDiscAmount + scope.row.payRebateAmount) | numToFixed}}
               </template>
             </el-table-column>
-               <el-table-column align="right" label="含税单价" prop="price" min-width="100" show-overflow-tooltip>
+               <el-table-column align="right" label="含税单价" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{scope.row.price | numToFixed}}
+                {{scope.row.singlePayPrice | numToFixed}}
               </template>
             </el-table-column>
-              <el-table-column align="right" label="含税总额" prop="price" min-width="100" show-overflow-tooltip>
+              <el-table-column align="right" label="含税总额" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{scope.row.price | numToFixed}}
+                {{scope.row.payAmount | numToFixed}}
               </template>
             </el-table-column>
             <el-table-column align="right" label="发货数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
@@ -232,9 +237,9 @@
 </template>
 
 <script>
-import { getSumList } from "@/api/supply/deliver";
+import { getSumList } from '@/api/supply/deliver'
 import { getCategoryList, getSalesmanList } from '@/api/common'
-import SumPrint from "@/views/supply/deliver/components/sum_print";
+import SumPrint from '@/views/supply/deliver/components/sum_print'
 
 export default {
   components: {
@@ -259,6 +264,7 @@ export default {
         orderNum: '',
         type: '',
         salesMan: '',
+        mainOrderId:''
       },
       categoryList: [],
       salesmanList: [],
@@ -338,6 +344,7 @@ export default {
         id: this.screenForm.orderNum,
         categoryName: this.screenForm.type,
         serviceId: this.screenForm.salesMan,
+        mainOrderId:this.screenForm.mainOrderId
       };
       getSumList(params).then((res) => {
         res.data.records.forEach(item => {