浏览代码

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

段小段 2 年之前
父节点
当前提交
8680dc8e1e
共有 3 个文件被更改,包括 160 次插入124 次删除
  1. 二进制
      dist.zip
  2. 21 12
      src/views/statisticalAnalysis/processAnalysis/pasture/index.vue
  3. 139 112
      src/views/systemManagement/reminderSettings/index.vue

二进制
dist.zip


+ 21 - 12
src/views/statisticalAnalysis/processAnalysis/pasture/index.vue

@@ -17,7 +17,7 @@
         <el-option v-for="item in workingConditionList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
       <!-- 临时注释 -->
-      <!-- <div style="display: inline-block;" class="filter-item1">
+      <div style="display: inline-block;" class="filter-item1">
         <el-input-number :controls="false" :precision="2" v-model="hlwc1" placeholder="混料误差值" style="width: 120px;" class="filter-item" clearable />
         <span>-</span>
         <el-input-number :controls="false" :precision="2"  v-model="hlwc2" placeholder="混料误差值" style="width: 120px;" class="filter-item" clearable />
@@ -27,8 +27,8 @@
         <span>-</span>
         <el-input-number :controls="false" :precision="2" v-model="hlzq2" placeholder="混料准确率" :min="0" :max="100" style="width: 120px;" class="filter-item" clearable />
       </div>
-      <el-select v-model="table.getdataListParm.parammaps.cixCategory" placeholder="混料类别" class="filter-item" style="width: 120px;" clearable>
-        <el-option v-for="item in cixCategoryList" :key="item.id" :label="item.name" :value="item.id" />
+      <el-select v-model="table.getdataListParm.parammaps.fclassid" placeholder="混料类别" class="filter-item" style="width: 120px;" clearable>
+        <el-option v-for="item in cixCategoryList" :key="item.id" :label="item.fcname" :value="item.id" />
       </el-select>
       <div style="display: inline-block;" class="filter-item1">
         <el-input-number :controls="false" :precision="2" v-model="slwc1" placeholder="撒料误差值" style="width: 120px;" class="filter-item" clearable />
@@ -40,7 +40,7 @@
         <span>-</span>
         <el-input-number :controls="false" :precision="2" v-model="slzq2" placeholder="撒料准确率" :min="0" :max="100" style="width: 120px;" class="filter-item" clearable />
       </div>
-      <el-checkbox v-model="ccys"style="margin-right: 10px;" @change="changeccysChecked">只看超出预设值数据</el-checkbox> -->
+      <el-checkbox v-model="ccys"style="margin-right: 10px;" @change="changeccysChecked">只看超出预设值数据</el-checkbox>
       <!-- 临时注释 -->
       <el-button class="successBorder" @click="handleSearch">查询</el-button>
       <el-button class="successBorder" @click="handleRefresh">重置</el-button>
@@ -564,14 +564,14 @@ export default {
           }
           return time.getTime() > Date.now() + 8.64e7
         }
+      },
+      cixCategoryParm:{
+        name: 'getFeedclassList', offset: 0, pagecount: 0,
+        parammaps: { 'pastureid': Cookies.get('pastureid') }
       },
-      requestParams: [
-        { name: 'getBarListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }},
-        { name: 'getCowclassListEnable', offset: 0, pagecount: 0, parammaps: { 'pastureid': Cookies.get('pastureid') }}
-      ],
       planTypeList: [{ lable: '预混计划', value: '4' }, { lable: '撒料计划', value: '0' }, { lable: '剩料计划', value: '3' }, { lable: '撒料计划-混料', value: '1' }, { lable: '撒料计划-撒料', value: '2' }, { lable: '预称重计划', value: '5' }], // 计划类型
       workingConditionList: [{ id: '0', name: '进行中' }, { id: '1', name: '已完成' }], // 工作状态
-      cixCategoryList: [{ id: '0', name: '饲料' }, { id: '1', name: '精料' }, { id: '2', name: '粗料' }, { id: '3', name: '其他' }], // 混料类别
+      cixCategoryList: [], // 混料类别
 
       // TMR设备列表
       table: {
@@ -590,7 +590,7 @@ export default {
             tmrtname: '',
             lpplantype: '',
             error:'',
-            cixCategory:''
+            fclassid:''
           }
         },
         tableKey: 0,
@@ -688,7 +688,8 @@ export default {
       },
     }
   },
-  created() {
+  created() {
+    this.getCixCategoryList()
     this.getList()
   },
   methods: {
@@ -705,7 +706,15 @@ export default {
          this.TMRList = response.data.list
       })
     },
-
+    getCixCategoryList(){
+      GetDataByName(this.cixCategoryParm).then(response => {
+        if(response.data.list !== null){
+          this.cixCategoryList = response.data.list
+        }else{
+          this.cixCategoryList = []
+        }
+      })
+    },
     // TMR设备列表
     getList() {
       this.table.listLoading = true

+ 139 - 112
src/views/systemManagement/reminderSettings/index.vue

@@ -1,9 +1,6 @@
 <template>
   <div class="app-container">
     <div class="table">
-      <div class="search">
-        <el-button class="success" icon="el-icon-plus" @click="handleCreate">新增</el-button>
-      </div>
       <el-table
         :key="table.tableKey"
         v-loading="table.listLoading"
@@ -47,8 +44,8 @@
               <el-form ref="temp" :rules="temp.rules" :model="temp" label-position="right" label-width="110px" style="width: 100%;margin:0 auto">
                 <el-row>
                   <el-col :span="24">
-                    <el-form-item label="消息名称:" prop="messageName">
-                      <span>{{temp.messageName}}</span>
+                    <el-form-item label="消息名称:" prop="message">
+                      <span>{{temp.message}}</span>
                     </el-form-item>
                   </el-col>
                 </el-row>
@@ -178,6 +175,7 @@
               <el-row :gutter="5">
                 <el-col :span="6">
                   <el-table
+                    ref="setUpTable1"
                     :key="setUp.tableKey1"
                     v-loading="setUp.listLoading1"
                     element-loading-text="给我一点时间"
@@ -190,7 +188,7 @@
                     :cell-style="cellStyle"
                     class="elTable table-fixed"
                     @selection-change="handleSelectionChange1"
-                    :height="450"
+                    :height="350"
                   >
                     <el-table-column type="selection" align="center" width="50" />
                     <el-table-column label="角色名" min-width="100px" align="center" prop="rolename" />
@@ -198,6 +196,7 @@
                 </el-col>
                 <el-col :span="18">
                   <el-table
+                    ref="setUpTable2"
                     :key="setUp.tableKey2"
                     v-loading="setUp.listLoading2"
                     element-loading-text="给我一点时间"
@@ -210,7 +209,7 @@
                     :cell-style="cellStyle"
                     class="elTable table-fixed"
                     @selection-change="handleSelectionChange2"
-                    :height="450"
+                    :height="350"
                   >
                     <el-table-column type="selection" align="center" width="50" />
                     <el-table-column label="用户名称" min-width="130px" align="center" prop="username" />
@@ -396,13 +395,13 @@
           { id: '3', name: '每月' },
         ],//周期类型
         weekList:[
-          { id: 'w1', name: '周一' },
-          { id: 'w2', name: '周二' },
-          { id: 'w3', name: '周三' },
-          { id: 'w4', name: '周四' },
-          { id: 'w5', name: '周五' },
-          { id: 'w6', name: '周六' },
-          { id: 'w7', name: '周日' },
+          { id: '1', name: '周一' },
+          { id: '2', name: '周二' },
+          { id: '3', name: '周三' },
+          { id: '4', name: '周四' },
+          { id: '5', name: '周五' },
+          { id: '6', name: '周六' },
+          { id: '7', name: '周日' },
         ],//周
         monthList:[],//月
         mechanism: '0',
@@ -427,7 +426,6 @@
               pastureid: Cookies.get('pastureid')
             }
           },
-          selectList1:[],
           // 用户
           tableKey2: 0,
           list2: [],
@@ -440,7 +438,6 @@
               roleid:''
             }
           },
-          selectList2:[],
           temp:{}
         },
         see:{
@@ -459,6 +456,8 @@
           add:'新增',
           see:'查看'
         },
+        selectList1:[],
+        selectList2:[],
         isokDisable:false,
         rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
         cellStyle: { padding: 0 + 'px' }
@@ -468,13 +467,12 @@
       this.monthList = []
       for(let i=1;i<=31;i++){
         let obj = {}
-        obj.id = 'd'+i
+        obj.id = i
         obj.name = i+'日'
         this.monthList.push(obj)
       }
       this.getList()
     },
-
     methods: {
       getList() {
         this.table.listLoading = true
@@ -505,45 +503,56 @@
         this.setUp.dialogFormVisible = true
         this.activeName = 'first'
         this.setUp.temp = Object.assign({}, row)
-        this.temp.messageName = row.data.type_name //消息名称
+        this.temp.messageName = row.data.message //消息名称
         this.temp.triggerCondition = row.trigger //触发条件
+
+
+        // 立即
         this.temp.sendingMethod = String(row.data.remind_type) //发送方式
-        // if(this.temp.sendingMethod == '2'){
-        //   this.formatMinutes(row.data.interval_time) //延时
-        // }
-        // this.temp.sendTime = row.data.push_time //发送时间
-        // if(row.data.push_limit == 1){//发送机制
-        //   this.temp.sendingMechanism = '1'
-        // }else if(row.data.push_limit == 0){
-        //   this.temp.sendingMechanism = '3'
-        // }else{
-        //   this.temp.sendingMechanism = '2'
-        // }
-        // this.temp.numberCycles = row.data.push_limit  //循环次数
-        // if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
-        //   this.formatMinutes(row.data.interval_time) //间隔周期
-        // }
-        // data.cycle_type = this.temp.sendingMechanism //循环类型
-        // data.date_type = this.temp.cycleType //周期类型
-        // if(this.temp.cycleType == '1'){
-        //   data.push_date = ''
-        // }else if(this.temp.cycleType == '2'){
-        //   data.push_date = this.temp.week
-        // }else{
-        //   data.push_date = this.temp.month
-        // }
-        // 周期类型?
-        if(row.data.date_type == 1){
-          this.temp.cycleType == '1'
-        }else if(row.data.date_type == 2){
-          this.temp.cycleType == '2'
-          row.data.push_date = this.temp.week
-        }else{
-          this.temp.cycleType == '3'
-          row.data.push_date = this.temp.month
+        if(this.temp.sendingMethod == '1'){
+          this.temp.sendingMechanism = String(row.data.cycle_type) //发送机制
+          if(this.temp.sendingMechanism == '2'){
+            this.temp.numberCycles = row.data.push_limit //循环次数
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              this.formatMinutes(row.data.interval_time) //间隔周期
+            }
+          }
+          if(this.temp.sendingMechanism == '3'){
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              this.formatMinutes(row.data.interval_time) //间隔周期
+            }
+          }
+        }
+        // 延时
+        if(this.temp.sendingMethod == '2'){
+          this.temp.sendingMethod = String(row.data.remind_type) //发送方式
+          if(this.temp.sendingMethod == '2'){
+            this.formatMinutes(row.data.interval_time) //延时
+          }
+          this.temp.sendTime = row.data.push_time //发送时间
+          this.temp.push_limit = String(row.data.push_time) //发送机制
+          if(this.temp.push_limit == '2'){
+            this.temp.numberCycles = row.data.push_limit //循环次数
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              this.formatMinutes(row.data.interval_time) //间隔周期
+            }
+          }
+          if(this.temp.push_limit == '3'){
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              this.formatMinutes(row.data.interval_time) //间隔周期
+            }
+          }
+        }
+        // 指定周期
+        if(this.temp.sendingMethod == '3'){
+          this.temp.cycleType = String(row.data.date_type)  //周期类型
+          if(this.temp.cycleType == '2'){
+            this.temp.week = row.data.push_date
+          }
+          if(this.temp.cycleType == '3'){
+            this.temp.month = row.data.push_date
+          }
         }
-        // this.temp.cycleType = row.data.push_limit  //周期类型
-        this.temp.sendTime = row.data.push_time //发送时间
         this.getList1()
       },
       formatMinutes(minutes) {
@@ -581,17 +590,16 @@
       },
       handleSelectionChange1(val) {
         console.log('勾选数据', val)
-        this.setUp.selectList1 = []
+        this.selectList1 = []
         for(let i=0;i<val.length;i++){
-          this.setUp.selectList1.push(val[i].id)
+          this.selectList1.push(val[i].id)
         }
-        this.setUp.data2.parammaps.roleid = this.setUp.selectList1.join(',')
-        console.log(this.setUp.data2.parammaps.roleid)
+        this.setUp.data2.parammaps.roleid = this.selectList1.join(',')
         this.getList2()
       },
       handleSelectionChange2(val) {
-        console.log('勾选数据', val)
-        this.setUp.selectList2 = val
+        this.selectList2 = val.map(item=>item.username)
+        console.log('勾选数据', this.selectList2)
       },
 
       handleGenerateQRcode(){
@@ -607,7 +615,19 @@
         postJson(url,this.setUp.data1).then(response => {
           if (response.data.list !== null) {
             this.setUp.list1 = response.data.list
-            this.setUp.data2.parammaps.roleid = ''
+            if(this.selectList1.length== 0){
+              this.setUp.data2.parammaps.roleid = response.data.list[0]['id']
+              this.selectList1.push(response.data.list[0]['id'])
+            }
+            this.selectList1.forEach(key => {
+              this.setUp.list1.forEach(row => {
+                if (row.id == key) {
+                  this.$nextTick(() => {
+                      this.$refs.setUpTable1.toggleRowSelection(row, true);
+                  })
+                }
+              })
+            })
             this.getList2()
           } else {
             this.setUp.list1 = []
@@ -623,12 +643,23 @@
         postJson(url,this.setUp.data2).then(response => {
           if (response.data.list !== null) {
             this.setUp.list2 = response.data.list
-            if(this.setUp.selectList1.length > 0){
-              this.$set(this.setUp,'selectList2',response.data.list)
-            }
+            this.selectList2 = []
+            response.data.list.forEach(key => {
+              this.selectList2.push(key.username)
+            })
+            this.selectList2.forEach(key => {
+              this.setUp.list2.forEach(row => {
+                if (row.username == key) {
+                  this.$nextTick(() => {
+                      this.$refs.setUpTable2.toggleRowSelection(row, true);
+                  })
+                }
+              })
+            })
           } else {
             this.setUp.list2 = []
           }
+          console.log(this.selectList2,'this.selectList2')
           setTimeout(() => {
             this.setUp.listLoading2 = false
           }, 100)
@@ -687,7 +718,27 @@
         // delayed1   延时
         // sendTime   发送时间
         // numberCycles   循环次数
+        // 发送方式-立即
         if(this.temp.sendingMethod == '1'){
+          data.sys_name = 'tmrWatch'
+          data.pasture_id = this.setUp.temp.pastureid
+          data.service_id = this.setUp.temp.service_id
+          data.type_name = this.temp.messageName
+          data.template_id = 'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo'
+          data.id = this.setUp.temp.id
+          data.user = this.selectList2
+          data.remind_type = parseInt(this.temp.sendingMethod)  //发送方式123
+          data.cycle_type = parseInt(this.temp.sendingMechanism)  //发送机制123
+          if(this.temp.sendingMechanism == 2){
+            data.push_limit = this.temp.numberCycles  //循环次数
+            data.interval_time = intervalPeriodTime //间隔周期
+          }
+          if(this.temp.sendingMechanism == 3){
+            data.interval_time = intervalPeriodTime //间隔周期
+          }
+        }
+        // 发送方式-延时
+        if(this.temp.sendingMethod == '2'){
           data.id = this.setUp.temp.id
           data.user = this.setUp.temp.user
           data.sys_name = 'tmrWatch'
@@ -695,54 +746,35 @@
           data.template_id = 'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo'
           data.pastureid = Cookies.get('pastureid')
           data.remind_type = parseInt(this.temp.sendingMethod)  //发送方式123
+          data.delay_time = delayedTime //延时
+          data.push_time = this.temp.sendTime //发送时间
           data.cycle_type = parseInt(this.temp.sendingMechanism)  //发送机制123
           if(this.temp.sendingMechanism == 2){
             data.push_limit = this.temp.numberCycles  //循环次数
-            // data.
+            data.interval_time = intervalPeriodTime
+          }
+          if(this.temp.sendingMechanism == 3){
+             data.interval_time = intervalPeriodTime //间隔周期
+          }
+        }
+        // 发送方式-指定周期
+        if(this.temp.sendingMethod == '3'){
+          data.id = this.setUp.temp.id
+          data.user = this.setUp.temp.user
+          data.sys_name = 'tmrWatch'
+          data.type_name = this.temp.messageName
+          data.template_id = 'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo'
+          data.pastureid = Cookies.get('pastureid')
+          data.remind_type = parseInt(this.temp.sendingMethod)  //发送方式123
+          data.cycle_type = '4'//发送机制
+          data.date_type = parseInt(this.temp.cycleType)  //周期类型
+          data.push_time = this.temp.sendTime //发送时间
+          if(this.temp.cycleType == 2){
+            data.push_date = this.temp.week
+          }else{
+            data.push_date = this.temp.month
           }
         }
-        // data.remind_type = parseInt(this.temp.sendingMethod)
-        // let dateTime = 0
-        // let delayed1 = 0
-        // let delayed2 = 0
-        // let delayed3 = 0
-
-        // if(this.temp.delayed1 !== ''){
-        //   delayed1 = parseInt(this.temp.delayed1)*24*60
-        // }else {
-        //   delayed1 = 0
-        // }
-        // if(this.temp.delayed2 !== ''){
-        //   delayed2 = parseInt(this.temp.delayed2)*60
-        // }else {
-        //   delayed2 = 0
-        // }
-        // if(this.temp.delayed3 !== ''){
-        //   delayed3 = parseInt(this.temp.delayed3)
-        // }else{
-        //   delayed2 = 0
-        // }
-        // dateTime = delayed1+ delayed2 + delayed3
-        // if(this.temp.cycleType == '1'){
-        //   data.push_date = 0
-        // }else if(this.temp.cycleType == '2'){
-        //   data.push_date = this.temp.week
-        // }else{
-        //   data.push_date = this.temp.month
-        // }
-        // data.push_time = this.temp.sendTime
-        // data.interval_time = dateTime
-        // if(this.temp.sendingMechanism == '1'){
-        //   data.push_limit = 1
-        // }else if(this.temp.sendingMechanism == '2'){
-        //   data.push_limit = this.temp.numberCycles
-        // }else{
-        //   data.push_limit = 0
-        // }
-
-        // data.cycle_type = this.temp.sendingMechanism //循环类型
-        // data.date_type = this.temp.cycleType //周期类型
-
         postJson(url,data).then(response => {
           if(response.code == 200){
             console.log('成功')
@@ -752,11 +784,6 @@
             console.log('失败')
           }
         })
-      },
-      handleCreate(){
-        this.setUp.dialogStatus = 'add'
-        this.setUp.dialogFormVisible = true
-        this.activeName = 'first'
       }
     }
   }