linan 4 лет назад
Родитель
Сommit
4313d0a583

+ 18 - 18
.eslintrc.js

@@ -1,18 +1,18 @@
-module.exports = {
-  root: true,
-  env: {
-    node: true
-  },
-  extends: ['plugin:vue/essential'],
-  rules: {
-    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
-    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
-  },
-  parserOptions: {
-    parser: 'babel-eslint'
-  },
-  globals: {
-    'AMap': false,
-    'AMapUI': false
-  }
-}
+// module.exports = {
+//   root: true,
+//   env: {
+//     node: true
+//   },
+//   extends: ['plugin:vue/essential'],
+//   rules: {
+//     'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
+//     'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
+//   },
+//   parserOptions: {
+//     parser: 'babel-eslint'
+//   },
+//   globals: {
+//     'AMap': false,
+//     'AMapUI': false
+//   }
+// }

+ 2 - 0
src/api/productManagement.js

@@ -20,6 +20,8 @@ export const reqUpdateSplitLog = (data) => ajax("post", "/farm-huyang/registrati
 
 export const reqDelSplitLog = (id) => ajax("post", "/farm-huyang/registration-split/delete", {id})
 
+export const reqWeight = (data) => ajax("post", "/farm-huyang/registration-split/weight", data)
+
 
 
 /* 羊皮登记  SheepskinLog*/

+ 2 - 1
src/api/slaughterManagment.js

@@ -107,6 +107,7 @@ export const reqCreateBatch = (data) => ajax("post", "/farm-huyang/split-batch//
 /* 屠宰批次  SlaughterBatch*/
 export const reqSlaughterBatchList = (data) => ajax("post", "/farm-huyang/slaughter-batch/list", data)
 
-export const reqCreateBatchList = (data) => ajax("post", "/farm-huyang/slaughter-batch/list", data)
+export const reqSCreateBatch = (data) => ajax("post", "/farm-huyang/slaughter-batch/create-batch", data)
 // 屠宰批次id 列表
 export const reqSlaughterBatchIdList = () => ajax("post", "/farm-huyang/slaughter-batch/list-batch")
+

+ 1 - 1
src/views/Home/Home.vue

@@ -139,7 +139,7 @@ export default {
         http://hzsheep.ifarmcloud.com/butcher/#/home?target=鲜肉储运智能管控
         http://hzsheep.ifarmcloud.com/yield
         */
-        /* 筛选菜单 http://hzsheep.ifarmcloud.com/butcher/#/home?target=定点屠宰智能管控 */
+        /* 筛选菜单 http://localhost:8080/#/home?target=定点屠宰智能管控 */
         /*  http://localhost:8080/#/home?target=定点屠宰智能管控   */
         /*  http://localhost:8080/#/home?target=产品制作智能监控    */
         /*  http://localhost:8080/#/home?target=鲜肉储运智能管控   */

+ 48 - 5
src/views/productManagement/splitLog.vue

@@ -10,7 +10,7 @@
                     <el-button type="primary" @click="getSplitLogList">查找</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>
@@ -30,10 +30,11 @@
                     <el-table-column prop="splitBatchNo" label="分割批次"></el-table-column>
                     <el-table-column label="操作" width="150">
                         <template slot-scope="scope">
-                            <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
-                            <el-popconfirm title="是否删除此设备的信息?" @onConfirm="del(scope.row)">
+                            <!-- <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button> -->
+                            <el-button @click="weigh(scope.row)" type="text" size="small">称重</el-button>
+                            <!-- <el-popconfirm title="是否删除此设备的信息?" @onConfirm="del(scope.row)">
                                 <el-button slot="reference" type="text" size="small">删除</el-button>
-                            </el-popconfirm>
+                            </el-popconfirm>-->
                         </template>
                     </el-table-column>
                 </el-table>
@@ -83,6 +84,22 @@
                 </el-col>
             </el-row>
         </el-dialog>
+
+        <el-dialog title="称重" :visible.sync="isShowWeigh" width="40%">
+            <el-row type="flex">
+                <el-col :span="20">
+                    <el-form ref="Weigh" :model="formData_1" :rules="rules" label-width="140px">
+                        <el-form-item label="重量">
+                            <el-input v-model="formData_1.weight"></el-input>
+                        </el-form-item>
+                        <el-form-item>
+                            <el-button @click="isShow=false">取 消</el-button>
+                            <el-button type="primary" @click="submitForm_1('Weigh')">保 存</el-button>
+                        </el-form-item>
+                    </el-form>
+                </el-col>
+            </el-row>
+        </el-dialog>
     </div>
 </template>
 
@@ -91,7 +108,8 @@ import {
     reqSplitLogList,
     reqAddSplitLog,
     reqUpdateSplitLog,
-    reqDelSplitLog
+    reqDelSplitLog,
+    reqWeight
 } from "@/api/productManagement.js";
 
 const pageSize = 10;
@@ -106,6 +124,7 @@ export default {
             tableData: [],
             totalPages: 0,
             isShow: false,
+            isShowWeigh: false,
             formData: {
                 productUniqueNo: "",
                 productName: "带骨羊前腿",
@@ -113,6 +132,10 @@ export default {
                 weight: "35",
                 splitBatchNo: "1548"
             },
+            formData_1: {
+                productUniqueNo: "",
+                weight: ""
+            },
             isAdd: false,
             rules
         };
@@ -163,6 +186,21 @@ export default {
                 }
             });
         },
+        submitForm_1(formName) {
+            this.$refs[formName].validate(valid => {
+                if (valid) {
+                    reqWeight(this.formData_1).then(res => {
+                        if (res.errCode) {
+                            this.$message.error(res.errMsg);
+                        } else {
+                            this.$message.success("成功");
+                        }
+                    });
+                } else {
+                    return false;
+                }
+            });
+        },
         // 分割登记列表
         getSplitLogList() {
             reqSplitLogList({
@@ -182,6 +220,11 @@ export default {
             this.isShow = true;
             this.isAdd = true;
         },
+        weigh(row) {
+            console.log(row);
+            this.formData_1.productUniqueNo = row.productUniqueNo;
+            this.isShowWeigh = true;
+        },
         edit(row) {
             this.formData = row;
             this.isShow = true;

+ 12 - 7
src/views/slaughterManagment/slaughterBatch.vue

@@ -51,7 +51,10 @@
 </template>
 
 <script>
-import { reqSlaughterBatchList, reqCreateBatchList } from "@/api/slaughterManagment.js";
+import {
+    reqSlaughterBatchList,
+    reqSCreateBatch
+} from "@/api/slaughterManagment.js";
 
 const pageSize = 10;
 const rules = {};
@@ -106,14 +109,16 @@ export default {
             }
         },
         create() {
-            let ids = this.multipleSelection.map(item => item.id).toString
-            reqCreateBatchList({ids}).then(res => {
-                if(res.errCode) {
-                    this.$message.error(res.errMsg)
+            let ids = this.multipleSelection.map(item => item.id).toString();
+            reqSCreateBatch({ ids }).then(res => {
+                if (res.errCode) {
+                    // 获取屠宰批次 给后面下拉选择器使用
+                    this.$store.dispatch("getSlaughterBatchIdList");
+                    this.$message.error(res.errMsg);
                 } else {
-                    this.$message.success("成功")
+                    this.$message.success("成功");
                 }
-            })
+            });
         },
         pageChange(p) {
             this.page = p;