Browse Source

Signed-off-by: 段小段 <1729609802@qq.com>

段小段 3 years ago
parent
commit
307f348d6e

+ 8 - 25
src/api/common.js

@@ -8,23 +8,6 @@ export function GetDataByName(data) {
     data
   })
 }
-
-export function GETNurJudge(data) {
-  return request({
-    url: '/authdata/GETNurJudge',
-    method: 'post',
-    data
-  })
-}
-
-export function GETNurJudgeRport(data) {
-  return request({
-    url: '/authdata/GETNurJudgeRport',
-    method: 'post',
-    data
-  })
-}
-
 
 export function ExeSqlJiade(data) {
   return request({
@@ -40,7 +23,6 @@ export function dashboardListJiade(data) {
     data
   })
 }
-
 export function updateDashboardJiade(data) {
   return request({
     url: '/authdata/Updatedashboard',
@@ -102,20 +84,21 @@ export function GetAccount(data) {
     timeout: 600000,
     data
   })
-}
+}
+
 
-export function GetArrList(data) {
+export function postJson(url,data) {
   return request({
-    url: '/authdata/GetArrList',
+    url: process.env.VUE_APP_BASE_API + url,
     method: 'post',
     data
   })
 }
-export function spillage(data) {
+
+export function getJson(url,data) {
   return request({
-    url: '/authdata/spillage',
-    method: 'post',
-    data
+    url: process.env.VUE_APP_BASE_API + url + data,
+    method: 'get'
   })
 }
 

+ 1 - 4
src/views/formulationPlan/dailyExecutionPlan/typePage/dhedFormula.vue

@@ -90,12 +90,9 @@
 </template>
 
 <script>
-import { GetDataByName, GETNurJudge, GetDataByNames, compareSort, ExecDataByConfig, failproccess, PostDataByName, formatNum } from '@/api/common'
+import { GetDataByName, GetDataByNames, ExecDataByConfig, formatNum } from '@/api/common'
 import Pagination2 from '@/components/Pagination2'
-import { parseTime, json2excel, handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
-import { MessageBox } from 'element-ui'
 import Cookies from 'js-cookie'
-import { getToken } from '@/utils/auth'
 export default {
   name: 'DhedFormula',
   inject: ['reload'],

+ 7 - 3
src/views/formulationPlan/dailyExecutionPlan/typePage/materialIssuancePlan.vue

@@ -213,7 +213,7 @@
 </template>
 
 <script>
-import { GetDataByName, GetArrList, PostDataByName, failproccess, ExecDataByConfig } from '@/api/common'
+import { GetDataByName, postJson, PostDataByName, failproccess, ExecDataByConfig } from '@/api/common'
 import draggable from 'vuedraggable'
 import Sortable from 'sortablejs'
 import Cookies from 'js-cookie'
@@ -462,7 +462,9 @@ export default {
     getTimesList() {
       this.listLoadingTimes = true
       this.getdataListParmTimes.parammaps.date = this.date
-      GetArrList(this.getdataListParmTimes).then(response => {
+      const url = 'authdata/GetArrList'
+      const data = this.getdataListParmTimes
+      postJson(url, data).then(response => {
         if (response.data.list !== null) {
           for (let i = 0; i < response.data.list.length; i++) {
             this.$set(response.data.list[i], 'isShowTitle', true)
@@ -554,7 +556,9 @@ export default {
     getList() {
       this.table.listLoading = true
       this.table.getdataListParm.parammaps.date = this.date
-      GetArrList(this.table.getdataListParm).then(response => {
+      const url = 'authdata/GetArrList'
+      const data = this.table.getdataListParm
+      postJson(url, data).then(response => {
         if (response.data !== null) {
           console.log('table数据', response.data.list)
           for (let i = 0; i < response.data.list.length; i++) {

+ 5 - 4
src/views/formulationPlan/dhedFormula/index.vue

@@ -734,7 +734,7 @@
 </template>
 
 <script>
-import { GetDataByName, GETNurJudge, GetDataByNames, compareSort, ExecDataByConfig, failproccess, PostDataByName, formatNum, checkButtons } from '@/api/common'
+import { GetDataByName, postJson, GetDataByNames, compareSort, ExecDataByConfig, failproccess, PostDataByName, formatNum, checkButtons } from '@/api/common'
 import Pagination from '@/components/Pagination'
 import Pagination2 from '@/components/Pagination2'
 import { parseTime, json2excel, handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
@@ -1114,7 +1114,7 @@ export default {
       })
     },
     getIsDisplay() {
-      GetDataByName(this.table.gaListParm2).then(response => {
+      GetDataByName(this.table.getdataListParm2).then(response => {
         console.log(response.data.list[0].inforvalue)
         if (response.data.list !== null) {
           if (response.data.list[0].inforvalue == 0) {
@@ -4772,10 +4772,11 @@ export default {
     },
     getNutritionalList2() {
       this.nutritional.tab1.listLoading2 = true
-      GETNurJudge(this.nutritional.tab1.getdataListParm2).then(response => {
+      const url = 'authdata/GETNurJudge'
+      const data = this.nutritional.tab1.getdataListParm2
+      postJson(url, data).then(response => {
         if (response.msg !== 'fail') {
           if (response.data.list !== null) {
-            // response.data = response.data.sort(compareSort('sort'))
             for (let i = 0; i < response.data.length; i++) {
               if (response.data[i].cowneed == null) {
                 response.data[i].cowneed = ''

+ 5 - 3
src/views/formulationPlan/formulaDistribution/index.vue

@@ -201,7 +201,7 @@
 </template>
 
 <script>
-import { GetDataByName, GetDataByNames, GetArrList, ExecDataByConfig } from '@/api/common'
+import { GetDataByName, GetDataByNames, postJson, ExecDataByConfig } from '@/api/common'
 import Pagination from '@/components/Pagination'
 import { parseTime } from '@/utils/index.js'
 import Cookies from 'js-cookie'
@@ -555,8 +555,10 @@ export default {
     },
     getSeeTab2List() {
       this.see.tab2.table.listLoading = true
-      this.see.tab2.table.getdataListParm.parammaps.ftid = this.see.temp.id
-      GetArrList(this.see.tab2.table.getdataListParm).then(response => {
+      this.see.tab2.table.getdataListParm.parammaps.ftid = this.see.temp.id
+      const url = 'authdata/GetArrList'
+      const data = this.see.tab2.table.getdataListParm
+      postJson(url, data).then(response => {
         console.log('table数据', response.data.list)
         if (response.data.list !== null) {
           for (let i = 0; i < response.data.list.length; i++) {

+ 4 - 2
src/views/formulationPlan/materialIssuancePlan/historyRecord.vue

@@ -122,7 +122,7 @@
 </template>
 
 <script>
-import { GetDataByName, GetArrList } from '@/api/common'
+import { GetDataByName, postJson } from '@/api/common'
 import draggable from 'vuedraggable'
 import Cookies from 'js-cookie'
 import { parseTime } from '@/utils/index.js'
@@ -177,7 +177,9 @@ export default {
     },
     getList() {
       this.table.listLoading = true
-      GetArrList(this.table.getdataListParm).then(response => {
+      const url = 'authdata/GetArrList'
+      const data = this.table.getdataListParm
+      postJson(url, data).then(response => {
         console.log('table数据', response.data.list)
         if (response.data.list !== null) {
           for (let i = 0; i < response.data.list.length; i++) {

File diff suppressed because it is too large
+ 605 - 179
src/views/formulationPlan/materialIssuancePlan/index - 副本.vue


File diff suppressed because it is too large
+ 335 - 706
src/views/formulationPlan/materialIssuancePlan/index.vue


+ 16 - 9
src/views/formulationPlan/recipeTemplate/index.vue

@@ -79,8 +79,8 @@
             <el-table-column label="配方编码" min-width="110px" align="center">
               <template slot-scope="scope">
                 <span v-if="scope.row.NoEdit">{{ scope.row.tcode }}</span>
-                <el-input v-if="scope.row.Edit" v-model.trim="scope.row.tcode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:98%;padding:10px 0;" />
-                <!-- <el-input v-if="scope.row.Edit" v-model.trim="scope.row.tcode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" disabled maxlength="32" style="width:98%;padding:10px 0;" /> -->
+                <!-- <el-input v-if="scope.row.Edit" v-model.trim="scope.row.tcode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" maxlength="32" style="width:98%;padding:10px 0;" /> -->
+                <el-input v-if="scope.row.Edit" v-model.trim="scope.row.tcode" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" disabled maxlength="32" style="width:98%;padding:10px 0;" />
               </template>
             </el-table-column>
             <el-table-column label="配方颜色" min-width="70px" align="center">
@@ -790,7 +790,7 @@
 </template>
 
 <script>
-import { GetDataByName, GetDataByNames, PostDataByName, failproccess, checkButtons, GetArrList, ExecDataByConfig, formatNum } from '@/api/common'
+import { GetDataByName, GetDataByNames, PostDataByName, failproccess, checkButtons, postJson, ExecDataByConfig, formatNum } from '@/api/common'
 import Sortable from 'sortablejs'
 import { MessageBox } from 'element-ui'
 import Cookies from 'js-cookie'
@@ -1067,7 +1067,7 @@ export default {
     },
     uploadData() {
       return {
-        name: 'checkfttype,checkbigcowclass,checkFeed,insertFTUpload,insertFTdetailUpload',
+        name: 'checkfttype,checkbigcowclass,checkFeedtemplet,checkFeed,insertFTUpload,insertFTdetailUpload',
         importParams: '配方名称,牲畜类别,配方类型,备注,饲料组,饲料名称,重量(kg),搅拌延时(min),是否锁定牛头数比例',
         sheetname: 'Sheet1',
         // 登录牧场
@@ -1289,8 +1289,8 @@ export default {
       }
       this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'tname': '', tcode: '', 'tcolor': '#ccc', 'ccid': '', 'ccname': '', 'fttype': '', 'fttypeid': '', 'source': '自定义', 'remark': '' })
       console.log('点击了新增this.table.list====>', this.table.list)
-      // this.table.temp = this.table.list[0]
-      // this.getTcodeList()
+      this.table.temp = this.table.list[0]
+      this.getTcodeList()
     },
     getTcodeList() {
       this.getTcodeParm.parammaps.pastureid = Cookies.get('pastureid')
@@ -1838,7 +1838,12 @@ export default {
              excel.export_json_to_excel({ header: tHeader, data: data1, filename: '配方模板导入报错信息', autoWidth: true, bookType: 'xlsx' })
            })
         }
-      } else {
+      } else {
+        const isRepeat = new RegExp('Duplicate entry :feedtemplet_tname')
+        if (isRepeat.test(res.data)) {
+          this.$notify({ type: 'error', message: '配方名称不可重复,请重新录入', duration: 2000 })
+          return false
+        }
         this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
       }
     },
@@ -2977,8 +2982,10 @@ export default {
       } else {
         this.rowRecipeRecord.getdataListParm.parammaps.startTime = this.rowRecipeRecord.getdataListParm.parammaps.inputDatetime[0]
         this.rowRecipeRecord.getdataListParm.parammaps.stopTime = this.rowRecipeRecord.getdataListParm.parammaps.inputDatetime[1]
-      }
-      GetArrList(this.rowRecipeRecord.getdataListParm).then(response => {
+      }
+      const url = 'authdata/GetArrList'
+      const data = this.rowRecipeRecord.getdataListParm
+      postJson(url, data).then(response => {
         if (response.data.list !== null) {
           for (let i = 0; i < response.data.list.length; i++) {
             if (response.data.list[i].arrList == null) {

+ 0 - 5
src/views/shedProduction/dungScores/index.vue

@@ -777,11 +777,6 @@ export default {
           this.requestParam.parammaps.id = this.selectList[0].id
           PostDataByName(this.requestParam).then(response => {
             if (response.msg === 'fail') {
-              const isRepeat = new RegExp('Duplicate entry :ds')
-              if (isRepeat.test(response.data)) {
-                this.$notify({ type: 'warning', message: '同一栏舍不可重复录入', duration: 2000 })
-                return
-              }
               this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
             } else {
               this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })

+ 1 - 6
src/views/shedProduction/fecalScreen/index.vue

@@ -735,12 +735,7 @@ export default {
           this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
           this.requestParam.parammaps.id = this.selectList[0].id
           PostDataByName(this.requestParam).then(response => {
-            if (response.msg === 'fail') {
-              const barid2 = new RegExp("Duplicate entry :pbto'")
-              if (barid2.test(response.data)) {
-                this.$notify({ type: 'warning', message: '同一栏舍不可重复录入', duration: 2000 })
-                return
-              }
+            if (response.msg === 'fail') {
               this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
             } else {
               this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })

+ 0 - 5
src/views/shedProduction/formulaDryMatter/index.vue

@@ -736,11 +736,6 @@ export default {
               if (barid.test(response.data)) {
                 this.$notify({ type: 'warning', message: '该栏舍该班次今日配方干物质已存在,不可重复生成', duration: 2000 })
                 return
-              }
-              const barid2 = new RegExp("Duplicate entry :barfeedremain_barid'")
-              if (barid2.test(response.data)) {
-                this.$notify({ type: 'warning', message: '同一栏舍不可重复录入', duration: 2000 })
-                return
               }
               this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
             } else {

+ 0 - 5
src/views/shedProduction/materialRemainingRecord/index.vue

@@ -603,11 +603,6 @@ export default {
               if (barid.test(response.data)) {
                 this.$notify({ type: 'warning', message: '该栏舍该班次今日剩料量已存在,不可重复生成', duration: 2000 })
                 return
-              }
-              const barid2 = new RegExp("Duplicate entry :barfeedremain_barid'")
-              if (barid2.test(response.data)) {
-                this.$notify({ type: 'warning', message: '同一栏舍不可重复录入', duration: 2000 })
-                return
               }
               this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
             } else {

+ 1 - 6
src/views/shedProduction/pennsylvaniaSieve/index.vue

@@ -780,12 +780,7 @@ export default {
           this.requestParam.parammaps.pastureid = this.selectList[0].pastureid
           this.requestParam.parammaps.id = this.selectList[0].id
           PostDataByName(this.requestParam).then(response => {
-            if (response.msg === 'fail') {
-              const barid2 = new RegExp("Duplicate entry :btop'")
-              if (barid2.test(response.data)) {
-                this.$notify({ type: 'warning', message: '同一栏舍不可重复录入', duration: 2000 })
-                return
-              }
+            if (response.msg === 'fail') {
               this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
             } else {
               this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })

+ 0 - 5
src/views/shedProduction/performance/index.vue

@@ -1031,11 +1031,6 @@ export default {
                 this.$notify({ type: 'warning', message: '该栏舍今日生产性能已存在,不可重复生成', duration: 2000 })
                 return
               }
-              const barid2 = new RegExp("Duplicate entry :barmilk_barid'")
-              if (barid2.test(response.data)) {
-                this.$notify({ type: 'warning', message: '同一栏舍不可重复录入', duration: 2000 })
-                return
-              }
               this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
             } else {
               this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })

+ 0 - 5
src/views/shedProduction/physicalConditionScore/index.vue

@@ -805,11 +805,6 @@ export default {
           this.requestParam.parammaps.id = this.selectList[0].id
           PostDataByName(this.requestParam).then(response => {
             if (response.msg === 'fail') {
-              const isRepeat = new RegExp('Duplicate entry :ds')
-              if (isRepeat.test(response.data)) {
-                this.$notify({ type: 'warning', message: '同一栏舍不可重复录入', duration: 2000 })
-                return
-              }
               this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
             } else {
               this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })

+ 5 - 3
src/views/statisticalAnalysis/formulationEvaluation/index.vue

@@ -491,7 +491,7 @@
 </template>
 
 <script>
-import { GetDataByName, GETNurJudgeRport } from '@/api/common'
+import { GetDataByName, postJson } from '@/api/common'
 import Cookies from 'js-cookie'
 import Pagination from '@/components/Pagination'
 import { parseTime } from '@/utils/index.js'
@@ -782,8 +782,10 @@ export default {
       this.getListSee()
     },
     getListSee() {
-      this.see.table.listLoading = true
-      GETNurJudgeRport(this.see.table.getdataListParm).then(response => {
+      this.see.table.listLoading = true
+      const url = 'authdata/GETNurJudgeRport'
+      const data = this.see.table.getdataListParm
+      postJson(url, data).then(response => {
         if (response.data !== null) {
           console.log('table数据', response.data)
           this.see.table.list = response.data

Some files were not shown because too many files changed in this diff