瀏覽代碼

更新4-22

duanxiaoduan 3 年之前
父節點
當前提交
d441dd9a5b

二進制
dist.zip


+ 6 - 6
src/views/basicData/feedTable/index.vue

@@ -47,7 +47,7 @@
         <el-button v-if="isRoleEdit" icon="el-icon-close" class="sortCancel" @click="cancelChangeOrder">取消</el-button>
       </div>
 
-      
+
 
       <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>
@@ -60,7 +60,7 @@
         </el-dropdown-menu>
       </el-dropdown>
 
-  
+
 
     </div>
 
@@ -901,8 +901,8 @@ export default {
     },
     uploadData() {
       return {
-        name: 'fname,fclass,feedcode,source,printgroup,allowratio,unitweight,uprice,autozone,autosecondnam,onfirmstartname,trgaddress,jmp,backup1,backup2,backup3',
-        importParams: '饲料名称,饲料分类,唯一编码,饲料来源,计划类型,允许误差数(kg),包装单位重量(kg),单价,跳转重量域(kg),跳转延时,确认开始,继电器位置,无上域,备用字段01,备用字段02,备用字段03',
+        name: 'checkFeedName,checkProjectType, checkFeedCode, checkFeedType, importFeed,updateFeedSortByCode',
+        importParams: '饲料名称,饲料类别,唯一编码,计划类型,包装单位重量,单价,允许误差数,跳转延时,确认开始,是否启用,继电器位置,无上域',
         sheetname: 'Sheet1',
         // 登录牧场
         pastureid: Cookies.get('pastureid'),
@@ -991,7 +991,7 @@ export default {
         console.log('点击了导出模板')
         this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
         console.log('点击了导出模板',this.download.getdataListParm)
-        
+
         GetDataByName(this.download.getdataListParm).then(response => {
           if (response.data.list !== null) {
             this.download.list = response.data.list
@@ -1061,7 +1061,7 @@ export default {
       } else {
         console.log('点击了导出数据')
         this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
-       
+
         GetDataByName(this.download.getdataListParm).then(response => {
           if (response.data.list !== null) {
             this.download.list = response.data.list

+ 121 - 15
src/views/formulationPlan/dailyExecutionPlan/index.vue

@@ -530,9 +530,109 @@
                 <el-date-picker v-model="newGeneration.temp.copyInputDatetime" :picker-options="pickerOptions" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;" :clearable="false" />
               </el-form-item>
             </el-col>
-          </el-row>
-        </el-form>
-        <!-- <div>{{tipsList}}</div> -->
+          </el-row>
+          <p v-if="newGeneration.temp.tips == true" style="font-weight: 700;color: red;text-align: center;">注:撒料计划中存在未分配完栏舍,如下所示;建议及时进行分配</p>
+          <div style="height: 200px;overflow: auto;">
+            <div v-if="myMaxTimes == 1">
+              <div>第一班:</div>
+              <div v-for="(item,index) in tipsList.one" :key="index+'A'" >
+                <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
+                <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
+                  <span v-for="(item2,index2) in item.arrList" :key="index2+'a'">
+                    {{item2.barname}}
+                  </span>
+                </span>
+              </div>
+            </div>
+            <div v-else-if="myMaxTimes == 2">
+              <div>第一班:</div>
+              <div v-for="(item,index) in tipsList.one" :key="index+'B'" >
+                <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
+                <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
+                  <span v-for="(item2,index2) in item.arrList" :key="index2+'b'">
+                    {{item2.barname}}
+                  </span>
+                </span>
+              </div>
+              <div>第二班:</div>
+              <div v-for="(item,index) in tipsList.two" :key="index+'C'" >
+                <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
+                <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
+                  <span v-for="(item2,index2) in item.arrList" :key="index2+'c'">
+                    {{item2.barname}}
+                  </span>
+                </span>
+              </div>
+            </div>
+            <div v-else-if="myMaxTimes == 3">
+              <div>第一班:</div>
+              <div v-for="(item,index) in tipsList.one" :key="index+'D'" >
+                <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
+                <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
+                  <span v-for="(item2,index2) in item.arrList" :key="index2+'d'">
+                    {{item2.barname}}
+                  </span>
+                </span>
+              </div>
+              <div>第二班:</div>
+              <div v-for="(item,index) in tipsList.two" :key="index+'E'" >
+                <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
+                <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
+                  <span v-for="(item2,index2) in item.arrList" :key="index2+'e'">
+                    {{item2.barname}}
+                  </span>
+                </span>
+              </div>
+              <div>第三班:</div>
+              <div v-for="(item,index) in tipsList.three" :key="index+'F'" >
+                <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
+                <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
+                  <span v-for="(item2,index2) in item.arrList" :key="index2+'f'">
+                    {{item2.barname}}
+                  </span>
+                </span>
+              </div>
+            </div>
+            <div v-else>
+              <div>第一班:</div>
+              <div v-for="(item,index) in tipsList.one" :key="index+'G'" >
+                <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
+                <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
+                  <span v-for="(item2,index2) in item.arrList" :key="index2+'g'">
+                    {{item2.barname}}
+                  </span>
+                </span>
+              </div>
+              <div>第二班:</div>
+              <div v-for="(item,index) in tipsList.two" :key="index+'H'" >
+                <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
+                <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
+                  <span v-for="(item2,index2) in item.arrList" :key="index2+'h'">
+                    {{item2.barname}}
+                  </span>
+                </span>
+              </div>
+              <div>第三班:</div>
+              <div v-for="(item,index) in tipsList.three" :key="index+'I'" >
+                <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
+                <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
+                  <span v-for="(item2,index2) in item.arrList" :key="index2+'i'">
+                    {{item2.barname}}
+                  </span>
+                </span>
+              </div>
+              <div>第四班:</div>
+              <div v-for="(item,index) in tipsList.four" :key="index+'J'" >
+                <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
+                <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
+                  <span v-for="(item2,index2) in item.arrList" :key="index2+'j'">
+                    {{item2.barname}}
+                  </span>
+                </span>
+              </div>
+            </div>
+          </div>
+        </el-form>
         <div slot="footer" class="dialog-footer" style="bottom:20px">
           <el-button class="cancelClose" @click="newGeneration.dialogFormVisible = false;getList()">取消</el-button>
           <el-button v-if="newGeneration.dialogStatus== 'newGeneration'" class="save" :disabled="isokDisable" @click="newGenerationData()">确认</el-button>
@@ -700,7 +800,8 @@ export default {
           }
         },
         temp: {
-          inputDatetime: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')]
+          inputDatetime: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')],
+          tips:''
         },
         rules: {
           inputDatetime: [{ type: 'array', required: true, message: '必填', trigger: 'blur' }],
@@ -856,7 +957,7 @@ export default {
     },
     getIsDisplay() {
       GetDataByName(this.maxTime.getMaxTimesParm).then(response => {
-        console.log(response.data.list[0].inforvalue)
+        console.log(response.data.list[0].inforvalue)
         this.myMaxTimes = response.data.list[0].inforvalue
         if (response.data.list[0].inforvalue == 1) {
           this.frequencyList = [{ id: '1', name: '第一班' }]
@@ -1306,10 +1407,12 @@ export default {
       GetDataByName(this.newGeneration.getdataListParm).then(response => {
         console.log('table数据', response.data.list)
         if (response.data.list !== null) {
-          if (response.data.list[0].vmsg == '存在未分配') {
+          if (response.data.list[0].vmsg == '存在未分配') {
+            this.newGeneration.temp.tips = true
             this.$message({ type: 'warning', message: '撒料计划中存在未分配完栏舍,建议及时进行分配', duration: 2000 })
             this.getTips()
           }else{
+            this.newGeneration.temp.tips = false
             this.newGeneration.dialogStatus = 'newGeneration'
             this.newGeneration.dialogFormVisible = true
           }
@@ -1319,23 +1422,26 @@ export default {
     getTips(){
       const url = 'authdata/feedp/undistribute'
       const data = {}
+      // data.times = 1
       data.times = this.myMaxTimes
       data.pastureid = Cookies.get('pastureid')
       this.tipsList = []
       postJson(url, data).then(response => {
         if(response.data !== null){
-          if(this.myMaxTimes == 1){
-            this.tipsList = response.data.one
-          }else if(this.myMaxTimes == 2){
-            this.tipsList.push(response.data.one,response.data.two)
-          }else if(this.myMaxTimes == 3){
-            this.tipsList.push(response.data.one,response.data.two,response.data.three)
-          }else if(this.myMaxTimes == 4){
-            this.tipsList.push(response.data.one,response.data.two,response.data.three,response.data.four)
-          }
+          this.tipsList = response.data
+          // if(this.myMaxTimes == 1){
+          //   this.tipsList = response.data.one
+          // }else if(this.myMaxTimes == 2){
+          //   this.tipsList.push(response.data.one,response.data.two)
+          // }else if(this.myMaxTimes == 3){
+          //   this.tipsList.push(response.data.one,response.data.two,response.data.three)
+          // }else if(this.myMaxTimes == 4){
+          //   this.tipsList.push(response.data.one,response.data.two,response.data.three,response.data.four)
+          // }
         }else{
           this.tipsList = []
         }
+        console.log('this.tipsList==>',this.tipsList)
         this.newGeneration.dialogStatus = 'newGeneration'
         this.newGeneration.dialogFormVisible = true
       })

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

@@ -1052,9 +1052,7 @@ export default {
         tmrname: '',
         maxweight: ''
       }
-      // 注释内容后续版本更
-      // this.create.temp.times = this.table.getdataListParm.parammaps.times
-      // 注释内容后续版本更
+      this.create.temp.times = this.table.getdataListParm.parammaps.times
       this.getDownList()
       this.isDispaly = false
       this.dialogFull = false

+ 0 - 7
src/views/formulationPlan/materialIssuancePlan/index.vue

@@ -272,7 +272,6 @@
           <div class="spreadingMaterial">
             <div>撒料:</div>
             <div class="spreadingMaterialList">
-              <!-- 注释内容后续版本更 -->
               <draggable
                 :disabled="isDropState"
                 id="1"
@@ -288,7 +287,6 @@
                 @start="start1"
                 @end="end1(create.temp)"
               >
-              <!-- 注释内容后续版本更 -->
                 <div v-for="element in create.list2" :key="element.name" class="list-group-item2 item">
                   <div class="arr-l" :style="{'background':element.tbackground}">
                     <div class="arr-l-t">
@@ -346,9 +344,7 @@
                     <i class="el-icon-close" style="position: absolute;right: 0;" @click="handleFLDelete(element)" />
                   </div>
                 </div>
-              <!-- 注释内容后续版本更 -->
               </draggable>
-              <!-- 注释内容后续版本更 -->
             </div>
           </div>
           <div slot="footer" class="dialog-footer" style="height: 55px;">
@@ -363,7 +359,6 @@
       <div class="check">
         <p v-if="check.temp.isDistribution == 0">当前有未分配栏舍,未分配栏舍如下:</p>
         <p v-else>已分配完:当前栏舍已分配完善</p>
-        <!-- {{ check.temp }} -->
         <div v-for="(item,index) in check.temp.ftlist" :key="index">
           <b v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">{{item.ftname}}:</b>
           <span v-if="item.arrList !== null && item.arrList !== undefined && item.arrList.length>0">
@@ -833,9 +828,7 @@ export default {
     handleCreate() {
       console.log('新增车次')
       this.create.temp = { sel: 1, tmrid: '', tmrid2: '', maxweight: '', issplit: 1, begintime: '', sumweight: 0, display: '', times: 1, ftid: '', ftname: '', tmrname: '', maxweight: '' }
-      // 注释内容后续版本更
       this.create.temp.times = this.table.getdataListParm.parammaps.times
-      // 注释内容后续版本更
       this.getDownList()
       this.isDispaly = false
       this.dialogFull = false

+ 198 - 118
src/views/formulationPlan/recipeTemplate/index.vue

@@ -43,6 +43,8 @@
           <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新增</el-button>
           <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" @click="handleDelete">删除</el-button>
           <el-button v-if="isRoleEdit" class="copy" icon="el-icon-copy-document" @click="handleCopy">复制</el-button>
+          <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" @click="handleTakeEffect">生效</el-button>
+          <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" @click="handleDisable">禁用</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>
@@ -1059,7 +1061,7 @@ export default {
         name: 'getTcode', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
         parammaps: { pastureid: '', fttypeid: '' }
       },
-      sourceList: [{ id: '0', name: '自定义' }, { id: '1', name: '集团下发未调整' }, { id: '2', name: '集团下发有调整' }]
+      sourceList: [{ id: '0', name: '自定义' }, { id: '1', name: '集团下发未调整' }, { id: '2', name: '集团下发有调整' }, { id: '3', name: '导入' }]
     }
   },
   computed: {
@@ -2389,123 +2391,135 @@ export default {
       this.table2.updateList = Object.assign({}, row)
     },
     updateData2(row) {
-      console.log('点击了详情编辑保存', row)
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.table2.temp.pastureid = row.pastureid
-      this.table2.temp.ftid = this.table2.getdataListParm.parammaps.ftid
-      this.table2.temp.fid = row.fid
-      this.table2.temp.fname = this.table2.temp.fname
-      this.table2.temp.fweight = row.fweight
-      this.table2.temp.islockcount = row.islockcount
-      this.table2.temp.sort = row.sort
-      this.table2.temp.feedgroup = row.feedgroup
-      this.table2.temp.preftid = this.table2.temp.preftid
-      this.table2.temp.autosecond = row.autosecond
-      this.table2.temp.id = row.id
-      console.log('this.table2.updateList', this.table2.updateList)
-      console.log('temp', this.table2.temp)
-      var status = ''
-      if (parseFloat(this.table2.temp.fweight) > parseFloat(this.table2.updateList.fweight)) {
-        status = 0
-      } else {
-        status = 1
-      }
-      if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
-        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 })
-        return false
-      } else if (this.table2.temp.fid == '') {
-        this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
-        return false
-      } else if (this.table2.temp.fweight == '') {
-        this.$message({ type: 'error', message: '重量不能为空', duration: 2000 })
-        return false
-      } else if (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
-      } else {
-        this.table2.temp.sort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
-      }
-      if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
-        if (parseInt(this.table2.temp.preftid) > 0) {
-          this.$message({ type: 'error', message: '饲料名称不能选择预混配方', duration: 2000 })
-          return false
-        }
-      }
-      // 校验顺序是否>=0
-      var ruleSort = /^\d+$/
-      if (!ruleSort.test(this.table2.temp.sort)) {
-        this.$message({ type: 'error', message: '饲料顺序不可为负数或小数', duration: 2000 })
-        return false
-      }
-      this.table2.temp.fweight = formatNum(this.table2.temp.fweight, 3) // 根据默认参数设置小数位数
-      row.fweight = formatNum(row.fweight, 3)
-      // 检验重量>0
-      // var ruleWeight = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
-      if (this.table2.temp.fweight == 0) {
-        this.$message({ type: 'error', message: '重量请输入正数,最多保留三位小数', duration: 2000 })
-        return false
-      }
-      this.requestParam.common = { 'returnmap': '0' }
-      this.requestParam.data = []
-      this.requestParam.data[0] = { 'name': 'insertFitHistory', 'type': 'e', 'parammaps': {
-        pastureid: row.pastureid,
-        ftid: this.table2.getdataListParm.parammaps.ftid,
-        weight: String(row.fweight),
-        preftid: this.table2.temp.preftid,
-        dateTime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
-        slid: this.table2.temp.id,
-        fid: row.fid
-      }}
-      this.requestParam.data[1] = { 'name': 'updateFTdetail', 'type': 'e', 'parammaps': {
-        pastureid: row.pastureid,
-        ftid: this.table2.getdataListParm.parammaps.ftid,
-        fid: row.fid,
-        fname: this.table2.temp.fname,
-        fweight: String(row.fweight),
-        islockcount: row.islockcount,
-        sort: row.sort,
-        feedgroup: row.feedgroup,
-        preftid: this.table2.temp.preftid,
-        autosecond: row.autosecond,
-        id: row.id
-      }}
-      this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
-        pastureid: row.pastureid,
-        ftid: this.table2.getdataListParm.parammaps.ftid,
-        type: this.table2.getdataListParm.parammaps.fttypeid,
-        status: status
-      }}
-      this.requestParam.data[3] = { 'name': 'updateFTdetailbySort', 'type': 'e', 'parammaps': {
-        pastureid: row.pastureid,
-        ftid: this.table2.getdataListParm.parammaps.ftid,
-        sort: row.sort,
-        feedgroup: row.feedgroup
-      }}
-      this.requestParam.data[4] = { 'name': 'updateFTdetailGroup', 'type': 'e', 'parammaps': {
-        pastureid: this.table2.getdataListParm.parammaps.pastureid,
-        ftid: this.table2.getdataListParm.parammaps.ftid
-      }}
-      ExecDataByConfig(this.requestParam).then(response => {
-        console.log('新增保存发送参数', this.requestParam)
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
-          this.getList2()
-          this.getList3()
-          this.dropState = false
-        } else {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        }
-      })
-    },
+          console.log('点击了详情编辑保存', row)
+          this.isokDisable = true
+          setTimeout(() => {
+            this.isokDisable = false
+          }, 1000)
+          this.table2.temp.pastureid = row.pastureid
+          this.table2.temp.ftid = this.table2.getdataListParm.parammaps.ftid
+          this.table2.temp.fid = row.fid
+          this.table2.temp.fname = this.table2.temp.fname
+          this.table2.temp.fweight = row.fweight
+          this.table2.temp.islockcount = row.islockcount
+          this.table2.temp.sort = row.sort
+          this.table2.temp.feedgroup = row.feedgroup
+          this.table2.temp.preftid = this.table2.temp.preftid
+          this.table2.temp.autosecond = row.autosecond
+          this.table2.temp.id = row.id
+          console.log('this.table2.updateList', this.table2.updateList)
+          console.log('temp', this.table2.temp)
+          // var status = ''
+          // if (parseFloat(this.table2.temp.fweight) > parseFloat(this.table2.updateList.fweight)) {
+          //   status = 0
+          // } else {
+          //   status = 1
+          // }
+          if (this.table2.temp.fid == '' && this.table2.temp.fweight == '' && this.table2.temp.autosecond == '') {
+            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 })
+            return false
+          } else if (this.table2.temp.fid == '') {
+            this.$message({ type: 'error', message: '饲料名称不能为空', duration: 2000 })
+            return false
+          } else if (this.table2.temp.fweight == '') {
+            this.$message({ type: 'error', message: '重量不能为空', duration: 2000 })
+            return false
+          } else if (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
+          } else {
+            this.table2.temp.sort = parseInt(this.table2.list[this.table2.list.length - 1].sort) + 1
+          }
+          if (this.table2.getdataListParm.parammaps.fttypeid == 2) {
+            if (parseInt(this.table2.temp.preftid) > 0) {
+              this.$message({ type: 'error', message: '饲料名称不能选择预混配方', duration: 2000 })
+              return false
+            }
+          }
+          // 校验顺序是否>=0
+          var ruleSort = /^\d+$/
+          if (!ruleSort.test(this.table2.temp.sort)) {
+            this.$message({ type: 'error', message: '饲料顺序不可为负数或小数', duration: 2000 })
+            return false
+          }
+          this.table2.temp.fweight = formatNum(this.table2.temp.fweight, 3) // 根据默认参数设置小数位数
+          row.fweight = formatNum(row.fweight, 3)
+          // 检验重量>0
+          // var ruleWeight = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
+          if (this.table2.temp.fweight == 0) {
+            this.$message({ type: 'error', message: '重量请输入正数,最多保留三位小数', duration: 2000 })
+            return false
+          }
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertFitHistory', 'type': 'e', 'parammaps': {
+            pastureid: row.pastureid,
+            ftid: this.table2.getdataListParm.parammaps.ftid,
+            weight: String(row.fweight),
+            preftid: this.table2.temp.preftid,
+            dateTime: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
+            slid: this.table2.temp.id,
+            fid: row.fid
+          }}
+          this.requestParam.data[1] = { 'name': 'updateFTdetail', 'type': 'e', 'parammaps': {
+            pastureid: row.pastureid,
+            ftid: this.table2.getdataListParm.parammaps.ftid,
+            fid: row.fid,
+            fname: this.table2.temp.fname,
+            fweight: String(row.fweight),
+            islockcount: row.islockcount,
+            sort: row.sort,
+            feedgroup: row.feedgroup,
+            preftid: this.table2.temp.preftid,
+            autosecond: row.autosecond,
+            id: row.id
+          }}
+          this.requestParam.data[2] = { 'name': 'updateFPbyFTChange', 'type': 'e', 'parammaps': {
+            pastureid: row.pastureid,
+            ftid: this.table2.getdataListParm.parammaps.ftid,
+            type: this.table2.getdataListParm.parammaps.fttypeid,
+            // status: status
+          }}
+          this.requestParam.data[3] = { 'name': 'updateFTdetailbySort', 'type': 'e', 'parammaps': {
+            pastureid: row.pastureid,
+            ftid: this.table2.getdataListParm.parammaps.ftid,
+            sort: row.sort,
+            feedgroup: row.feedgroup
+          }}
+          this.requestParam.data[4] = { 'name': 'updateFTdetailGroup', 'type': 'e', 'parammaps': {
+            pastureid: this.table2.getdataListParm.parammaps.pastureid,
+            ftid: this.table2.getdataListParm.parammaps.ftid
+          }}
+          const url = 'authdata/ftdetail/edit'
+          const data = this.requestParam
+          postJson(url, data).then(response => {
+            if (response.msg !== 'fail') {
+              this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+              this.getList2()
+              this.getList3()
+              this.dropState = false
+            } else {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            }
+          })
+          // ExecDataByConfig(this.requestParam).then(response => {
+          //   console.log('新增保存发送参数', this.requestParam)
+          //   if (response.msg !== 'fail') {
+          //     this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+          //     this.getList2()
+          //     this.getList3()
+          //     this.dropState = false
+          //   } else {
+          //     this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          //   }
+          // })
+        },
     updateCancel2(row) {
       console.log('点击了详情编辑取消')
       // 饲料组编辑false,不可编辑true
@@ -3048,6 +3062,72 @@ export default {
       this.$refs.myContainer.style.posiiton = ''
       this.$refs.detail.style.posiiton = ''
       this.$refs.detail.style.zIndex = ''
+    },
+    handleTakeEffect() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否生效?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          for (let i = 0; i < this.selectList.length; i++) {
+            // this.$set(this.selectList[i], 'enable', '1')
+            this.selectList[i].enable = 1
+          }
+          console.log('生效', this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'updateRemainplanEnable', 'type': 'e', 'parammaps': {
+            enable: '@insertSpotList.enable',
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('生效保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '生效失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '生效成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    },
+    handleDisable() {
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择车次信息', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否禁用?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          for (let i = 0; i < this.selectList.length; i++) {
+            // this.$set(this.selectList[i], 'enable', '1')
+            this.selectList[i].enable = 0
+          }
+          console.log('禁用', this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'updateRemainplanEnable', 'type': 'e', 'parammaps': {
+            enable: '@insertSpotList.enable',
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('禁用保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '禁用失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '禁用成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
     }
   }
 }

+ 36 - 156
src/views/formulationPlan/surplusMaterialPlan/index.vue

@@ -14,103 +14,6 @@
       <el-button class="import" style="float: right;" @click="handleHistoryRecords">历史记录</el-button>
     </div>
     <div class="search" />
-
-    <!-- <div class="table">
-      <el-table
-        id="table"
-        :key="table.tableKey"
-        v-loading="table.listLoading"
-        element-loading-text="给我一点时间"
-        :data="table.list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable table-fixed"
-        row-key="id"
-        @selection-change="handleSelect"
-      >
-        <el-table-column type="selection" min-width="50" />
-        <el-table-column label="车次" min-width="80px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.sort }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.sort" type="number" style="width:95%;padding:10px 0;" />
-          </template>
-        </el-table-column>
-        <el-table-column label="栏舍" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.qstr }}</span>
-            <el-select v-if="scope.row.Edit" v-model="scope.row.barid" multiple filterable placeholder="栏舍名称" class="filter-item" style="width:95%;padding:10px 0;" @change="changeBars">
-              <el-option v-for="item in barsList" :key="item.id" :label="item.bname" :value="item.id" />
-            </el-select>
-          </template>
-        </el-table-column>
-        <el-table-column label="TMR编号" prop="weight" min-width="110px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.tmrcode }}</span>
-            <el-select v-if="scope.row.Edit" v-model="scope.row.tmrid" filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeTMRNumber(value, scope.row)}">
-              <el-option v-for="item in TMRNumberList" :key="item.id" :label="item.eqcode" :value="item.id" />
-            </el-select>
-          </template>
-        </el-table-column>
-        <el-table-column label="生效" min-width="70px" align="center">
-          <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 label="班次" min-width="120px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.times }}</span>
-            <el-select v-if="scope.row.Edit" v-model="scope.row.times" filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeTimes(value, scope.row)}">
-              <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>
-          </template>
-        </el-table-column>
-        <el-table-column label="撒料计划车次跟随" min-width="90px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.lppcode }}</span>
-            <el-select v-if="scope.row.Edit" v-model="scope.row.lppid" filterable clearable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeCarFollow(value, scope.row)}">
-              <el-option v-for="item in carFollowList" :key="item.id" :label="item.lppcode" :value="item.id" />
-            </el-select>
-          </template>
-        </el-table-column>
-    
-        <el-table-column label="剩料处理方式" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.treatmethod }}</span>
-            <el-select v-if="scope.row.Edit" v-model="scope.row.treatmethod" filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="(value)=> {changeResidueDisposal(value, scope.row)}">
-              <el-option v-for="item in residueDisposalList" :key="item.value" :label="item.label" :value="item.label" />
-            </el-select>
-          </template>
-        </el-table-column>
-        <el-table-column label="转投栏舍" min-width="130px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.NoEdit">{{ scope.row.hstr }}</span>
-            <el-select v-if="scope.row.Edit" v-model="scope.row.useinbarid" :disabled="scope.row.treatmethod == '继续饲喂'" multiple filterable placeholder="" class="filter-item" style="width:95%;padding:10px 0;" @change="changeTransferbars">
-              <el-option v-for="item in transferbarsList" :key="item.id" :label="item.bname" :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}">
-            <el-button v-if="row.isCreate && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="createData(row)" />
-            <span v-if="row.isCreate && isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="row.isCreate && isRoleEdit" class="minCancel" icon="el-icon-close" @click="createCancel(row)" />
-            <el-button v-if="row.isUpdate && isRoleEdit" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate(row)" />
-            <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="row.isUpdate && isRoleEdit" class="miniDanger" icon="el-icon-delete" @click="handleRowDelete(row)" />
-            <el-button v-if="row.isUpdateSave && isRoleEdit" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData(row)" />
-            <span v-if="row.isUpdateSave && isRoleEdit" class="centerSpan">|</span>
-            <el-button v-if="row.isUpdateSave && isRoleEdit" class="minCancel" icon="el-icon-close" @click="updateCancel(row)" />
-          </template>
-        </el-table-column>
-      </el-table>
-      <span v-if="table.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ table.total }}条</span>
-    </div> -->
-
-
     <div class="table">
       <el-table
         id="table"
@@ -132,19 +35,19 @@
         <el-table-column label="车次" min-width="80px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.sort }}</span>
-             
+
           </template>
         </el-table-column>
         <el-table-column label="栏舍" min-width="110px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.qstr }}</span>
-          
+
           </template>
         </el-table-column>
         <el-table-column label="TMR编号" prop="weight" min-width="110px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.tmrcode }}</span>
-            
+
           </template>
         </el-table-column>
         <el-table-column label="生效" min-width="70px" align="center">
@@ -155,26 +58,26 @@
         <el-table-column label="班次" min-width="120px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.times }}</span>
-            
+
           </template>
         </el-table-column>
         <el-table-column label="撒料计划车次跟随" min-width="90px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.lppcode }}</span>
-           
+
           </template>
         </el-table-column>
-      
+
         <el-table-column label="剩料处理方式" min-width="130px" align="center">
           <template slot-scope="scope">
             <span  >{{ scope.row.treatmethod }}</span>
-        
+
           </template>
         </el-table-column>
         <el-table-column label="转投栏舍" min-width="130px" align="center">
           <template slot-scope="scope">
             <span  >{{ scope.row.hstr }}</span>
-            
+
           </template>
         </el-table-column>
         <!-- <el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width" fixed="right">
@@ -192,7 +95,7 @@
         </el-table-column> -->
         <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="{row}">
-          
+
             <span v-if="isRoleEdit" class="centerSpan">|</span>
             <el-button v-if="isRoleEdit" icon="el-icon-edit-outline" class="miniSuccess" @click="handleUpdate(row)" />
             <span v-if="isRoleEdit" class="centerSpan">|</span>
@@ -222,7 +125,7 @@
       </template>
       <div class="app-add">
         <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="155px" style="width: 100%;margin:0 auto 50px">
-       
+
           <el-row>
             <el-col :span="6">
               <el-form-item label="车次:" prop="sort">
@@ -231,7 +134,7 @@
             </el-col>
 
             <el-col :span="6">
-      
+
               <el-form-item label="栏舍名称:" prop="barid">
                 <el-select  v-model="create.temp.barid" multiple filterable placeholder="栏舍名称" class="filter-item" style="width:95%;padding:10px 0;" @change="changeBars">
                 <el-option v-for="item in barsList" :key="item.id" :label="item.bname" :value="item.id" />
@@ -249,7 +152,7 @@
 
             <el-col :span="6">
               <el-form-item label="生效:" prop="sort">
-              
+
                  <el-switch ref="enable" v-model="create.temp.enable"  active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0"   />
               </el-form-item>
             </el-col>
@@ -274,7 +177,7 @@
 
            <el-col :span="6">
               <el-form-item label="时间:" prop="rtime">
-           
+
                 <el-time-picker  v-model="create.temp.rtime" type="datetime" placeholder="选择时间" format="HH:mm" value-format="HH:mm" style="display: inline-block;width: 95%;" />
               </el-form-item>
             </el-col>
@@ -290,8 +193,8 @@
 
 
 
-            
-             
+
+
           </el-row>
 
           <el-row>
@@ -312,11 +215,11 @@
                         <div style = "width:80px;height:30px;border:1px soild #333;display:inline-block;background: #2ed1f9;padding: 5px 5px;margin-right: 15px;margin-bottom: 15px;"   v-for="item in barSortList"  key="1">{{item.bname}}</div>
                     </transition-group>
                 </draggable>
-  </el-row>  
-         
-  
+  </el-row>
+
+
+
 
-       
         </el-form>
         <div slot="footer" class="dialog-footer">
           <el-button class="cancelClose" @click="create.dialogFormVisible = false;getList()">关闭</el-button>
@@ -730,29 +633,6 @@ export default {
       })
     },
 
-    // 模板新增
-    // handleCreate() {
-    //   console.log('点击了新增车次')
-    //   // 编辑true/不可编辑false
-    //   // 新增操true,编辑false,编辑保存false
-    //   this.dropState = true
-    //   for (let i = 0; i < this.table.list.length; i++) {
-    //     if (this.table.list[i].Edit === true) {
-    //       console.log(123)
-    //       this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
-    //       return false
-    //     }
-    //   }
-    //   var sort = 1
-    //   if (this.table.list.length > 0) {
-    //     sort = parseInt(this.table.list[this.table.list.length - 1].sort) + 1
-    //   } else {
-    //     sort = 1
-    //   }
-    //   this.table.list.unshift({ 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'sort': sort, 'ftid': '', 'ftname': '', 'tmrcode': '', 'tmrid': '', 'times': '', 'lppcode': '', 'lppid': '', 'rtime': '', barid: '', 'treatmethod': '', 'useinbar': '', 'useinbarid': '' })
-    //   console.log(this.table.list)
-    // },
-
     // 新增
     handleCreate() {
       console.log('点击了新增')
@@ -763,7 +643,7 @@ export default {
     },
 
     resetTemp() {
-      this.create.temp = { pastureid: Cookies.get('pastureid'), 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'sort': "", 'ftid': '', 'ftname': '', 'tmrcode': '', 'tmrid': '', 'times': '', 'lppcode': '', 'lppid': '', 'rtime': '', barid: '', 'treatmethod': '', 'useinbar': '', 'useinbarid': '' }
+      this.create.temp = { pastureid: Cookies.get('pastureid'), 'myId': (new Date()).valueOf(), 'Edit': true, 'NoEdit': false, 'isCreate': true, 'isUpdate': false, 'isUpdateSave': false, 'enable': 1, 'sort': "", 'ftid': '', 'ftname': '', 'tmrcode': '', 'tmrid': '', 'times': '', 'lppcode': '', 'lppid': '', 'rtime': '', 'barid': '', 'treatmethod': '', 'useinbar': '', 'useinbarid': '' }
     },
 
     // // 栏舍
@@ -800,12 +680,12 @@ export default {
 
 console.log('点击了栏舍1', barSortList)
 
-      
- 
+
+
       this.table.temp.barid = barSortList
       this.barsNamesIdTempArr = barSortList
       this.$forceUpdate()
- 
+
     },
 
   onStart(){
@@ -852,7 +732,7 @@ console.log('点击了栏舍1', barSortList)
     changeTimes(item) {
       console.log(item)
       this.getCarFollowParm.parammaps.times = item
-      
+
       this.getCarFollowList()
     },
     // 撒料计划车次跟随列表
@@ -889,7 +769,7 @@ console.log('点击了栏舍1', barSortList)
     },
     getTransferbarsList() {
       GetDataByName(this.getTransferbarsParm).then(response => {
-       
+
         if (response.data.list !== null) {
           this.transferbarsList = response.data.list
         }
@@ -1042,9 +922,9 @@ console.log('点击了栏舍1', barSortList)
       }, 1000)
       this.$refs['temp'].validate(valid => {
         if (valid) {
-          
-           
- 
+
+
+
           if (this.create.temp.rtime == null || this.create.temp.rtime == 'null') {
             this.create.temp.rtime = ''
           }
@@ -1155,13 +1035,13 @@ console.log('点击了栏舍1', barSortList)
             }
           })
 
- 
+
         }
       })
     },
 
 
-   
+
 
     createCancel(row) {
       console.log('点击了新增取消')
@@ -1319,10 +1199,10 @@ console.log('点击了栏舍1', barSortList)
 
 
 
-      
-      
-  
-     
+
+
+
+
     },
 
 
@@ -1452,11 +1332,11 @@ console.log('点击了栏舍1', barSortList)
     //       this.dropState = false
     //     }
     //   })
- 
+
     // },
 
 
-    
+
      updateData() {
       console.log('点击了编辑保存')
       this.isokDisable = true

文件差異過大導致無法顯示
+ 161 - 991
src/views/statisticalAnalysis/errorAnalysis/pasture/index-p2备.vue


文件差異過大導致無法顯示
+ 991 - 161
src/views/statisticalAnalysis/errorAnalysis/pasture/index.vue


+ 2 - 8
src/views/statisticalAnalysis/processAnalysis/pasture/index.vue

@@ -13,15 +13,9 @@
         <el-option v-for="item in TMRList" :key="item.tmrtname" :label="item.tmrtname" :value="item.tmrtname" />
       </el-select>
 
-
- <!-- 注释内容后续版本更 -->
-
-       <!-- <el-select v-model="table.getdataListParm.parammaps.error" placeholder="误差筛选范围" class="filter-item" style="width: 220px;" clearable>
+       <el-select v-model="table.getdataListParm.parammaps.error" placeholder="误差筛选范围" class="filter-item" style="width: 220px;" clearable>
         <el-option v-for="item in errorList" :key="item.value" :label="item.label" :value="item.value" />
-      </el-select> -->
-
-
-<!-- 注释内容后续版本更 -->
+      </el-select>
       
       <!-- <el-input v-model="table.getdataListParm.parammaps.tmrtname" placeholder="TMR名称" style="width: 180px;" class="filter-item" clearable /> -->
       <el-select v-model="table.getdataListParm.parammaps.iscompleted" placeholder="工作状态" class="filter-item" style="width: 120px;" clearable>

部分文件因文件數量過多而無法顯示