Browse Source

更新8-12,此次更新对基础信息下舍组栏添加了“牛舍类型及牛群”字段,饲料表添加了“饲料组”字段,仅供现代牧业使用

duanxiaoduan 2 năm trước cách đây
mục cha
commit
84ddb4c876

+ 2 - 2
.env.development

@@ -3,10 +3,10 @@ ENV = 'development'
 
 # base api
 # 测试线
-# VUE_APP_BASE_API = 'http://210.16.189.72:8081/'
+VUE_APP_BASE_API = 'http://210.16.189.72:8081/'
 
 
-VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
+# VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 
 # VUE_APP_BASE_API = 'http://tmrwatch.cn/'
 

BIN
dist.zip


+ 35 - 7
src/views/basicData/feedTable/index.vue

@@ -123,7 +123,14 @@
           <template slot-scope="scope">
             <span>{{ scope.row.uprice }}</span>
           </template>
-        </u-table-column>
+        </u-table-column>
+        <!-- // 现代牧业专用 -->
+        <u-table-column label="饲料组" min-width="50px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.feedgroupname }}</span>
+          </template>
+        </u-table-column>
+        <!-- // 现代牧业专用 -->
         <u-table-column label="跳转重量域(kg)" min-width="90px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.autozone }}</span>
@@ -250,6 +257,15 @@
               <el-form-item label="单价:" prop="uprice">
                 <el-input ref="uprice" v-model="create.temp.uprice"  class="filter-item" placeholder="最多俩位小数" type="number" step="0.01" style="width: 100%;" />
               </el-form-item>
+            </el-col>
+            <!-- // 现代牧业专用 -->
+            <el-col :span="6">
+              <el-form-item label="饲料组:" prop="feedgroupid">
+                <el-select v-model="create.temp.feedgroupid" filterable placeholder="饲料组" class="filter-item" style="width: 100%;">
+                  <el-option v-for="item in feedGroupList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+              <!-- // 现代牧业专用 -->
             </el-col>
           </el-row>
           <el-row>
@@ -761,7 +777,10 @@ export default {
         { name: 'getDictByName', offset: 0, pagecount: 0, params: ['跳转延时'] },
         { name: 'getFeedclassByBig', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
         { name: 'getDictByName2', offset: 0, pagecount: 0, params: ['计划类型'] },
-        { name: 'getTMRListEnableTypeFeed', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '4' }}
+        { name: 'getTMRListEnableTypeFeed', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid'), eqtype: '4' }},
+        // 现代牧业专用
+        { name: 'getFeedgroup', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid')}},
+        // 现代牧业专用
       ],
       requestParams2: {
         name: 'getSysoptEnable', offset: 0, parammaps: { pastureid: Cookies.get('pastureid'), inforname: 'isSmallMaterial' }
@@ -774,7 +793,10 @@ export default {
       feedTypeList: [], // 饲料分类
       planTypeList: [], // 计划类型
       smallMaterialList: [], // 小料秤
-      jmpList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 无上域
+      jmpList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 无上域
+      // 现代牧业专用
+      feedGroupList:[],
+      // 现代牧业专用
       table: {
         tableKey: 0,
         list: [],
@@ -808,12 +830,15 @@ export default {
       create: {
         dialogFormVisible: false,
         dialogStatus: '',
-        temp: { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '' },
+        temp: { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '',feedgroupid:'' },
         rules: {
           printgroupid :[{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
           fname: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
           fclassid: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          feedcode: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
+          feedcode: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          // 现代牧业专用
+          feedgroupid: [{ type: 'number', required: true, message: '必填', trigger: 'blur' }],
+          // 现代牧业专用
         }
       },
 
@@ -1103,7 +1128,10 @@ export default {
         this.jumpDelayList = response.data.getDictByName.list
         this.feedTypeList = response.data.getFeedclassByBig.list
         this.planTypeList = response.data.getDictByName2.list
-        this.smallMaterialList = response.data.getTMRListEnableTypeFeed.list
+        this.smallMaterialList = response.data.getTMRListEnableTypeFeed.list
+        // 现代牧业专用
+        this.feedGroupList = response.data.getFeedgroup.list
+        // 现代牧业专用
       })
     },
 
@@ -1151,7 +1179,7 @@ export default {
     },
 
     resetTemp() {
-      this.create.temp = { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '', jmp: '0' }
+      this.create.temp = { pastureid: Cookies.get('pastureid'), fname: '', fclassid: '', fclass: '', feedcode: '', source: '用户自定义', printgroupid: '1', printgroup: '无', unitweight: '', uprice: '', allowratio: '', autozone: '', autosecond: '0', autosecondname: '禁用', confirmstart: '0', confirmstartname: '禁用', enable: '1', trgaddress: '', backup1: '', backup2: '', backup3: '', jmp: '0',feedgroupid:'' }
     },
     // 计划类型
     changePlanList(item) {

+ 99 - 21
src/views/basicData/groupColumn/index.vue

@@ -102,7 +102,25 @@
           <template slot-scope="scope">
             <el-switch v-model="scope.row.enable" :disabled="scope.row.NoEdit==true" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
           </template>
-        </el-table-column>
+        </el-table-column>
+        <!-- 现代牧业专用 -->
+        <el-table-column label="牛舍类型" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.class }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.classid" filterable class="filter-item" style="width: 95%;padding:10px 0;">
+              <el-option v-for="item in barClassList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="牛群" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.NoEdit">{{ scope.row.scopeherd }}</span>
+            <el-select v-if="scope.row.Edit" v-model="scope.row.scopeherdid" filterable class="filter-item" style="width: 95%;padding:10px 0;">
+              <el-option v-for="item in scopeherdList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <!-- 现代牧业专用 -->
         <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="{row}">
             <!-- 新增 -->
@@ -141,10 +159,14 @@ export default {
     return {
       isRoleEdit: [],
       requestParams: [
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['跳转延时'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['跳转延时'] },
+        { name: 'getBarClass', offset: 0, pagecount: 0, parammaps: {pastureid: Cookies.get('pastureid')} },
+        { name: 'getScopeherd', offset: 0, pagecount: 0, parammaps: {pastureid: Cookies.get('pastureid')} }
       ],
       enableList: [{ id: '1', name: '是' }, { id: '0', name: '否' }],
-      jumpDelayList: [],
+      jumpDelayList: [],
+      barClassList:[],
+      scopeherdList:[],
 
       table: {
         getdataListParm: {
@@ -208,7 +230,9 @@ export default {
     },
     getDownList() {
       GetDataByNames(this.requestParams).then(response => {
-        this.jumpDelayList = response.data.getDictByName.list
+        this.jumpDelayList = response.data.getDictByName.list
+        this.barClassList = response.data.getBarClass.list
+        this.scopeherdList = response.data.getScopeherd.list
       })
     },
     getList() {
@@ -275,7 +299,7 @@ export default {
         }
       }
       this.table.temp.autosecondname = ''
-      this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'isstart': 1, 'bname': '', 'bcode': '', 'allowratio': '', 'autozone': '', 'autosecond': '0', 'autosecondname': '禁用' })
+      this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'isstart': 1, 'bname': '', 'bcode': '', 'allowratio': '', 'autozone': '', 'autosecond': '0', 'autosecondname': '禁用','scopeherdid':'','classid':'' })
     },
     createData(row) {
       console.log('点击了新增保存', row)
@@ -292,10 +316,20 @@ export default {
       }
 
       this.table.temp.isstart = row.isstart
-      this.table.temp.enable = row.enable
+      this.table.temp.enable = row.enable
+      // 现代牧业专用
+      this.table.temp.classid = row.classid
+      this.table.temp.scopeherdid = row.scopeherdid
+      // 现代牧业专用
       // 检验用户名称/角色是否为空
-      if (this.table.temp.bname == '' && this.table.temp.bcode == '') {
-        this.$message({ type: 'error', message: '栏舍名称/栏舍编号不能为空', duration: 2000 })
+      if (this.table.temp.bname == '' && this.table.temp.bcode == '' && this.table.temp.classid == ''&& this.table.temp.scopeherdid == '') {
+        this.$message({ type: 'error', message: '栏舍名称/栏舍编号/牛舍类型/牛群不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.bcode == '' && this.table.temp.classid == ''&& this.table.temp.scopeherdid == '') {
+        this.$message({ type: 'error', message: '栏舍编号/牛舍类型/牛群不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.classid == ''&& this.table.temp.scopeherdid == '') {
+        this.$message({ type: 'error', message: '牛舍类型/牛群不能为空', duration: 2000 })
         return false
       } else if (this.table.temp.bname == '') {
         this.$message({ type: 'error', message: '栏舍名称不能为空', duration: 2000 })
@@ -303,8 +337,24 @@ export default {
       } else if (this.table.temp.bcode == '') {
         this.$message({ type: 'error', message: '栏舍编号不能为空', duration: 2000 })
         return false
+      }else if (this.table.temp.classid == '') {
+        this.$message({ type: 'error', message: '牛舍类型不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.scopeherdid == '') {
+        this.$message({ type: 'error', message: '牛群不能为空', duration: 2000 })
+        return false
+      }
+      // 现代牧业专用
+      if (this.table.temp.bname == '' && this.table.temp.bcode == '') {
+        this.$message({ type: 'error', message: '栏舍名称/栏舍编号/牛舍类型/牛群不能为空', duration: 2000 })
+        return false
+      }else if (this.table.temp.bname == '') {
+        this.$message({ type: 'error', message: '栏舍名称不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.bcode == '') {
+        this.$message({ type: 'error', message: '栏舍编号不能为空', duration: 2000 })
+        return false
       }
-
       // if (this.table.temp.bcode.length > 8) {
       //   this.$message({ type: 'error', message: '栏舍编号请输入1-8位数字', duration: 2000 })
       //   return false
@@ -401,17 +451,45 @@ export default {
       this.table.temp.autosecondname = this.table.temp.autosecondname
       this.table.temp.isstart = row.isstart
       this.table.temp.enable = row.enable
-      this.table.temp.id = row.id
-      // 检验用户名称/角色是否为空
-      if (this.table.temp.bname == '' && this.table.temp.bcode == '') {
-        this.$message({ type: 'error', message: '栏舍名称/栏舍编号不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.bname == '') {
-        this.$message({ type: 'error', message: '栏舍名称不能为空', duration: 2000 })
-        return false
-      } else if (this.table.temp.bcode == '') {
-        this.$message({ type: 'error', message: '栏舍编号不能为空', duration: 2000 })
-        return false
+      this.table.temp.id = row.id
+      // 现代牧业专用
+      this.table.temp.classid = row.classid
+      this.table.temp.scopeherdid = row.scopeherdid
+      // 现代牧业专用
+      // 检验用户名称/角色是否为空
+      // 现代牧业专用
+      if (this.table.temp.bname == '' && this.table.temp.bcode == '' && this.table.temp.classid == ''&& this.table.temp.scopeherdid == '') {
+        this.$message({ type: 'error', message: '栏舍名称/栏舍编号/牛舍类型/牛群不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.bcode == '' && this.table.temp.classid == ''&& this.table.temp.scopeherdid == '') {
+        this.$message({ type: 'error', message: '栏舍编号/牛舍类型/牛群不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.classid == ''&& this.table.temp.scopeherdid == '') {
+        this.$message({ type: 'error', message: '牛舍类型/牛群不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.bname == '') {
+        this.$message({ type: 'error', message: '栏舍名称不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.bcode == '') {
+        this.$message({ type: 'error', message: '栏舍编号不能为空', duration: 2000 })
+        return false
+      }else if (this.table.temp.classid == '') {
+        this.$message({ type: 'error', message: '牛舍类型不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.scopeherdid == '') {
+        this.$message({ type: 'error', message: '牛群不能为空', duration: 2000 })
+        return false
+      }
+      // 现代牧业专用
+      if (this.table.temp.bname == '' && this.table.temp.bcode == '') {
+        this.$message({ type: 'error', message: '栏舍名称/栏舍编号/牛舍类型/牛群不能为空', duration: 2000 })
+        return false
+      }else if (this.table.temp.bname == '') {
+        this.$message({ type: 'error', message: '栏舍名称不能为空', duration: 2000 })
+        return false
+      } else if (this.table.temp.bcode == '') {
+        this.$message({ type: 'error', message: '栏舍编号不能为空', duration: 2000 })
+        return false
       }
       // if (this.table.temp.bcode.length > 8) {
       //   this.$message({ type: 'error', message: '栏舍编号请输入1-8位数字', duration: 2000 })
@@ -621,7 +699,7 @@ export default {
 </script>
 <style lang="scss" scoped>
   .search{margin-top:10px;}
-  
+
   $width:350px;
   $left:325px;
   .selectInput{

+ 48 - 41
src/views/formulationPlan/dhedFormula/index.vue

@@ -48,37 +48,37 @@
         @selection-change="handleSelect"
         @cell-dblclick="celldblclick"
       >
-        <el-table-column type="selection" width="50" />
+        <el-table-column type="selection" width="40" />
         <el-table-column :key="1" label="序号" align="center" type="index" width="50px" class-name="small-padding fixed-width" fixed="left" />
-        <el-table-column label="栏舍名称" min-width="100px" align="center" class-name="small-padding fixed-width" fixed="left">
+        <el-table-column label="栏舍名称" min-width="60px" align="center" class-name="small-padding fixed-width" fixed="left">
           <template slot-scope="scope">
             <span>{{ scope.row.barname }}</span>
           </template>
         </el-table-column>
-        <el-table-column :key="2" label="软件牛头数" min-width="70px" align="center">
+        <el-table-column :key="2" label="软件牛头数" min-width="60px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.softccount }}</span>
           </template>
         </el-table-column>
-        <el-table-column :key="3" label="实际牛头数" min-width="90px" align="center">
+        <el-table-column :key="3" label="实际牛头数" min-width="80px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ccount }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.ccount" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurCcount(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.ccount" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurCcount(scope.row)" />
           </template>
         </el-table-column>
         <el-table-column :key="4" label="系数(%)" min-width="85px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ratio }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.ratio" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurRatio(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.ratio" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurRatio(scope.row)" />
           </template>
         </el-table-column>
         <el-table-column :key="5" label="系数头数" min-width="85px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ccountratio }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.ccountratio" type="number" style="width:95%;padding:10px 0;" @blur="blurCcountratio(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.ccountratio" type="number" style="width:100%;padding:10px 0;" @blur="blurCcountratio(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column :key="6" label="配方模板" min-width="130px" align="center">
+        <el-table-column :key="6" label="配方模板" min-width="100px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ftname }}</span>
             <el-select v-if="scope.row.Edit" v-model="scope.row.ftid" filterable placeholder="配方模板" class="filter-item" style="width:99%;" @change="(value)=> {changeRecipeTemplate(value, scope.row)}">
@@ -86,102 +86,102 @@
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isPtsfname" :key="7" label="补料配方" min-width="130px" align="center">
+        <el-table-column v-if="table.isPtsfname" :key="7" label="补料配方" min-width="100px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.ptsfname }}</span>
-            <el-select v-if="scope.row.Edit" v-model="scope.row.ptsfid" clearable filterable placeholder="补料配方" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeFeedingFormula(value, scope.row)}">
+            <el-select v-if="scope.row.Edit" v-model="scope.row.ptsfid" clearable filterable placeholder="补料配方" class="filter-item" style="width:100%;padding:10px 0;" @change="(value)=> {changeFeedingFormula(value, scope.row)}">
               <el-option v-for="item in feedingFormulaList" :key="item.id" :label="item.tname" :value="item.id" />
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW1" :key="8" label="第一班比例(%)" min-width="130px" align="center">
+        <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:95%;padding:10px 0;"  @focus="focusR(scope.row)" @blur="blurR(scope.row,1)" />
+            <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;"  @focus="focusR(scope.row)" @blur="blurR(scope.row,1)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW1" :key="9" label="第一班重量" min-width="200px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW1" :key="9" label="第一班重量" min-width="100px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w1 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.w1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW(scope.row)" @focus="focusW(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.w1" :disabled="scope.row.isOneWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurW(scope.row)" @focus="focusW(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW1 && table.isPtsfname" :key="10" label="第一班补料重量" min-width="120px" align="center">
+        <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>
-            <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:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+            <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;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW2" :key="11" label="第二班比例(%)" min-width="130px" align="center">
+        <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:95%;padding:10px 0;" @focus="focusR(scope.row)" @blur="blurR(scope.row,2)" />
+            <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;" @focus="focusR(scope.row)" @blur="blurR(scope.row,2)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW2" :key="12" label="第二班重量" min-width="200px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW2" :key="12" label="第二班重量" min-width="100px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w2 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.w2" :disabled="scope.row.isTwoWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW2(scope.row)" @focus="focusW2(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.w2" :disabled="scope.row.isTwoWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurW2(scope.row)" @focus="focusW2(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW2 && table.isPtsfname" :key="13" label="第二班补料重量" min-width="120px" align="center">
+        <el-table-column v-if="table.isRW2 && table.isPtsfname" :key="13" label="第二班补料重量" min-width="100px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.bw2 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.bw2" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw2" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW3" :key="14" label="第三班比例(%)" min-width="130px" align="center">
+        <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:95%;padding:10px 0;" @focus="focusR(scope.row)" @blur="blurR(scope.row,3)" />
+            <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;" @focus="focusR(scope.row)" @blur="blurR(scope.row,3)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW3" :key="15" label="第三班重量" min-width="200px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW3" :key="15" label="第三班重量" min-width="100px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w3 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.w3" :disabled="scope.row.isThreeWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW3(scope.row)" @focus="focusW3(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.w3" :disabled="scope.row.isThreeWeight" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurW3(scope.row)" @focus="focusW3(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW3 && table.isPtsfname" :key="16" label="第三班补料重量" min-width="120px" align="center">
+        <el-table-column v-if="table.isRW3 && table.isPtsfname" :key="16" label="第三班补料重量" min-width="100px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.bw3 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.bw3" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw3" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW4" :key="17" label="第四班比例(%)" min-width="130px" align="center">
+        <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:95%;padding:10px 0;" @focus="focusR(scope.row)" @blur="blurR(scope.row,4)" />
+            <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;" @focus="focusR(scope.row)" @blur="blurR(scope.row,4)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW4" :key="18" label="第四班重量" min-width="200px" align="center" :render-header="renderHeader">
+        <el-table-column v-if="table.isRW4" :key="18" label="第四班重量" min-width="100px" align="center" :render-header="renderHeader">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.w4 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.w4" :disabled="scope.row.isFourWeight" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurW4(scope.row)" @focus="focusW4(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.w4" :disabled="scope.row.isFourWeight" step="0.01" type="number" style="width:100%;padding:10px 0;padding:10px 0;" @blur="blurW4(scope.row)" @focus="focusW4(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isRW4 && table.isPtsfname" :key="19" label="第四班补料重量" min-width="120px" align="center">
+        <el-table-column v-if="table.isRW4 && table.isPtsfname" :key="19" label="第四班补料重量" min-width="90px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.bw4 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.bw4" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:95%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw4" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
           </template>
         </el-table-column>
-        <el-table-column :key="20" label="饲喂总比例(%)" min-width="80px" align="center">
+        <el-table-column :key="20" label="饲喂总比例(%)" min-width="60px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.sumr }}</span>
           </template>
         </el-table-column>
-        <el-table-column :key="21" label="饲喂投喂量" min-width="80px" align="center">
+        <el-table-column :key="21" label="饲喂投喂量" min-width="60px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.todayweight }}</span>
           </template>
         </el-table-column>
-        <el-table-column :key="22" label="饲喂配方重量" min-width="70px" align="center">
+        <el-table-column :key="22" label="饲喂配方重量" min-width="60px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.ftweight }}</span>
           </template>
         </el-table-column>
-        <el-table-column v-if="table.isPtsfname" :key="23" label="补料配方重量" min-width="100px" align="center">
+        <el-table-column v-if="table.isPtsfname" :key="23" label="补料配方重量" min-width="60px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.supplyweight }}</span>
           </template>
@@ -191,17 +191,17 @@
             <span>{{ scope.row.feedweight }}</span>
           </template>
         </el-table-column> -->
-        <el-table-column v-if="table.isPtsfname" :key="24" label="补料投喂量" min-width="70px" align="center">
+        <el-table-column v-if="table.isPtsfname" :key="24" label="补料投喂量" min-width="60px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.todaysupplement }}</span>
           </template>
         </el-table-column>
-        <el-table-column :key="25" label="日投喂量" min-width="70px" align="center">
+        <el-table-column :key="25" label="日投喂量" min-width="60px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.todayfeed }}</span>
           </template>
         </el-table-column>
-        <el-table-column :key="26" label="配方干物质" min-width="70px" align="center">
+        <el-table-column :key="26" label="配方干物质" min-width="60px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.dryweight }}</span>
           </template>
@@ -5154,6 +5154,13 @@ export default {
   .table {
     margin-top: 10px;
   }
+  /deep/ .el-input__inner{
+    padding:0 5px;
+  }
+  /deep/ .el-table .cell{
+    padding-left: 5px;
+    padding-right: 5px;
+  }
 </style>
 <style lang="scss">
   .red-row{

+ 50 - 22
src/views/formulationPlan/recipeTemplate/index.vue

@@ -253,17 +253,19 @@
                 <el-input v-if="scope.row.Edit" v-model="scope.row.fweight" placeholder="重量" step="0.0001" type="number" style="width:95%;padding:10px 0;" />
               </template>
             </el-table-column>
-            <el-table-column label="搅拌延时(min)" min-width="80px" align="center">
+            <el-table-column label="搅拌延时(min)" min-width="80px" align="center">
               <template slot-scope="scope">
                 <span v-if="scope.row.NoEdit">{{ scope.row.autosecond }}</span>
-                <el-select v-if="scope.row.Edit" v-model="scope.row.autosecond" filterable placeholder="搅拌延时" class="filter-item" style="width:95%;padding:10px 0;">
+                <!-- <el-select v-if="scope.row.Edit" v-model="scope.row.autosecond" filterable placeholder="搅拌延时" class="filter-item" style="width:95%;padding:10px 0;">
                   <el-option v-for="item in mixingDelayList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-                <!-- <div v-if="scope.row.Edit">
-                  <el-input-number  v-model="num" style="width:50%;padding:10px 0;dispaly:inline-block;" :controls='false' :precision="2"/>
-                  <span>-</span>
-                  <el-input-number v-model="num" style="width:45%;padding:10px 0;dispaly:inline-block;" :controls='false' :precision="2"/>
-                </div> -->
+                </el-select> -->
+                <el-input v-if="scope.row.Edit" v-model="scope.row.autosecond" step="0.01" type="number" style="width:95%;padding:10px 0;" min-number="0" />
+              </template>
+            </el-table-column>
+            <el-table-column label="允许延时偏差(min)" min-width="80px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.NoEdit">{{ scope.row.deviation }}</span>
+                <el-input v-if="scope.row.Edit" v-model="scope.row.deviation" step="0.01" type="number" style="width:95%;padding:10px 0;" min-number="0" />
               </template>
             </el-table-column>
             <el-table-column v-if="lockCount.isLockCount" label="是否锁定牛头数比例" min-width="80px" align="center">
@@ -2169,7 +2171,7 @@ export default {
       } else {
         var mysort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
       }
-      this.table2.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'groupEdit': false, 'groupNoEdit': true, 'enable': 1, 'feedgroup': '', 'fid': '', 'fname': '', 'fweight': '', 'autosecond': '0', 'islockcount': '0', 'sort': mysort })
+      this.table2.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'groupEdit': false, 'groupNoEdit': true, 'enable': 1, 'feedgroup': '', 'fid': '', 'fname': '', 'fweight': '', 'autosecond': '0','deviation':'0','islockcount': '0', 'sort': mysort })
       console.log(this.table2.list)
     },
     changeFname(item, row) {
@@ -2266,13 +2268,17 @@ export default {
       this.table2.temp.feedgroup = row.feedgroup
       this.table2.temp.preftid = this.table2.temp.preftid
       this.table2.temp.autosecond = row.autosecond
-      if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-        this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时不能为空', duration: 2000 })
+      this.table2.temp.deviation = row.deviation
+      if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '' && this.table2.temp.deviation == '') {
+        this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
         return false
-      } else if (this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-        this.$message({ type: 'error', message: '重量/搅拌延时不能为空', duration: 2000 })
+      } else if (this.table2.temp.fweight == '' && this.table2.temp.autosecond == '' && this.table2.temp.deviation == '') {
+        this.$message({ type: 'error', message: '重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
         return false
-      } else if (this.table2.temp.fid == '') {
+      } else if (this.table2.temp.autosecond == '' && this.table2.temp.deviation == '') {
+        this.$message({ type: 'error', message: '搅拌延时/允许延时偏差不能为空', duration: 2000 })
+        return false
+      }else if (this.table2.temp.fid == '') {
         this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
         return false
       } else if (this.table2.temp.fweight == '') {
@@ -2281,6 +2287,13 @@ export default {
       } else if (this.table2.temp.autosecond == '') {
         this.$message({ type: 'error', message: '搅拌延时不能为空', duration: 2000 })
         return false
+      } else if (this.table2.temp.deviation == '') {
+        this.$message({ type: 'error', message: '允许延时偏差不能为空', duration: 2000 })
+        return false
+      }
+      if(parseFloat(this.table2.temp.deviation) > parseFloat(this.table2.temp.autosecond)){
+        this.$message({ type: 'error', message: '允许延时偏差不可超出搅拌延时', duration: 2000 })
+        return false
       }
       if (this.table2.temp.sort !== '') {
         this.table2.temp.sort = this.table2.temp.sort
@@ -2332,7 +2345,8 @@ export default {
         sort: row.sort,
         feedgroup: row.feedgroup,
         preftid: this.table2.temp.preftid,
-        autosecond: row.autosecond
+        autosecond: row.autosecond,
+        deviation: row.deviation
       }}
       this.requestParam.data[1] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
         pastureid: this.table2.temp.pastureid,
@@ -2401,7 +2415,9 @@ export default {
       row.isGroupDisabled = false
       row.islockcount = String(row.islockcount)
       row.fid = String(row.fid)
-      row.autosecond = String(row.autosecond)
+      // row.autosecond = String(row.autosecond)
+      row.autosecond = row.autosecond
+      row.deviation = row.deviation
       this.table2.temp.fname = row.fname
       this.table2.temp.preftid = row.preftid
       const rowArr = []
@@ -2462,6 +2478,7 @@ export default {
           this.table2.temp.feedgroup = row.feedgroup
           this.table2.temp.preftid = this.table2.temp.preftid
           this.table2.temp.autosecond = row.autosecond
+          this.table2.temp.deviation = row.deviation
           this.table2.temp.id = row.id
           console.log('this.table2.updateList', this.table2.updateList)
           console.log('temp', this.table2.temp)
@@ -2471,13 +2488,16 @@ export default {
           // } else {
           //   status = 1
           // }
-          if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-            this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时不能为空', duration: 2000 })
+          if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '' && this.table2.temp.deviation == '') {
+            this.$message({ type: 'error', message: '饲料名称/重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
+            return false
+          } else if (this.table2.temp.fweight == '' && this.table2.temp.autosecond == '' && this.table2.temp.deviation == '') {
+            this.$message({ type: 'error', message: '重量/搅拌延时/允许延时偏差不能为空', duration: 2000 })
             return false
-          } else if (this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-            this.$message({ type: 'error', message: '重量/搅拌延时不能为空', duration: 2000 })
+          } else if (this.table2.temp.autosecond == '' && this.table2.temp.deviation == '') {
+            this.$message({ type: 'error', message: '搅拌延时/允许延时偏差不能为空', duration: 2000 })
             return false
-          } else if (this.table2.temp.fid == '') {
+          }else if (this.table2.temp.fid == '') {
             this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
             return false
           } else if (this.table2.temp.fweight == '') {
@@ -2486,6 +2506,13 @@ export default {
           } else if (this.table2.temp.autosecond == '') {
             this.$message({ type: 'error', message: '搅拌延时不能为空', duration: 2000 })
             return false
+          } else if (this.table2.temp.deviation == '') {
+            this.$message({ type: 'error', message: '允许延时偏差不能为空', duration: 2000 })
+            return false
+          }
+          if(parseFloat(this.table2.temp.deviation) > parseFloat(this.table2.temp.autosecond)){
+            this.$message({ type: 'error', message: '允许延时偏差不可超出搅拌延时', duration: 2000 })
+            return false
           }
           if (this.table2.temp.sort !== '') {
             this.table2.temp.sort = this.table2.temp.sort
@@ -2538,7 +2565,8 @@ export default {
             feedgroup: row.feedgroup,
             preftid: this.table2.temp.preftid,
             autosecond: row.autosecond,
-            id: row.id
+            id: row.id,
+            deviation:row.deviation
           }}
           this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
             pastureid: row.pastureid,