linan 4 years ago
parent
commit
f507494043

+ 1 - 0
src/api/common.js

@@ -0,0 +1 @@
+import { ajax } from "../sdk/ajax";

+ 2 - 0
src/api/slaughterManagment.js

@@ -108,3 +108,5 @@ export const reqCreateBatch = (data) => ajax("post", "/farm-huyang/split-batch//
 export const reqSlaughterBatchList = (data) => ajax("post", "/farm-huyang/slaughter-batch/list", data)
 
 export const reqCreateBatchList = (data) => ajax("post", "/farm-huyang/slaughter-batch/list", data)
+// 屠宰批次id 列表
+export const reqSlaughterBatchIdList = () => ajax("post", "/farm-huyang/slaughter-batch/list-batch")

+ 10 - 5
src/store/index.js

@@ -2,24 +2,29 @@ import Vue from 'vue'
 import Vuex from 'vuex'
 import publicType from './publicType.js' // 公共的类型 
 
+import { reqSlaughterBatchIdList } from "@/api/slaughterManagment.js";
+
 Vue.use(Vuex)
 
 export default new Vuex.Store({
 	strict: true,
 	state: {
-		...publicType
+		...publicType,
+		slaughterBatchIdList: [] // 屠宰批次 id 列表
 	},
 	getters: {
 	},
 	mutations: {
-		setState(state, [key,val]) {
+		setState(state, [key, val]) {
 			state[key] = val
 		}
 	},
 	actions: {
-		login(aa, token) {
-			// commit('setToken', token)
-			console.log(aa)
+		/* 获取屠宰批次 登录后再 home时调用了*/
+		getSlaughterBatchIdList({ commit }) {
+			reqSlaughterBatchIdList().then(res => {
+				commit('setState', ['slaughterBatchIdList', res])
+			})
 		},
 	}
 })

+ 1 - 0
src/store/publicType.js

@@ -31,6 +31,7 @@ const outStoreDirection = [
     { label: "胴体销售", value: 1 }
 ]
 
+/* slaughterBatchIdList  屠宰批次 id 列表 */
 
 // 羊产品类型
 const sheepProductType = [

+ 16 - 13
src/views/Home/Home.vue

@@ -108,26 +108,29 @@ export default {
         };
     },
     created() {
+        // 获取屠宰批次 给后面下拉选择器使用
+        this.$store.dispatch('getSlaughterBatchIdList')
+
         this.defaultUnfoldedMenu = [
             localStorage.getItem("defaultUnfoldedMenu")
         ];
         this.menuCollapse = JSON.parse(localStorage.getItem("menuCollapse"));
         /* 筛选菜单 */
-        var target = this.$route.query.target
-        if(target) {
-            localStorage.setItem("target", target)
-        } else {
-            target = localStorage.getItem('target')
-        }
-        this.filterMenu(target);
+        // var target = this.$route.query.target
+        // if(target) {
+        //     localStorage.setItem("target", target)
+        // } else {
+        //     target = localStorage.getItem('target')
+        // }
+        // this.filterMenu(target);
     },
     watch: {
-        "$route.query.target"(v) {
-            if(v){
-                localStorage.setItem("target", v)
-                this.filterMenu(v);
-            }
-        }
+        // "$route.query.target"(v) {
+        //     if(v){
+        //         localStorage.setItem("target", v)
+        //         this.filterMenu(v);
+        //     }
+        // }
     },
     methods: {
         /* 筛选菜单  */

+ 1 - 1
src/views/sellManagement/carcassSell.vue

@@ -10,7 +10,7 @@
                     <el-button type="primary" @click="getCarcassList">查找</el-button>
                 </el-col>
                 <el-col :span="4">
-                    <el-button type="primary" @click="add">新增</el-button>
+                    <!-- <el-button type="primary" @click="add">新增</el-button> -->
                 </el-col>
             </el-row>
         </header>

+ 1 - 1
src/views/sellManagement/directSell.vue

@@ -10,7 +10,7 @@
                     <el-button type="primary" @click="getDirectSellList">查找</el-button>
                 </el-col>
                 <el-col :span="4">
-                    <el-button type="primary" @click="add">新增</el-button>
+                    <!-- <el-button type="primary" @click="add">新增</el-button> -->
                 </el-col>
             </el-row>
         </header>

+ 1 - 1
src/views/sellManagement/elseSell.vue

@@ -10,7 +10,7 @@
                     <el-button type="primary" @click="getElseSellList">查找</el-button>
                 </el-col>
                 <el-col :span="4">
-                    <el-button type="primary" @click="add">新增</el-button>
+                    <!-- <el-button type="primary" @click="add">新增</el-button> -->
                 </el-col>
             </el-row>
         </header>

+ 1 - 1
src/views/sellManagement/splitSell.vue

@@ -10,7 +10,7 @@
                     <el-button type="primary" @click="getSplitSellList">查找</el-button>
                 </el-col>
                 <el-col :span="4">
-                    <el-button type="primary" @click="add">新增</el-button>
+                    <!-- <el-button type="primary" @click="add">新增</el-button> -->
                 </el-col>
             </el-row>
         </header>

+ 9 - 2
src/views/slaughterManagment/reportQuarantine.vue

@@ -77,7 +77,14 @@
                         </el-form-item>
 
                         <el-form-item label="屠宰批次">
-                            <el-input v-model="formData.slaughterBatch"></el-input>
+                            <el-select v-model="formData.slaughterBatch" filterable placeholder="请选择">
+                                <el-option
+                                    v-for="item in $store.state['slaughterBatchIdList']"
+                                    :key="item"
+                                    :label="item"
+                                    :value="item"
+                                ></el-option>
+                            </el-select>
                         </el-form-item>
 
                         <el-form-item>
@@ -116,7 +123,7 @@ export default {
                 inspectionPerson: "王炸",
                 status: "1",
                 quarantineNo: "88255662380",
-                slaughterBatch: '1396'
+                slaughterBatch: null
             },
             isAdd: false,
             rules

+ 0 - 1
src/views/slaughterManagment/slaughterBatch.vue

@@ -116,7 +116,6 @@ export default {
             })
         },
         pageChange(p) {
-            console.log(p);
             this.page = p;
             // 屠宰批次列表
             this.getSlaughterBatchList();