duanxiaoduan 1 gadu atpakaļ
vecāks
revīzija
29fde27abf

+ 3 - 3
src/utils/request.js

@@ -14,9 +14,9 @@ if (DoMainString) {
 var reg =  /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/;
 var browserUrl = window.location.hostname
 console.log("========url===",reg.test(browserUrl))
-if (reg.test(browserUrl)){
-  URL = window.location.protocol +"//"+ browserUrl + ":8082/"
-}
+// if (reg.test(browserUrl)){
+//   URL = window.location.protocol +"//"+ browserUrl + ":8082/"
+// }
 
 Cookies.set('url',URL)
 console.log(process.env.VUE_APP_BASE_API,'===========URL1111')

+ 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 })
+          }
+        })
+      })
     }
   }
 }

+ 41 - 2
src/views/basicData/groupColumn/index.vue

@@ -39,6 +39,7 @@
         <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 && ispalyUd" class="success" icon="el-icon-plus" @click="handleGetUd">获取UD栏舍</el-button>
     </div>
     <div class="table">
       <u-table
@@ -238,12 +239,14 @@ 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()
@@ -702,6 +705,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 })
+            }
+          })
+        }
+      })
     }
   }
 }

+ 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 })
+          }
+        })
+      })
     }
   }
 }