Browse Source

Merge branch 'feature/merge1226' of duanxiaoduan/tmr-admin into release/v1.0.2

duanxiaoduan 1 year ago
parent
commit
0ddeb7e923

+ 2 - 2
.env.development

@@ -6,8 +6,8 @@ ENV = 'development'
 # VUE_APP_BASE_API = 'http://192.168.1.70:8082/'
 # VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 # 白少后台本地
-# VUE_APP_BASE_API = 'http://192.168.1.77:8081/'
-VUE_APP_BASE_API = 'http://192.168.1.93/'
+VUE_APP_BASE_API = 'http://192.168.1.77:8081/'
+# VUE_APP_BASE_API = 'http://192.168.1.93/'
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.
 # It only does one thing by converting all import() to require().

+ 42 - 3
src/views/basicData/feedTable/index.vue

@@ -45,7 +45,8 @@
        <div v-else style="display: inline-block;">
         <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
         <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
-      </div>
+      </div>
+      <el-button v-if="isRoleEdit && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd">获取UD饲料</el-button>
       <el-upload style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
         <el-button v-if="isRoleEdit" class="import" icon="el-icon-download" style="float: right;">导入</el-button>
       </el-upload>
@@ -984,7 +985,8 @@ export default {
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       dropState: false,
-      isOrder: true,
+      isOrder: true,
+      ispalyUd: true,
       myHeight:document.documentElement.clientHeight - 85- 150
     }
   },
@@ -1032,7 +1034,8 @@ export default {
       }
     })
   },
-  created() {
+  created() {
+    this.getIspalyUd()
     this.getList()
     this.getDownList()
     this.getButtons()
@@ -1988,6 +1991,42 @@ export default {
           })
         }
       })
+    },
+    getIspalyUd(){
+      let url = 'authdata/GetDataByName'
+      let data = {
+        "name":"getSysoptEnable","page":1,"offset":1,"pagecount":1,"returntype":"Map",
+        "parammaps":{"pastureid":Cookies.get('pastureid'),"inforname":"gmUdSync"}
+      }
+      postJson(url,data).then(response => {
+        if (response.msg !== 'fail') {
+          if(response.data.list[0].inforvalue == 0){
+            this.ispalyUd = false
+          }else{
+            this.ispalyUd = true
+          }
+        } else {
+          this.$notify({ title: '请求失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    handleGetUd(){
+      MessageBox.confirm('是否获取UD栏舍?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        let url = 'authdata/gm/udfeed'
+        let data = {
+          pastureId:Cookies.get('pastureid')
+        }
+        postJson(url,data).then(response => {
+          if (response.msg !== 'fail') {
+            this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+            this.getList()
+          } else {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          }
+        })
+      })
     }
   }
 }

+ 70 - 3
src/views/basicData/groupColumn/index.vue

@@ -38,7 +38,8 @@
         <el-button v-if="isRoleEdit" icon="el-icon-folder-checked" class="success" @click="saveChangeOrder">保存</el-button>
         <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
       </div>
-      <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleGetSapCode">获取SAP编码</el-button>
+      <el-button v-if="isRoleEdit && sapUpload.isSap" class="success" icon="el-icon-plus" @click="handleGetSapCode">获取SAP编码</el-button>
+      <el-button v-if="isRoleEdit && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd">获取UD栏舍</el-button>
     </div>
     <div class="table">
       <u-table
@@ -230,6 +231,20 @@ export default {
       textMap: {
         sapCode2: '获取SAP编码',
       },
+      sapUpload:{
+        getdataListParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'xdmyBarSync'
+          }
+        },
+        isSap: false
+      },
       requestParam: {},
       isokDisable: false,
       selectList: [],
@@ -238,15 +253,18 @@ export default {
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       dropState: false,
-      isOrder: true,
+      isOrder: true,
+      ispalyUd: true,
       myHeight:document.documentElement.clientHeight - 85- 150
     }
   },
 
-  created() {
+  created() {
+    this.getIspalyUd()
     this.getList()
     this.getDownList()
     this.getButtons()
+    this.getIsSap()
   },
   mounted() {
     document.addEventListener('click', (e) => {
@@ -262,6 +280,19 @@ export default {
     })
   },
   methods: {
+    getIsSap() {
+      GetDataByName(this.sapUpload.getdataListParm).then(response => {
+        // console.log()
+        if(response.data.list !== null){
+          if(response.data.list[0].inforvalue == 1){
+            this.sapUpload.isSap = true
+          }else{
+            this.sapUpload.isSap = false
+          }
+          console.log(this.sapUpload.isSap)
+        }
+      })
+    },
     getButtons() {
       const Edit = 'GroupColumn'
       const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
@@ -702,6 +733,42 @@ export default {
           })
         }
       })
+    },
+    getIspalyUd(){
+      let url = 'authdata/GetDataByName'
+      let data = {
+        "name":"getSysoptEnable","page":1,"offset":1,"pagecount":1,"returntype":"Map",
+        "parammaps":{"pastureid":Cookies.get('pastureid'),"inforname":"gmUdSync"}
+      }
+      postJson(url,data).then(response => {
+        if (response.msg !== 'fail') {
+          if(response.data.list[0].inforvalue == 0){
+            this.ispalyUd = false
+          }else{
+            this.ispalyUd = true
+          }
+        } else {
+          this.$notify({ title: '请求失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    handleGetUd(){
+      MessageBox.confirm('是否获取UD栏舍?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        let url = 'authdata/gm/udbar'
+        let data = {
+          pastureId:Cookies.get('pastureid')
+        }
+        postJson(url,data).then(response => {
+          if (response.msg !== 'fail') {
+            this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+            this.getList()
+          } else {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          }
+        })
+      })
     }
   }
 }

+ 106 - 5
src/views/formulationPlan/dailyExecutionPlan/index.vue

@@ -51,6 +51,9 @@
         <el-button v-if="dataSynchronization3.isDataSynchronization&&isRoleEdit" class="success" @click="handleDataUpload">数据上传</el-button>
         <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" @click="handleDelete">删除</el-button>
         <el-button v-if="isRoleEdit && sapUpload.isSap" class="success" icon="el-icon-upload2" @click="handleSAPUpload">SAP上传</el-button>
+        <el-button v-if="isRoleEdit && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd1">搅拌数据上传</el-button>
+        <el-button v-if="isRoleEdit && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd2">剩料上传</el-button>
+        <el-button v-if="isRoleEdit && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd3">撒料上传</el-button>
       </div>
       <!-- 日执行计划 -->
       <div class="table">
@@ -852,7 +855,10 @@
         </el-form>
         <div slot="footer" class="dialog-footer" style="bottom:20px">
           <el-button class="cancelClose" @click="sapUpload.dialogFormVisible = false;getList()">取消</el-button>
-          <el-button class="save" :disabled="isokDisable" @click="sapUploadData()">确认</el-button>
+          <el-button class="save" v-if="sapUpload.dialogStatus == 'sapUpload'" :disabled="isokDisable" @click="sapUploadData()">确认</el-button>
+          <el-button class="save" v-else-if="sapUpload.dialogStatus == 'udload1'" :disabled="isokDisable" @click="udData1()">确认</el-button>
+          <el-button class="save" v-else-if="sapUpload.dialogStatus == 'udload2'" :disabled="isokDisable" @click="udData2()">确认</el-button>
+          <el-button class="save" v-else-if="sapUpload.dialogStatus == 'udload3'" :disabled="isokDisable" @click="udData3()">确认</el-button>
         </div>
       </div>
     </el-dialog>
@@ -1082,7 +1088,10 @@ export default {
         revisePlan: '修改计划',
         copy: '复制计划',
         deleteRecord:'删除记录',
-        sapUpload:'SAP上传'
+        sapUpload:'SAP上传',
+        udload1:'搅拌数据上传',
+        udload2:'剩料上传',
+        udload3:'撒料上传',
       },
       isokDisable: false,
       requestParam: {},
@@ -1155,12 +1164,14 @@ export default {
             inforname: 'xdmysapupload'
           }
         },
-        isSap: false
-      }
+        isSap: false,
+      },
+      ispalyUd: false
     }
   },
 
-  created() {
+  created() {
+    this.getIspalyUd()
     this.parentDate = this.table.getdataListParm.parammaps.mydate
     console.log(this.parentDate, 'this.parentDate')
     this.getDataSynchronization()
@@ -2921,6 +2932,96 @@ export default {
           })
         }
       })
+    },
+    getIspalyUd(){
+      let url = 'authdata/GetDataByName'
+      let data = {
+        "name":"getSysoptEnable","page":1,"offset":1,"pagecount":1,"returntype":"Map",
+        "parammaps":{"pastureid":Cookies.get('pastureid'),"inforname":"gmUdSync"}
+      }
+      postJson(url,data).then(response => {
+        if (response.msg !== 'fail') {
+          if(response.data.list[0].inforvalue == 0){
+            this.ispalyUd = false
+          }else{
+            this.ispalyUd = true
+          }
+        } else {
+          this.$notify({ title: '请求失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    handleGetUd1(){
+     this.sapUpload.dialogStatus = 'udload1'
+     this.sapUpload.dialogFormVisible = true
+    },
+    udData1(){
+      this.$refs['sapUpload'].validate(valid => {
+        if (valid) {
+          let url = 'authdata/gm/udutir/push'
+          let data = {
+            pastureId:Cookies.get('pastureid'),
+            date:parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
+          }
+          postJson(url,data).then(response => {
+            if (response.msg !== 'fail') {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.sapUpload.dialogFormVisible = false
+              this.getList()
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            }
+          })
+        }
+      })
+    },
+    handleGetUd2(){
+     this.sapUpload.dialogStatus = 'udload2'
+     this.sapUpload.dialogFormVisible = true
+    },
+    udData2(){
+      this.$refs['sapUpload'].validate(valid => {
+        if (valid) {
+          let url = 'authdata/gm/udbarfeedremain/push'
+          let data = {
+            pastureId:Cookies.get('pastureid'),
+            date:parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
+          }
+          postJson(url,data).then(response => {
+            if (response.msg !== 'fail') {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.sapUpload.dialogFormVisible = false
+              this.getList()
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            }
+          })
+        }
+      })
+    },
+    handleGetUd3(){
+     this.sapUpload.dialogStatus = 'udload3'
+     this.sapUpload.dialogFormVisible = true
+    },
+    udData3(){
+      this.$refs['sapUpload'].validate(valid => {
+        if (valid) {
+          let url = 'authdata/gm/udmaterialIssue/push'
+          let data = {
+            pastureId:Cookies.get('pastureid'),
+            date:parseTime(this.sapUpload.temp.date, '{y}-{m}-{d}')
+          }
+          postJson(url,data).then(response => {
+            if (response.msg !== 'fail') {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.sapUpload.dialogFormVisible = false
+              this.getList()
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            }
+          })
+        }
+      })
     }
   }
 }

+ 93 - 19
src/views/formulationPlan/dhedFormula/index.vue

@@ -14,7 +14,10 @@
         <!-- <el-input v-model="table.getdataListParm.parammaps.tname" placeholder="请输入配方名称" style="width: 180px;" class="filter-item" /> -->
         <el-button class="successBorder" @click="form_search">查询</el-button>
         <el-button v-if="isRoleEdit" class="successBorder" @click="handleDryMatterRegulation">干物质调节</el-button>
-        <el-button v-if="isRoleEdit" class="successBorder" @click="handleSynchronous">软件牛头数同步</el-button>
+        <el-button v-if="isRoleEdit && isSynchronous" class="successBorder" @click="handleSynchronous">软件牛头数同步</el-button>
+        <el-button v-if="isRoleEdit && !isproportion" class="successBorder" @click="handle_batchEdit">批量编辑</el-button>
+        <el-button v-if="isRoleEdit && isproportion" icon="el-icon-folder-checked" class="success" @click="handle_batchEdit_save">保存</el-button>
+        <el-button v-if="isRoleEdit && isproportion" icon="el-icon-close" class="sortCancel" @click="cancelChangeEdit">取消</el-button>
         <el-upload style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
           <el-button v-if="isRoleEdit" class="import" icon="el-icon-download" style="float: right;">导入</el-button>
         </el-upload>
@@ -96,8 +99,9 @@
         </el-table-column>
         <el-table-column v-if="table.isRW1" :key="8" label="第一班比例(%)" min-width="85px" align="center">
           <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.r1 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.r1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,1)" />
+            <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.r1 }}</span>
+            <!-- <textarea class="el-textarea__inner" rows="1" v-if="scope.row.Edit || isproportion" v-model.lazy="scope.row.r1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,1)"></textarea> -->
+            <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.r1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,1)" />
           </template>
         </el-table-column>
         <el-table-column v-if="table.isRW1" :key="9" label="第一班重量" min-width="100px" align="center" :render-header="renderHeader">
@@ -108,14 +112,15 @@
         </el-table-column>
         <el-table-column v-if="table.isRW1 && table.isPtsfname" :key="10" label="第一班补料重量" min-width="100px" align="center">
           <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.bw1 }}</span>
+            <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.bw1 }}</span>
             <el-input v-if="scope.row.Edit" v-model="scope.row.bw1" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
           </template>
         </el-table-column>
         <el-table-column v-if="table.isRW2" :key="11" label="第二班比例(%)" min-width="85px" align="center">
           <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.r2 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.r2" step="0.01" type="number" :disabled="scope.row.isTwoWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,2)" />
+            <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.r2 }}</span>
+            <!-- <textarea class="el-textarea__inner" rows="1" v-if="scope.row.Edit || isproportion" v-model.lazy="scope.row.r2" :disabled="scope.row.isTwoWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,2)" /> -->
+            <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.r2" step="0.01" type="number" :disabled="scope.row.isTwoWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,2)" />
           </template>
         </el-table-column>
         <el-table-column v-if="table.isRW2" :key="12" label="第二班重量" min-width="100px" align="center" :render-header="renderHeader">
@@ -132,8 +137,9 @@
         </el-table-column>
         <el-table-column v-if="table.isRW3" :key="14" label="第三班比例(%)" min-width="85px" align="center">
           <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.r3 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.r3" step="0.01" type="number" :disabled="scope.row.isThreeWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,3)" />
+            <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.r3 }}</span>
+            <!-- <textarea class="el-textarea__inner" rows="1" v-if="scope.row.Edit || isproportion" v-model.lazy="scope.row.r3" :disabled="scope.row.isThreeWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,3)" /> -->
+            <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.r3" step="0.01" type="number" :disabled="scope.row.isThreeWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,3)" />
           </template>
         </el-table-column>
         <el-table-column v-if="table.isRW3" :key="15" label="第三班重量" min-width="100px" align="center" :render-header="renderHeader">
@@ -150,8 +156,9 @@
         </el-table-column>
         <el-table-column v-if="table.isRW4" :key="17" label="第四班比例(%)" min-width="85px" align="center">
           <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.r4 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.r4" step="0.01" type="number" :disabled="scope.row.isFourWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,4)" />
+            <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.r4 }}</span>
+            <!-- <textarea class="el-textarea__inner" rows="1" v-if="scope.row.Edit || isproportion" v-model.lazy="scope.row.r4" :disabled="scope.row.isFourWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,4)" /> -->
+            <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.r4" step="0.01" type="number" :disabled="scope.row.isFourWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,4)" />
           </template>
         </el-table-column>
         <el-table-column v-if="table.isRW4" :key="18" label="第四班重量" min-width="100px" align="center" :render-header="renderHeader">
@@ -168,8 +175,8 @@
         </el-table-column>
         <el-table-column v-if="table.isRW5" :key="20" label="第五班比例(%)" min-width="85px" align="center">
           <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.r5 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.r5" step="0.01" type="number" :disabled="scope.row.isFiveWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,5)" />
+            <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.r5 }}</span>
+            <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.r5" step="0.01" type="number" :disabled="scope.row.isFiveWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,5)" />
           </template>
         </el-table-column>
         <el-table-column v-if="table.isRW5" :key="21" label="第五班重量" min-width="100px" align="center" :render-header="renderHeader">
@@ -186,8 +193,8 @@
         </el-table-column>
         <el-table-column v-if="table.isRW6" :key="23" label="第六班比例(%)" min-width="85px" align="center">
           <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.r6 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.r6" step="0.01" type="number" :disabled="scope.row.isSixWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,6)" />
+            <span v-if="scope.row.NoEdit && !isproportion">{{ scope.row.r6 }}</span>
+            <el-input v-if="scope.row.Edit || isproportion" v-model="scope.row.r6" step="0.01" type="number" :disabled="scope.row.isSixWeight" style="width:100%;padding:10px 0;" @blur="blurR(scope.row,6)" />
           </template>
         </el-table-column>
         <el-table-column v-if="table.isRW6" :key="24" label="第六班重量" min-width="100px" align="center" :render-header="renderHeader">
@@ -787,8 +794,10 @@ export default {
   components: { Pagination, Pagination2, DryMatterRegulation },
   data() {
     return {
+      isproportion:false,
       dialogFull: false,
       isRoleEdit: [],
+      isSynchronous:[],
       headerList: [],
       pickerMinDate: '',
       pickerOptions: {
@@ -816,7 +825,8 @@ export default {
         { name: 'getFTSWLSList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
         { name: 'getFTBLList', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
         { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
-        { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }}
+        { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
+        { name: 'getSysoptEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'),"inforname":"udFeedpSync" }}
       ],
       getFeedTempletNameListParm: {
         name: 'getFeedTempletName',
@@ -1096,6 +1106,7 @@ export default {
       cellStyle: { padding: 0 + 'px' },
       myHeight: document.documentElement.clientHeight - 85 - 140,
       oldRowList:{},
+      oldList:[],
       decimal: parseInt(Cookies.get('decimal')),
       decimalr: parseInt(Cookies.get('decimalr'))
     }
@@ -1141,6 +1152,11 @@ export default {
     },
     getDownList() {
       GetDataByNames(this.requestParams).then(response => {
+        if(response.data.getSysoptEnable.list[0].inforvalue == 1){
+          this.isSynchronous = true
+        }else{
+          this.isSynchronous = false
+        }
         this.recipeTemplateList = response.data.getFTSWLSList.list
         this.feedingFormulaList = response.data.getFTBLList.list
         this.livestockTypeList = response.data.getCowclassListEnable.list
@@ -1850,7 +1866,9 @@ export default {
     },
     celldblclick(row, column, cell, event) {
       console.log(row, '=====')
-      this.handleUpdate(row)
+      if(!this.isproportion){
+        this.handleUpdate(row)
+      }
     },
     // 编辑
     handleUpdate(row) {
@@ -3112,14 +3130,70 @@ export default {
       this.$refs.mychild.restTemp()
     },
     handleSynchronous(){
-      const url = 'authdata/ud/feedp/sync'
-      const data = {}
+      MessageBox.confirm('是否进行软件牛头数同步?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        const url = 'authdata/ud/feedp/sync'
+        const data = {}
+        postJson(url, data).then(response => {
+          if(response.msg !== 'fail'){
+            this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          }
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消软件牛头数同步' })
+      })
+    },
+    handle_batchEdit(){
+      this.isproportion = true
+      console.log(this.isproportion)
+      this.oldList =  JSON.parse(JSON.stringify(this.table.list));
+      // this.table.list.forEach((item,key)=>{
+      //   item.Edit = true
+      //   item.NoEdit = false
+      // })
+      // row.Edit
+    },
+    handle_batchEdit_save(){
+      const arr = this.table.list.filter(item2 => {
+        console.log(item2,'item2')
+          return !this.oldList.some(item1 => item1.r1 === item2.r1 && item1.r2 === item2.r2 && item1.r3 === item2.r3 && item1.r4 === item2.r4 && item1.r5 === item2.r5 && item1.r6 === item2.r6);
+      });
+      const barList = []
+      arr.forEach((item)=>{
+        let obj = {}
+        obj.barname = item.barname
+        obj.ccount = item.ccount
+        obj.ratio = item.ratio
+        obj.ftname = item.ftname
+        obj.ptsfname = item.ptsfname
+        obj.times1 = item.r1
+        obj.times2 = item.r2
+        obj.times3 = item.r3
+        obj.times4 = item.r4
+        obj.times5 = item.r5
+        obj.times6 = item.r6
+        barList.push(obj)
+      })
+      const url = 'authdata/fpdetail/batch/edit'
+      let data = {
+        pastureId:Cookies.get('pastureid'),
+        barList:barList
+      }
       postJson(url, data).then(response => {
         if(response.msg !== 'fail'){
           this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+        }else{
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
         }
+        this.isproportion = false
       })
-    }
+    },
+    cancelChangeEdit() {
+      // 取消顺序
+      this.getList()
+      this.isproportion = false
+    },
   }
 }
 </script>

+ 40 - 2
src/views/formulationPlan/recipeTemplate/index.vue

@@ -41,7 +41,7 @@
         </div>
         <div class="operation">
           <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新增</el-button>
-
+          <el-button v-if="isRoleEdit && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd">配方上传</el-button>
           <el-upload style="float: right;margin-right: 15px;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
             <el-button v-if="isRoleEdit" class="export" icon="el-icon-download" style="float: right;">导入</el-button>
           </el-upload>
@@ -837,7 +837,7 @@ export default {
       dialogFull: false,
       predefineColors: [
         '#E57373', '#F06292', '#BA68C8', '#9575CD', '#7986CB', '#64B5F6', '#4FC3F7', '#4DD0E1', '#4DB6AC', '#81C784', '#AED581', '#DCE775', '#FFF176', '#FFD54F', '#FFB74D', '#FF8A65', '#A1887F', '#E0E0E0', '#90A4AE'
-      ], 
+      ],
       isRoleEdit: [],
       myheight: document.documentElement.clientHeight - 265,
       requestParams: [
@@ -1083,6 +1083,7 @@ export default {
         tableKey: 0, total: 0, listLoading: true, list: []
       },
       isEnlarge: true,
+      ispalyUd: true,
       // enlargeHeight: document.documentElement.clientHeight - 85 - 165 + 50,
       enlargeHeight: document.documentElement.clientHeight - 85 - 165 + 50,
       getTcodeParm: {
@@ -1142,6 +1143,7 @@ export default {
     })
   },
   created() {
+    this.getIspalyUd()
     this.getList()
     this.getButtons()
     this.getDownList()
@@ -3328,6 +3330,42 @@ export default {
           })
         })
       }
+    },
+    getIspalyUd(){
+      let url = 'authdata/GetDataByName'
+      let data = {
+        "name":"getSysoptEnable","page":1,"offset":1,"pagecount":1,"returntype":"Map",
+        "parammaps":{"pastureid":Cookies.get('pastureid'),"inforname":"gmUdSync"}
+      }
+      postJson(url,data).then(response => {
+        if (response.msg !== 'fail') {
+          if(response.data.list[0].inforvalue == 0){
+            this.ispalyUd = false
+          }else{
+            this.ispalyUd = true
+          }
+        } else {
+          this.$notify({ title: '请求失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    handleGetUd(){
+      MessageBox.confirm('是否获取UD栏舍?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        let url = 'authdata/gm/udfeedtemplet/push'
+        let data = {
+          pastureId:Cookies.get('pastureid')
+        }
+        postJson(url,data).then(response => {
+          if (response.msg !== 'fail') {
+            this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+            this.getList()
+          } else {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          }
+        })
+      })
     }
   }
 }

+ 21 - 8
src/views/shedProduction/formulaDryMatter/index.vue

@@ -92,7 +92,13 @@
           <template slot-scope="scope">
             <span>{{ scope.row.operatetime }}</span>
           </template>
-        </el-table-column>
+        </el-table-column>
+        <el-table-column label="是否剩料" min-width="100px" align="center">
+          <template slot-scope="scope">
+            <el-switch v-model="scope.row.excess" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
+          </template>
+        </el-table-column>
+
         <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="{row}">
             <el-button v-if="isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
@@ -179,6 +185,13 @@
               </el-form-item>
             </el-col>
           </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="是否剩料:" prop="excess">
+                <el-switch v-model="create.temp.excess"  active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
+              </el-form-item>
+            </el-col>
+          </el-row>
         </el-form>
         <div slot="footer" class="dialog-footer">
           <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
@@ -262,7 +275,7 @@ export default {
       create: {
         dialogFormVisible: false,
         dialogStatus: '',
-        temp: { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', freshweight: '', dryweight: '', thoweight: '', actweight: '', times: '' },
+        temp: { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', freshweight: '', dryweight: '', thoweight: '', actweight: '', times: '',excess:1 },
         rules: {
           barid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
           times: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
@@ -342,7 +355,7 @@ export default {
     uploadData() {
       return {
         name: 'checkdryfresh,checkbarname,checktimes,insertFtdryUpload',
-        importParams: '栏舍名称,班次,鲜样重量(g),烘干重量(g),操作人,操作日期',
+        importParams: '栏舍名称,班次,鲜样重量(g),烘干重量(g),操作人,操作日期,是否剩料(是/否)',
         sheetname: 'Sheet1',
         // 登录牧场
         pastureid: Cookies.get('pastureid'),
@@ -448,7 +461,7 @@ export default {
 
     // 新增
     resetTemp() {
-      this.create.temp = { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', freshweight: '', dryweight: '', thoweight: '', actweight: '', times: '' }
+      this.create.temp = { pastureid: Cookies.get('pastureid'), operatetime: parseTime(new Date(), '{y}-{m}-{d}'), emp: Cookies.get('employename'), barid: '', barname: '', freshweight: '', dryweight: '', thoweight: '', actweight: '', times: '',excess:1 }
     },
     blurEmp(item) {
       this.create.temp.emp = item.target.value
@@ -827,8 +840,8 @@ export default {
           }
           var excelDatas = [
             {
-              tHeader: ['栏舍名称', '班次', '鲜样重量(g)', '烘干重量(g)', '理论干物质', '实际干物质', '操作人', '操作日期'],
-              filterVal: ['barname', 'timesstr', 'freshweight', 'dryweight', 'thoweight', 'actweight', 'emp', 'operatetime'],
+              tHeader: ['栏舍名称', '班次', '鲜样重量(g)', '烘干重量(g)', '理论干物质', '实际干物质', '操作人', '操作日期','是否剩料'],
+              filterVal: ['barname', 'timesstr', 'freshweight', 'dryweight', 'thoweight', 'actweight', 'emp', 'operatetime','excess_str'],
               tableDatas: this.download.list,
               sheetName: 'Sheet1'
             }
@@ -853,8 +866,8 @@ export default {
           this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
            import('@/vendor/Export2Excel').then(excel => {
              const list1 = res.data.result
-             const tHeader = ['栏舍名称', '班次', '鲜样重量(g)', '烘干重量(g)', '操作人', '操作日期', '错误信息']
-             const filterVal = ['栏舍名称', '班次', '鲜样重量(g)', '烘干重量(g)', '操作人', '操作日期', 'error_msg']
+             const tHeader = ['栏舍名称', '班次', '鲜样重量(g)', '烘干重量(g)', '操作人', '操作日期','是否剩料(是/否)', '错误信息']
+             const filterVal = ['栏舍名称', '班次', '鲜样重量(g)', '烘干重量(g)', '操作人', '操作日期','是否剩料(是/否)', 'error_msg']
              const data1 = this.formatJson(filterVal, list1)
              excel.export_json_to_excel({ header: tHeader, data: data1, filename: '配方干物质导入报错信息', autoWidth: true, bookType: 'xlsx' })
            })

+ 6 - 1
src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue

@@ -668,6 +668,9 @@
             <span>-</span>
             <el-input-number :controls="false" :precision="2" v-model="tab2.table.getdataListParm.parammaps.hlzql2" placeholder="混料正确率" :min="0" :max="100" style="width: 120px;" class="filter-item" clearable />
           </div>
+          <el-select v-model="tab2.table.getdataListParm.parammaps.premix" filterable placeholder="是否预混计划" class="filter-item" style="width: 120px;" clearable>
+            <el-option v-for="item in tab2.premixList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
           <el-checkbox v-model="tab2.table.getdataListParm.parammaps.error" style="margin-right: 10px;">只看超出预设值数据</el-checkbox>
 
           <el-button class="successBorder" style="margin-top: 5px;" @click="form_search2">查询</el-button>
@@ -1687,6 +1690,7 @@ export default {
 
       tab2: {
         TMRNameList:[],
+        premixList:[{id:0,name:'预混'},{id:1,name:'非预混'}],
         table: {
           getdataListParm: {
             name: 'getStatisticsHL',
@@ -1705,7 +1709,8 @@ export default {
               times: '',
               buttontype: '',
               templetname: '',
-              isuse: ''
+              isuse: '',
+              premix:''
             }
           },
           tableKey: 1,

+ 1 - 1
src/views/statisticalAnalysis/feedingEfficiency/pasture/index.vue

@@ -48,7 +48,7 @@
             <el-table-column sortable label="撒料量(kg)" min-width="60px" align="center" prop="撒料量" />
             <el-table-column sortable label="平均混料时间" min-width="70px" align="center" prop="混料时间" />
             <el-table-column sortable label="转投剩料量(kg)" min-width="70px" align="center" prop="转投剩料量" />
-            <el-table-column sortable label="日剩料量(kg)" min-width="70px" align="center" prop="今日剩料量" />
+            <el-table-column sortable label="日剩料量(kg)" min-width="70px" align="center" prop="今日剩料量" />
             <el-table-column sortable label="剩料率(%)" min-width="60px" align="center" prop="剩料率" />
             <el-table-column sortable label="TMR干物质(%)" min-width="65px" align="center" prop="TMR干物质" />
             <el-table-column sortable label="配方干物质采食量(kg/头)" min-width="80px" align="center" prop="配方干物质采食量" />

+ 11 - 1
src/views/statisticalAnalysis/processAnalysis/pasture/index.vue

@@ -39,6 +39,11 @@
         <el-input-number :controls="false" :precision="2" v-model="slzq1" placeholder="撒料准确率" :min="0" :max="100" style="width: 120px;"  class="filter-item" clearable />
         <span>-</span>
         <el-input-number :controls="false" :precision="2" v-model="slzq2" placeholder="撒料准确率" :min="0" :max="100" style="width: 120px;" class="filter-item" clearable />
+      </div>
+      <div style="display: inline-block;" class="filter-item1">
+        <el-input-number :controls="false" :precision="2" v-model="minproesstime" placeholder="过程时间" :min="0" :max="100" style="width: 120px;"  class="filter-item" clearable />
+        <span>-</span>
+        <el-input-number :controls="false" :precision="2" v-model="maxproesstime" placeholder="过程时间" :min="0" :max="100" style="width: 120px;" class="filter-item" clearable />
       </div>
       <el-checkbox v-model="ccys"style="margin-right: 10px;" @change="changeccysChecked">只看超出预设值数据</el-checkbox>
       <!-- 临时注释 -->
@@ -68,6 +73,7 @@
             <el-table-column sortable label="计划类型" min-width="80px" align="center" prop="lpplantype" />
             <el-table-column sortable label="描述" min-width="90px" align="center" prop="remark" />
             <el-table-column sortable label="TMR名称" min-width="80px" align="center" prop="tmrtname" />
+            <el-table-column sortable label="过程时间" min-width="80px" align="center" prop="proesstime" />
           </el-table>
         </div>
         <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table.total }}条</span>
@@ -525,7 +531,9 @@ export default {
       slwc1:undefined ,
       slwc2:undefined ,
       slzq1:undefined ,
-      slzq2:undefined ,
+      slzq2:undefined ,
+      minproesstime:undefined ,
+      maxproesstime:undefined ,
       ccys:false,
       myheight:970,
       title: '',
@@ -891,6 +899,8 @@ export default {
       this.table.getdataListParm.parammaps.slwc2 = this.slwc2
       this.table.getdataListParm.parammaps.slzq1 = this.slzq1
       this.table.getdataListParm.parammaps.slzq2 = this.slzq2
+      this.table.getdataListParm.parammaps.minproesstime = this.minproesstime
+      this.table.getdataListParm.parammaps.maxproesstime = this.maxproesstime
       // if(this.ccys == true){
       //   if(this.table3.getdataListParm.name !== 'getprocessAnalysisHL'){
       //     this.hlwc1 = undefined