From eb7a607667cab6ca7daf207b6fc6b8f825ad79ef Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 02 Aug 2022 16:32:03 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/zhny_web

---
 public/traceablityInfos.html             |   79 +------------
 src/views/farmplant/process.vue          |  121 +++++++++++++++++++
 src/views/farmplant/farmproductstock.vue |   37 ++++++
 public/traceablityInfo.html              |   77 ------------
 4 files changed, 164 insertions(+), 150 deletions(-)

diff --git a/public/traceablityInfo.html b/public/traceablityInfo.html
index 12aeb09..ac8e040 100644
--- a/public/traceablityInfo.html
+++ b/public/traceablityInfo.html
@@ -597,12 +597,12 @@
       align-items: center;
     }
 
-    #video-body {
+    /* #video-body {
       display: inline-block;
       height: 100%;
       position: relative;
       overflow: hidden;
-    }
+    } */
 
     #video-footer {
       width: 100%;
@@ -804,13 +804,7 @@
           //读取第一个视频 url
           strvedio = strvedio + `<div class="content-body">
                   <div id="video-body">
-                    <video controls id="video-element" muted>你的浏览器太老了,不支持HTML5视频。</video>
-                    <div id="video-footer" class="css-closeTrans">
-                      <img id="oper-btn" src="img/i-play.png" width="40px" />
-                      <div id="video-sound">
-                      </div>
-                      <img id="full-btn" src="img/i-fs.png" width="35px" />
-                    </div>
+                    <video controls id="video-element" autoplay muted>你的浏览器太老了,不支持HTML5视频。</video>
                   </div>
                 </div><div class="content-footer">`
           //遍历监控点
@@ -1042,20 +1036,8 @@
         dom.empty();
         dom.append(str0 + str1 + str2 + strvedio + str10 + strdetection + str11 + str3 + str4 + str5 + str6);
 
-        var playImg = "img/i-play.png",
-          pauseImg = "img/i-pause.png",
-          fsImg = "img/i-fs.png",
-          exitFsImg = "img/i-exitfs.png",
-          soundOpenImg = "img/sound-open.png",
-          soundCloseImg = "img/sound-close.png";
-
         var videoBody = document.getElementById('video-body'),
-          videoElement = document.getElementById('video-element'),
-          videoBegin = document.getElementById('video-begin'),
-          videoEnd = document.getElementById('video-end'),
-          videoFooter = document.getElementById('video-footer'),
-          operBtn = document.getElementById('oper-btn'),
-          fullBtn = document.getElementById('full-btn');
+          videoElement = document.getElementById('video-element');
 
         var slide = false, soundWidth = 0;
 
@@ -1073,58 +1055,9 @@
         }
 
         videoElement.style.width = "100%";
+        videoElement.style.height = "385px";
         videoElement.style.objectFit = "fill";
 
-        //播放 或 暂停
-        operBtn.onclick = function () {
-          if (this.attributes.src.value === playImg) {
-            flvPlayer.play();
-            this.src = pauseImg;
-          } else {
-            flvPlayer.pause();
-            this.src = playImg;
-          }
-        }
-
-        //全屏 或 退出全屏
-        fullBtn.onclick = function () {
-          if (this.attributes.src.value === fsImg) {
-            var docEle = videoContainer;
-            var rfs = docEle.requestFullScreen || docEle.webkitRequestFullScreen || docEle.mozRequestFullScreen || docEle.msRequestFullScreen;
-            if (rfs) {
-              rfs.call(docEle);
-            }
-            this.src = exitFsImg;
-          } else {
-            var cfs = document.cancelFullScreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || document.exitFullScreen;
-            if (cfs) {
-              cfs.call(document);
-            }
-            this.src = fsImg;
-          }
-        }
-
-        //鼠标进入 显示 工具条
-        videoBody.onmouseenter = function () {
-          videoFooter.classList.add(
-            "css-show-transition",
-            "css-showTrans"
-          );
-        }
-        //鼠标退出 隐藏 工具条
-        videoBody.onmouseleave = function () {
-          videoFooter.classList.add(
-            "css-close-transition",
-            "css-closeTrans"
-          );
-          videoFooter.classList.remove(
-            "css-show-transition",
-            "css-showTrans"
-          );
-        }
-
-        //播放视频
-        operBtn.onclick();
 
         //切换视频
         $('.jksp .content-footer .equi-btn').click(function () {
diff --git a/public/traceablityInfos.html b/public/traceablityInfos.html
index 7f8a253..3766b88 100644
--- a/public/traceablityInfos.html
+++ b/public/traceablityInfos.html
@@ -1,4 +1,4 @@
-<!-- web 端详情 -->
+<!-- web 详情页 -->
 <!DOCTYPE html>
 <html lang="en">
 
@@ -597,12 +597,12 @@
       align-items: center;
     }
 
-    #video-body {
+    /* #video-body {
       display: inline-block;
       height: 100%;
       position: relative;
       overflow: hidden;
-    }
+    } */
 
     #video-footer {
       width: 100%;
@@ -804,13 +804,7 @@
           //读取第一个视频 url
           strvedio = strvedio + `<div class="content-body">
                   <div id="video-body">
-                    <video controls id="video-element" muted>你的浏览器太老了,不支持HTML5视频。</video>
-                    <div id="video-footer" class="css-closeTrans">
-                      <img id="oper-btn" src="img/i-play.png" width="40px" />
-                      <div id="video-sound">
-                      </div>
-                      <img id="full-btn" src="img/i-fs.png" width="35px" />
-                    </div>
+                    <video controls id="video-element" autoplay muted>你的浏览器太老了,不支持HTML5视频。</video>
                   </div>
                 </div><div class="content-footer">`
           //遍历监控点
@@ -1042,20 +1036,8 @@
         dom.empty();
         dom.append(str0 + str1 + str2 + strvedio + str10 + strdetection + str11 + str3 + str4 + str5 + str6);
 
-        var playImg = "img/i-play.png",
-          pauseImg = "img/i-pause.png",
-          fsImg = "img/i-fs.png",
-          exitFsImg = "img/i-exitfs.png",
-          soundOpenImg = "img/sound-open.png",
-          soundCloseImg = "img/sound-close.png";
-
         var videoBody = document.getElementById('video-body'),
-          videoElement = document.getElementById('video-element'),
-          videoBegin = document.getElementById('video-begin'),
-          videoEnd = document.getElementById('video-end'),
-          videoFooter = document.getElementById('video-footer'),
-          operBtn = document.getElementById('oper-btn'),
-          fullBtn = document.getElementById('full-btn');
+          videoElement = document.getElementById('video-element');
 
         var slide = false, soundWidth = 0;
 
@@ -1073,58 +1055,9 @@
         }
 
         videoElement.style.width = "100%";
+        videoElement.style.height = "385px";
         videoElement.style.objectFit = "fill";
 
-        //播放 或 暂停
-        operBtn.onclick = function () {
-          if (this.attributes.src.value === playImg) {
-            flvPlayer.play();
-            this.src = pauseImg;
-          } else {
-            flvPlayer.pause();
-            this.src = playImg;
-          }
-        }
-
-        //全屏 或 退出全屏
-        fullBtn.onclick = function () {
-          if (this.attributes.src.value === fsImg) {
-            var docEle = videoContainer;
-            var rfs = docEle.requestFullScreen || docEle.webkitRequestFullScreen || docEle.mozRequestFullScreen || docEle.msRequestFullScreen;
-            if (rfs) {
-              rfs.call(docEle);
-            }
-            this.src = exitFsImg;
-          } else {
-            var cfs = document.cancelFullScreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || document.exitFullScreen;
-            if (cfs) {
-              cfs.call(document);
-            }
-            this.src = fsImg;
-          }
-        }
-
-        //鼠标进入 显示 工具条
-        videoBody.onmouseenter = function () {
-          videoFooter.classList.add(
-            "css-show-transition",
-            "css-showTrans"
-          );
-        }
-        //鼠标退出 隐藏 工具条
-        videoBody.onmouseleave = function () {
-          videoFooter.classList.add(
-            "css-close-transition",
-            "css-closeTrans"
-          );
-          videoFooter.classList.remove(
-            "css-show-transition",
-            "css-showTrans"
-          );
-        }
-
-        //播放视频
-        operBtn.onclick();
 
         //切换视频
         $('.jksp .content-footer .equi-btn').click(function () {
diff --git a/src/views/farmplant/farmproductstock.vue b/src/views/farmplant/farmproductstock.vue
index f1a832e..0b83744 100644
--- a/src/views/farmplant/farmproductstock.vue
+++ b/src/views/farmplant/farmproductstock.vue
@@ -17,6 +17,18 @@
       </el-form>
         </div>-->
         <div class="table">
+            <div class="search">
+                <div style="float: left">
+                <avue-select
+                    v-model="searchType"
+                    placeholder="请选择农场"
+                    size="small"
+                    @change="typeChange"
+                    :dic="dic"
+                >
+                </avue-select>
+                </div>
+            </div>
             <div class="content">
                 <div class="farm" v-for="(item, index) in data" :key="index">
                     <div class="farm-img">
@@ -319,6 +331,10 @@
 import {
     addck
 } from "@/api/retrieval/retrieval"
+import {
+    getFarmList
+} from "@/api/farm/farm"
+
 import { mapGetters } from "vuex"
 import { regionData } from 'element-china-area-data'
 
@@ -331,6 +347,8 @@
                 user: "",
                 region: "",
             },
+            searchType:"",
+            dic:[],
             //销售字段
             form: {
                 name: "",
@@ -958,6 +976,7 @@
         onLoad (page, params = {}) {
             params['tenantId'] = this.userInfo.tenant_id
             params['deptId'] = this.userInfo.dept_id
+            this.getFarmListDic();
             getList(
                 page.currentPage,
                 page.pageSize,
@@ -970,6 +989,24 @@
                 this.selectionClear()
             })
         },
+        getFarmListDic(){
+            getFarmList().then((res)=>{
+                var data = res.data.data
+                this.dic = [];
+                data.forEach((e)=>{
+                    this.dic.push({
+                        label:e.farmName,
+                        value:e.id
+                    })
+                })
+            })
+        },
+        typeChange(id){
+            var params = {
+                farmId:id
+            }
+            this.onLoad(this.page,params)
+        }
     },
 };
 </script>
diff --git a/src/views/farmplant/process.vue b/src/views/farmplant/process.vue
index 57d439d..1bce293 100644
--- a/src/views/farmplant/process.vue
+++ b/src/views/farmplant/process.vue
@@ -43,7 +43,7 @@
                             </el-button>
                         </div>
                         <div class="btn">
-                            <!-- <el-button style="width: 65px;" plain size="small" @click="openWidow(3,item)">
+                            <!-- <el-button style="width: 65px;" plain size="small" @click="openWindow(3,item)">
                                 <span style="color: #5abf78">出库</span>
                             </el-button>
                             <el-button style="width: 65px;" plain size="small" @click="openWindow(2,item)">
@@ -65,7 +65,7 @@
                 :total="page.total"
             ></el-pagination>
         </div>
-
+        <!-- 销售 -->
         <el-dialog
             title="加工产品销售"
             :modal-append-to-body="false"
@@ -151,7 +151,6 @@
                 </template>
             </avue-form>
         </el-dialog>
-
         <!-- 加工产品 -->
         <el-dialog
             title="加工产品"
@@ -189,6 +188,58 @@
                     <div style="text-align: center">
                         <el-button style="width: 80px" plain @click="cleanKCData">取消</el-button>
                         <el-button style="width: 80px" type="success" plain @click="submitJGloss">确认</el-button>
+                    </div>
+                </template>
+            </avue-form>
+        </el-dialog>
+        <!--出库-->
+        <el-dialog
+            title="出库产品"
+            :modal-append-to-body="false"
+            :append-to-body="true"
+            :close-on-click-modal="false"
+            :before-close="cleanCKData"
+            @close="close"
+            width="30%"
+            :visible.sync="visibleCK"
+            center
+        >
+            <avue-form ref="form" v-model="formCK" :option="optionCK">
+                <template slot-scope="{disabled,size}" slot="name">
+                    <div>
+                        <el-tag type="success">{{ formCK.name }}</el-tag>
+                    </div>
+                </template>
+                <template slot-scope="{disabled,size}" slot="saleDestination">
+                    <div>
+                        <el-cascader
+                            style="width: 100%;"
+                            placeholder="请选择出库去向"
+                            size="large"
+                            :options="optionck"
+                            @change="handleChangeck"
+                            v-model="saleDestination"
+                        ></el-cascader>
+                    </div>
+                </template>
+                <template slot-scope="{disabled,size}" slot="saleNum">
+                    <div style="margin-bottom: -20px">
+                        <el-input type="number" placeholder="请输入出库数量" v-model="formCK.saleNum">
+                            <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i>
+                        </el-input>
+                        <div style="text-align: right;color: #ffb218">可出库量:{{ formCK.weight }}公斤</div>
+                    </div>
+                </template>
+                <template slot-scope="{disabled,size}" slot="salePrice">
+                    <!--          <div style="margin-bottom: -20px">
+                      <el-input type="number" placeholder="请输入销售价格" v-model="formCK.salePrice"><i slot="suffix"
+                                                                                                style="font-style:normal;margin-right: 5px;">元/公斤</i>
+                      </el-input>
+                    </div>-->
+                </template>
+                <template slot="menuForm">
+                    <div style="text-align: center">
+                        <el-button style="width: 120px" type="success" plain @click="submitCK">出库</el-button>
                     </div>
                 </template>
             </avue-form>
@@ -239,6 +290,22 @@
                 processName:"",
                 weight:"",
             },
+            //出库字段
+            formCK: {
+                name: "",
+                proid: "",
+                landId: "",
+                strainId: "",
+                saleTime: "",
+                saleNum: "",
+                saleDestination: "",
+                city: "",
+                county: "",
+                createUser: "",
+                remarks: "",
+
+
+            },
             //损耗字段
             formKC: {
                 name: "",
@@ -263,10 +330,13 @@
                 remarks: "",
                 reason: "0",
                 saleTime: "",
+
+                processName:""
             },
             visible: false,
             visibleKC: false,
             visibleJG: false,
+            visibleCK: false,
             value: true,
             page: {
                 pageSize: 16,
@@ -450,7 +520,7 @@
                 column: [
                     {
                         label: "加工品种",
-                        prop: "strainName",
+                        prop: "processName",
                         span: 24,
                         disabled: true,
                         rules: [
@@ -719,6 +789,29 @@
                 }
             })
         },
+        //出库表单提交
+        submitCK () {
+            var that = this
+            this.$refs.form.validate((vaild, done) => {
+                if (vaild) {
+                    addck(this.formCK).then(() => {
+                        this.onLoad(this.page)
+                        this.$message({
+                            type: "success",
+                            message: "操作成功!"
+                        })
+                        //提交完成,关闭窗口清空数据
+                        that.cleanCKData()
+                        done()
+                    }, error => {
+                        window.console.log(error)
+                        //提交失败,关闭窗口清空数据
+                        that.cleanCKData()
+                        done()
+                    })
+                }
+            })
+        },
         handleChange (value) {
             if (value != null) {
                 this.form.saleDestination = value[0]
@@ -766,10 +859,23 @@
                 this.formJG.createUser = this.userInfo.user_id
                 this.formJG.proid = data.id
                 this.formJG.landId = data.landId
-                this.formJG.weight = data.weight
+                this.formJG.weight = data.productInventoryNum
                 this.formJG.strainId = data.strainId
                 this.formJG.strainName = data.strainName
+
+                this.formKC.processName = data.processName
                 this.visibleJG = true
+            }else if (index == 3) { //出库
+                this.formCK.name = this.userInfo.nick_name
+                this.formCK.createUser = this.userInfo.user_id
+                this.formCK.weight = data.productInventoryNum
+                this.formCK.proid = data.id
+                this.formCK.landId = data.landId
+                this.formCK.strainId = data.strainId
+                this.formCK.strainName = data.strainName
+
+                this.formKC.processName = data.processName
+                this.visibleCK = true
             }
         },
         //销售
@@ -791,6 +897,11 @@
             that.$refs.form.resetFields()
             that.visibleJG = false
         },
+        cleanKCData () {
+            var that = this
+            that.$refs.form.resetFields()
+            that.visibleKC = false
+        },
         handleSizeChange (val) {
             this.page.pageSize = val
             this.onLoad(this.page)

--
Gitblit v1.9.3