Selaa lähdekoodia

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

段小段 2 vuotta sitten
vanhempi
commit
b373ab95c3

+ 2 - 2
.env.development

@@ -6,7 +6,7 @@ ENV = 'development'
 # 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/'
 
@@ -18,7 +18,7 @@ VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 # 陈文强
 # VUE_APP_BASE_API = 'http://192.168.1.87:8081/'
 # 白少杰
-# VUE_APP_BASE_API = 'http://192.168.1.90:8081/'
+VUE_APP_BASE_API = 'http://192.168.1.78:8081/'
 
 #=====
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,

BIN
dist.zip


+ 1 - 1
src/views/statisticalAnalysis/errorAnalysis/pasture/see.vue

@@ -90,7 +90,7 @@
                   class="elTable table-fixed"
                 >
                   <el-table-column label="操作编号" min-width="50px" align="center" prop="sort" />
-                  <el-table-column label="饲料名称" min-width="50px" align="center" prop="fname" />
+                  <el-table-column label="栏舍名称" min-width="50px" align="center" prop="fname" />
                   <el-table-column label="计划重量" min-width="50px" align="center" prop="lweight" />
                   <el-table-column label="实际重量" min-width="50px" align="center" prop="actualweightminus" />
                   <el-table-column label="误差值" min-width="50px" align="center" prop="diff" />

+ 35 - 23
src/views/statisticalAnalysis/feedingEfficiency/pasture/index.vue

@@ -11,11 +11,13 @@
           <el-radio v-model="tab.radio" label="1" @change="changeRadio">配方</el-radio>
           <el-radio v-model="tab.radio" label="2" @change="changeRadio">栏舍</el-radio>
           <el-radio v-model="tab.radio" label="3" @change="changeRadio">牲畜类别</el-radio>
-          <!-- <el-radio v-model="tab.radio" label="4" @change="changeRadio">班次</el-radio> -->
           <el-input v-if="tab.isFormulaName" v-model="tab.table.getdataListParm.parammaps.ftname" class="filter-item" style="width: 245px;" placeholder="配方模板" />
           <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.barname" class="filter-item" style="width: 150px;" placeholder="栏舍" />
           <el-input v-if="tab.isHouseName" v-model="tab.table.getdataListParm.parammaps.ftname" class="filter-item" style="width: 150px;" placeholder="配方模板" />
           <el-input v-if="tab.isLivestockType" v-model="tab.table.getdataListParm.parammaps.cowclass" class="filter-item" style="width: 150px;" placeholder="牲畜类别" />
+          <el-select v-model="tab.table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" clearable>
+            <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
           <el-button class="successBorder" @click="handleSearch">查询</el-button>
           <el-button class="export" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
           <svg-icon icon-class="Up" class="down" style="width: 40px;height: 40px;float: right;" @click="handleQuickJumpChart" />
@@ -39,7 +41,6 @@
             <el-table-column v-if="tab.isHouseName" sortable label="栏舍" min-width="70px" align="center" prop="栏舍" />
             <el-table-column v-if="tab.isHouseName" sortable label="配方模板" min-width="70px" align="center" prop="配方模板" />
             <el-table-column v-if="tab.isLivestockType" sortable label="牲畜类别" min-width="70px" align="center" prop="牲畜类别" />
-            <el-table-column v-if="tab.isTimes" sortable label="班次" min-width="70px" align="center" prop="班次" />
             <el-table-column sortable label="实际牛头数" min-width="60px" align="center" prop="实际牛头数" />
             <el-table-column sortable label="应混料量(kg)" min-width="60px" align="center" prop="应混料量" />
             <el-table-column sortable label="实际混料量(kg)" min-width="70px" align="center" prop="实际混料量" />
@@ -634,6 +635,20 @@ export default {
         selectYear: parseTime(new Date(), '{y}'),
         yearList: [],
         weekList: [],
+        // 班次
+        maxTime: {
+          getMaxTimesParm: {
+            name: 'getSysoptEnable',
+            page: 1,
+            offset: 1,
+            pagecount: 1,
+            returntype: 'Map',
+            parammaps: {
+              pastureid: Cookies.get('pastureid'),
+              inforname: 'times'
+            }
+          }
+        },
         table: {
           getdataListParm: {
             name: 'getFeedEfficiencyFT',
@@ -655,7 +670,7 @@ export default {
           list: [],
           total: 0,
           listLoading: true,
-          temp: {}
+          temp: {},
         },
         chart1: {
           chartLine: null,
@@ -937,6 +952,7 @@ export default {
       tab2Download2List2:[],
       tab2Download2List3:[],
       tab2Download2List4:[],
+      frequencyList:[],
       rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       myHeight: document.documentElement.clientHeight - 85 - 210
@@ -951,8 +967,24 @@ export default {
     this.getChart3()
     this.getChart4()
     this.getChart5()
+    this.getIsDisplay()
   },
   methods: {
+    getIsDisplay() {
+      GetDataByName(this.tab.maxTime.getMaxTimesParm).then(response => {
+        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: '第一班' }]
+        } else if (response.data.list[0].inforvalue == 2) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }]
+        } else if (response.data.list[0].inforvalue == 3) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }]
+        } else if (response.data.list[0].inforvalue == 4) {
+          this.frequencyList = [{ id: '1', name: '第一班' }, { id: '2', name: '第二班' }, { id: '3', name: '第三班' }, { id: '4', name: '第四班' }]
+        }
+      })
+    },
     getAllYear() {
       var myDate = new Date()
       var thisYear = myDate.getFullYear() // 获取当年年份
@@ -1629,7 +1661,6 @@ export default {
         this.tab.isFormulaName = true
         this.tab.isHouseName = false
         this.tab.isLivestockType = false
-        this.tab.isTimes = false
         this.tab.table.getdataListParm.parammaps.ftname = ''
         this.tab.table.getdataListParm.parammaps.barname = ''
         this.tab.table.getdataListParm.parammaps.ftname = ''
@@ -1646,7 +1677,6 @@ export default {
         this.tab.isFormulaName = false
         this.tab.isHouseName = true
         this.tab.isLivestockType = false
-        this.tab.isTimes = false
         this.tab.table.getdataListParm.parammaps.ftname = ''
         this.tab.table.getdataListParm.parammaps.barname = ''
         this.tab.table.getdataListParm.parammaps.ftname = ''
@@ -1663,7 +1693,6 @@ export default {
         this.tab.isFormulaName = false
         this.tab.isHouseName = false
         this.tab.isLivestockType = true
-        this.tab.isTimes = false
         this.tab.table.getdataListParm.parammaps.ftname = ''
         this.tab.table.getdataListParm.parammaps.barname = ''
         this.tab.table.getdataListParm.parammaps.ftname = ''
@@ -1675,23 +1704,6 @@ export default {
         this.getChart5()
         this.tab.chart4.getdataListParm.name = 'getFeedEffZHSC'
         this.getChart4()
-      }else if (this.tab.radio == '4') {
-        console.log('接口待对班次')
-        this.tab.isFormulaName = false
-        this.tab.isHouseName = false
-        this.tab.isLivestockType = false
-        this.tab.isTimes = true
-        // this.tab.table.getdataListParm.parammaps.ftname = ''
-        // this.tab.table.getdataListParm.parammaps.barname = ''
-        // this.tab.table.getdataListParm.parammaps.ftname = ''
-        // this.tab.table.getdataListParm.parammaps.cowclass = ''
-        // this.tab.table.getdataListParm.name = 'getFeedEfficiencySC'
-        // this.getTabList()
-        // this.tab.chart5.statisticsList = []
-        // this.tab.chart5.getdataListParm.name = 'getFeedEffCB'
-        // this.getChart5()
-        // this.tab.chart4.getdataListParm.name = 'getFeedEffZHSC'
-        // this.getChart4()
       }
     },
 

+ 189 - 64
src/views/systemManagement/reminderSettings/index.vue

@@ -44,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="message">
-                      <span>{{temp.message}}</span>
+                    <el-form-item label="消息名称:" prop="messageName">
+                      <span>{{temp.messageName}}</span>
                     </el-form-item>
                   </el-col>
                 </el-row>
@@ -249,47 +249,70 @@
               <el-row>
                 <el-col :span="24">
                   <el-form-item label="发送方式:" prop="sendingMethod">
-                    <el-select v-model="temp.sendingMethod" style="width: 100%;" placeholder="发送方式">
+                    <el-select disabled v-model="temp.sendingMethod" style="width: 100%;" placeholder="发送方式">
                       <el-option v-for="item in modeList" :key="item.id" :label="item.name" :value="item.id" />
                     </el-select>
                   </el-form-item>
                 </el-col>
               </el-row>
+              <div v-if="temp.sendingMethod == '1'">
+                <el-row :gutter="5">
+                  <el-col :span="18">
+                    <el-form-item label="发送机制">
+                      <el-select disabled v-model="temp.sendingMechanism" style="width: 100%;" placeholder="发送机制">
+                        <el-option v-for="item in mechanismList" :key="item.id" :label="item.name" :value="item.id" />
+                      </el-select>
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="6" v-if="temp.sendingMechanism == '2'">
+                      <el-input disabled ref="numberCycles" v-model="temp.numberCycles" style="width: 100%;" placeholder="循环次数" type="text" />
+                  </el-col>
+                </el-row>
+                <el-row v-if="temp.sendingMechanism !== '1' && temp.sendingMechanism !== ''">
+                  <el-col :span="24">
+                    <el-form-item label="间隔周期:">
+                      <el-input disabled ref="intervalPeriod1" v-model="temp.intervalPeriod1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
+                      <el-input disabled ref="intervalPeriod2" v-model="temp.intervalPeriod2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
+                      <el-input disabled ref="intervalPeriod3" v-model="temp.intervalPeriod3" style="width: 32%;" placeholder="分钟" type="text" />
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </div>
               <div v-if="temp.sendingMethod == '2'">
                 <el-row>
                   <el-col :span="24">
                     <el-form-item label="延时:">
-                      <el-input ref="delayed1" v-model="temp.delayed1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
-                      <el-input ref="delayed2" v-model="temp.delayed2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
-                      <el-input ref="delayed3" v-model="temp.delayed3" style="width: 32%;" placeholder="分钟" type="text" />
+                      <el-input disabled ref="delayed1" v-model="temp.delayed1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
+                      <el-input disabled ref="delayed2" v-model="temp.delayed2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
+                      <el-input disabled ref="delayed3" v-model="temp.delayed3" style="width: 32%;" placeholder="分钟" type="text" />
                     </el-form-item>
                   </el-col>
                 </el-row>
                 <el-row>
                   <el-col :span="24">
                     <el-form-item label="发送时间">
-                       <el-time-select placeholder="发送时间" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
+                       <el-time-select disabled placeholder="发送时间" :clearable="false" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
                     </el-form-item>
                   </el-col>
                 </el-row>
                 <el-row :gutter="5">
                   <el-col :span="18">
                     <el-form-item label="发送机制">
-                      <el-select v-model="temp.sendingMechanism" style="width: 100%;" placeholder="发送机制">
+                      <el-select disabled v-model="temp.sendingMechanism" style="width: 100%;" placeholder="发送机制">
                         <el-option v-for="item in mechanismList" :key="item.id" :label="item.name" :value="item.id" />
                       </el-select>
                     </el-form-item>
                   </el-col>
                   <el-col :span="6" v-if="temp.sendingMechanism == '2'">
-                      <el-input ref="numberCycles" v-model="temp.numberCycles" style="width: 100%;" placeholder="循环次数" type="text" />
+                      <el-input disabled ref="numberCycles" v-model="temp.numberCycles" style="width: 100%;" placeholder="循环次数" type="text" />
                   </el-col>
                 </el-row>
                 <el-row v-if="temp.sendingMechanism !== '1' && temp.sendingMechanism !== ''">
                   <el-col :span="24">
                     <el-form-item label="间隔周期:">
-                      <el-input ref="intervalPeriod1" v-model="temp.intervalPeriod1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
-                      <el-input ref="intervalPeriod2" v-model="temp.intervalPeriod2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
-                      <el-input ref="intervalPeriod3" v-model="temp.intervalPeriod3" style="width: 32%;" placeholder="分钟" type="text" />
+                      <el-input disabled ref="intervalPeriod1" v-model="temp.intervalPeriod1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
+                      <el-input disabled ref="intervalPeriod2" v-model="temp.intervalPeriod2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
+                      <el-input disabled ref="intervalPeriod3" v-model="temp.intervalPeriod3" style="width: 32%;" placeholder="分钟" type="text" />
                     </el-form-item>
                   </el-col>
                 </el-row>
@@ -305,18 +328,18 @@
                 <el-row :gutter="5">
                   <el-col :span="18">
                     <el-form-item label="周期类型">
-                      <el-select v-model="temp.cycleType" style="width: 100%;" placeholder="周期类型">
+                      <el-select disabled v-model="temp.cycleType" style="width: 100%;" placeholder="周期类型">
                         <el-option v-for="item in cycleTypeList" :key="item.id" :label="item.name" :value="item.id" />
                       </el-select>
                     </el-form-item>
                   </el-col>
                   <el-col :span="6" v-if="temp.cycleType == '2'">
-                    <el-select v-model="temp.week" style="width: 100%;" placeholder="每周">
+                    <el-select disabled v-model="temp.week" style="width: 100%;" placeholder="每周">
                       <el-option v-for="item in weekList" :key="item.id" :label="item.name" :value="item.id" />
                     </el-select>
                   </el-col>
                   <el-col :span="6" v-if="temp.cycleType == 3">
-                    <el-select v-model="temp.month" style="width: 100%;" placeholder="每月">
+                    <el-select disabled v-model="temp.month" style="width: 100%;" placeholder="每月">
                       <el-option v-for="item in monthList" :key="item.id" :label="item.name" :value="item.id" />
                     </el-select>
                   </el-col>
@@ -324,7 +347,7 @@
                 <el-row>
                   <el-col :span="24">
                     <el-form-item label="发送时间">
-                       <el-time-select placeholder="发送时间" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
+                       <el-time-select disabled placeholder="发送时间" :clearable="false" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
                     </el-form-item>
                   </el-col>
                 </el-row>
@@ -332,7 +355,7 @@
             </el-form>
         </div>
         <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom: 40px;">
-          <el-button class="cancelClose" @click="see.dialogFormVisible = false;getList(); ">取消</el-button>
+          <el-button class="cancelClose1" @click="see.dialogFormVisible = false;getList(); ">取消</el-button>
         </div>
       </div>
     </el-dialog>
@@ -467,7 +490,7 @@
       this.monthList = []
       for(let i=1;i<=31;i++){
         let obj = {}
-        obj.id = i
+        obj.id = String(i)
         obj.name = i+'日'
         this.monthList.push(obj)
       }
@@ -503,10 +526,12 @@
         this.setUp.dialogFormVisible = true
         this.activeName = 'first'
         this.setUp.temp = Object.assign({}, row)
-        this.temp.messageName = row.data.message //消息名称
+        this.temp.messageName = row.message //消息名称
         this.temp.triggerCondition = row.trigger //触发条件
-
-
+        this.temp.sendTime = row.data.push_time //发送时间
+        this.selectList1 = []
+        this.selectList2 = row.user.split(',')
+        console.log(this.selectList2,'this.selectList211')
         // 立即
         this.temp.sendingMethod = String(row.data.remind_type) //发送方式
         if(this.temp.sendingMethod == '1'){
@@ -514,12 +539,26 @@
           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) //间隔周期
+              //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
             }
           }
           if(this.temp.sendingMechanism == '3'){
             if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
-              this.formatMinutes(row.data.interval_time) //间隔周期
+              //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
             }
           }
         }
@@ -527,19 +566,39 @@
         if(this.temp.sendingMethod == '2'){
           this.temp.sendingMethod = String(row.data.remind_type) //发送方式
           if(this.temp.sendingMethod == '2'){
-            this.formatMinutes(row.data.interval_time) //延时
+            //延时
+            var minutes = row.data.delay_time
+            var day = parseInt(Math.floor(minutes / 1440));
+            var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+            var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+            this.temp.delayed1 = day;
+            this.temp.delayed2 = hour;
+            this.temp.delayed3 = minute;
           }
           this.temp.sendTime = row.data.push_time //发送时间
-          this.temp.push_limit = String(row.data.push_time) //发送机制
-          if(this.temp.push_limit == '2'){
+          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) //间隔周期
+              //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
             }
           }
-          if(this.temp.push_limit == '3'){
+          if(this.temp.sendingMechanism == '3'){
             if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
-              this.formatMinutes(row.data.interval_time) //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
             }
           }
         }
@@ -547,40 +606,102 @@
         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
+            this.temp.week = String(row.data.push_date)
           }
           if(this.temp.cycleType == '3'){
-            this.temp.month = row.data.push_date
+            this.temp.month = String(row.data.push_date)
           }
         }
         this.getList1()
       },
-      formatMinutes(minutes) {
-        var day = parseInt(Math.floor(minutes / 1440));
-        var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
-        var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+      handleSee(row){
+        this.see.dialogStatus = 'see'
+        this.see.dialogFormVisible = true
+        this.setUp.temp = Object.assign({}, row)
+        this.temp.messageName = row.message //消息名称
+        this.temp.triggerCondition = row.trigger //触发条件
+        this.temp.sendTime = row.data.push_time //发送时间
+        // 立即
+        this.temp.sendingMethod = String(row.data.remind_type) //发送方式
+        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 !== ''){
+              //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
+            }
+          }
+          if(this.temp.sendingMechanism == '3'){
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
+            }
+          }
+        }
+        // 延时
         if(this.temp.sendingMethod == '2'){
-          this.temp.delayed1 = day;
-          this.temp.delayed2 = hour;
-          this.temp.delayed3 = minute;
-          return this.temp.delayed1;
-          return this.temp.delayed2;
-          return this.temp.delayed3;
+          this.temp.sendingMethod = String(row.data.remind_type) //发送方式
+          if(this.temp.sendingMethod == '2'){
+            //延时
+            var minutes = row.data.delay_time
+            var day = parseInt(Math.floor(minutes / 1440));
+            var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+            var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+            this.temp.delayed1 = day;
+            this.temp.delayed2 = hour;
+            this.temp.delayed3 = minute;
+          }
+          this.temp.sendTime = row.data.push_time //发送时间
+          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 !== ''){
+              //间隔周期
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
+            }
+          }
+          if(this.temp.sendingMechanism == '3'){
+            if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
+              var minutes = row.data.interval_time
+              var day = parseInt(Math.floor(minutes / 1440));
+              var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
+              var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
+              this.temp.intervalPeriod1 = day;
+              this.temp.intervalPeriod2 = hour;
+              this.temp.intervalPeriod3 = minute;
+            }
+          }
         }
-        if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
-          this.temp.intervalPeriod1 = day;
-          this.temp.intervalPeriod2 = hour;
-          this.temp.intervalPeriod3 = minute;
-          return this.temp.intervalPeriod1;
-          return this.temp.intervalPeriod2;
-          return this.temp.intervalPeriod3;
+        // 指定周期
+        if(this.temp.sendingMethod == '3'){
+          this.temp.cycleType = String(row.data.date_type)  //周期类型
+          if(this.temp.cycleType == '2'){
+            this.temp.week = String(row.data.push_date)
+          }
+          if(this.temp.cycleType == '3'){
+            this.temp.month = String(row.data.push_date)
+          }
         }
       },
-      handleSee(){
-        this.see.dialogStatus = 'see'
-        this.see.dialogFormVisible = true
-        this.see.temp = Object.assign({}, row)
-      },
       handleClick(item){
         if(item == 'first'){
           this.getList1()
@@ -616,8 +737,7 @@
           if (response.data.list !== null) {
             this.setUp.list1 = response.data.list
             if(this.selectList1.length== 0){
-              this.setUp.data2.parammaps.roleid = response.data.list[0]['id']
-              this.selectList1.push(response.data.list[0]['id'])
+              this.setUp.data2.parammaps.roleid = ''
             }
             this.selectList1.forEach(key => {
               this.setUp.list1.forEach(row => {
@@ -643,11 +763,14 @@
         postJson(url,this.setUp.data2).then(response => {
           if (response.data.list !== null) {
             this.setUp.list2 = response.data.list
-            this.selectList2 = []
-            response.data.list.forEach(key => {
-              this.selectList2.push(key.username)
-            })
+            if(this.selectList1.length !== 0){
+              this.selectList2 = []
+              response.data.list.forEach(key => {
+                this.selectList2.push(key.username)
+              })
+            }
             this.selectList2.forEach(key => {
+              console.log(key,'key')
               this.setUp.list2.forEach(row => {
                 if (row.username == key) {
                   this.$nextTick(() => {
@@ -721,8 +844,8 @@
         // 发送方式-立即
         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.pastureid = 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
@@ -740,7 +863,7 @@
         // 发送方式-延时
         if(this.temp.sendingMethod == '2'){
           data.id = this.setUp.temp.id
-          data.user = this.setUp.temp.user
+          data.user = this.selectList2
           data.sys_name = 'tmrWatch'
           data.type_name = this.temp.messageName
           data.template_id = 'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo'
@@ -760,7 +883,7 @@
         // 发送方式-指定周期
         if(this.temp.sendingMethod == '3'){
           data.id = this.setUp.temp.id
-          data.user = this.setUp.temp.user
+          data.user = this.selectList2
           data.sys_name = 'tmrWatch'
           data.type_name = this.temp.messageName
           data.template_id = 'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo'
@@ -779,8 +902,10 @@
           if(response.code == 200){
             console.log('成功')
             this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
+            this.setUp.dialogFormVisible = false
+            this.getList()
           }else{
-            this.$notify({ title: '成功', message: response.message, type: 'success', duration: 2000 })
+            this.$notify({ title: '失败', message: response.message, type: 'warning', duration: 2000 })
             console.log('失败')
           }
         })

+ 1 - 1
src/views/systemManagement/user/index.vue

@@ -493,7 +493,7 @@ export default {
     handleScanningCode(){
       this.QRcode.dialogStatus = 'QRcode'
       this.QRcode.dialogFormVisible = true
-      this.imgUrl = 'http://tmrwatch.cn/wx/code?scene_id:tmrwatch.'+Cookies.get('name')+ '.'+Cookies.get('employename')
+      this.imgUrl = 'http://tmrwatch.cn:80/wx/code?scene_id=tmrwatch.'+Cookies.get('name')+ '.'+Cookies.get('employename')
       console.log(this.imgUrl)
     }
   }