浏览代码

worktaskimplement

epans 11 月之前
父节点
当前提交
09aa8ced3f

+ 1 - 1
src/App.vue

@@ -53,7 +53,7 @@ console.log = (function (oldLogFunc) {
   .el-table .cell{line-height: 18px!important;}
 
 
-.box-card{padding:10px 20px}
+.box-card{padding: 0px  0px}
 
 
 .g-txt-l{text-align: left ;}

二进制
src/assets/toggle111.png


二进制
src/assets/toggle222.png


+ 2 - 2
src/views/Home.vue

@@ -286,9 +286,9 @@ export default {
 
 .iconfont{margin-right:10px}
 
-.toggle-button1{display:inline-block;height: 52px;width: 40px; background:  url("../assets/toggle1.png") no-repeat;cursor:pointer;position:absolute;top:0;left:64px;z-index:100;background-size:40px 52px}
+.toggle-button1{display:inline-block;height: 30px;width: 30px; background:  url("../assets/toggle111.png") no-repeat;cursor:pointer;position:absolute;top:-45px;left:174px;z-index:100;background-size:30px 30px}
 
-.toggle-button2{display:inline-block;height: 52px;width: 40px; background:  url("../assets/toggle2.png") no-repeat;cursor:pointer;position:absolute;top:0;left:200px;z-index:100;background-size:40px 52px}
+.toggle-button2{display:inline-block;height: 30px;width: 30px; background:  url("../assets/toggle222.png") no-repeat;cursor:pointer;position:absolute;top:-45px;left:174px;z-index:100;background-size:30px 30px}
 
 .left-logo{display:inline-block;height: 39px;width: 330px; background:  url("../assets/left-logo.png") no-repeat; }
 .center-logo{display:inline-block;height: 27px;width: 330px; background:  url("../assets/center-logo.png") no-repeat; }

+ 37 - 36
src/views/messageCenter/messageTemplete.vue

@@ -1,41 +1,42 @@
 <template>
+  <!-- 100 -->
+   <div>
+         1.0.2版本页面,待开发
+   </div>
  
-  <div>
-        1.0.2版本页面,待开发
-  </div>
-
-
-</template> 
-
-<script>
-import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
-import { parseTime, json2excel } from '@/utils/index.js'
-export default {
-  data() {
-
-
-    
  
+ </template> 
+ 
+ <script>
+ import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
+ import { parseTime, json2excel } from '@/utils/index.js'
+ export default {
+   data() {
+ 
+ 
+     
   
-    return {
-
-  
-       
-    }
-  },
-  created(){
-    
-    
-  },
-  methods:{
-
-    
+   
+     return {
+ 
+   
+        
+     }
+   },
+   created(){
      
-
-  }
-}
-</script>
- 
-<style scoped>
-
-</style>
+     
+   },
+   methods:{
+ 
+     
+      
+ 
+   }
+ }
+ </script>
+  
+ <style scoped>
+ 
+ </style>
+ 

+ 41 - 0
src/views/messageCenter/messageTemplete100.vue

@@ -0,0 +1,41 @@
+<template>
+ <!-- 100 -->
+  <div>
+        1.0.2版本页面,待开发
+  </div>
+
+
+</template> 
+
+<script>
+import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
+import { parseTime, json2excel } from '@/utils/index.js'
+export default {
+  data() {
+
+
+    
+ 
+  
+    return {
+
+  
+       
+    }
+  },
+  created(){
+    
+    
+  },
+  methods:{
+
+    
+     
+
+  }
+}
+</script>
+ 
+<style scoped>
+
+</style>

+ 481 - 0
src/views/messageCenter/messageTemplete102.vue

@@ -0,0 +1,481 @@
+<template>
+ 
+  <div>
+
+
+    <el-card class="box-card">
+      <!-- 搜索区域 -->
+      <div class="search-bx1">
+          <el-input v-model="searchData.name" placeholder="消息名称"  style="width: 220px;" class="g-mr20" clearable />
+          <el-button type="primary" class ="btn-search"  @click="form_search">搜索</el-button>
+          <el-button type="primary" class ="btn-clear"  @click="form_clear">重置</el-button>
+          <el-button type="primary"  class ="btn-add"  v-if="isButtonEdit" @click="form_add">添加</el-button>
+           <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
+      </div>
+
+ 
+      <!-- 表格 -->
+      <el-table   key="0"  :data="tableList"  v-loading="tableLoading" element-loading-text="给我一点时间"    border fit>
+        <el-table-column label="序号"  width="50px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.id }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="消息名称" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.name }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="消息内容" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.number }}</span>
+          </template>
+        </el-table-column>
+         
+ 
+        <el-table-column  label="状态"  min-width="100px" align="center">
+          <template slot-scope="scope">
+            <el-switch v-model="scope.row.mg_state" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0"   />
+          </template>
+        </el-table-column>
+
+        <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="scope">
+
+             <!-- 修改按钮 -->
+             <el-button type="primary" v-if="isButtonEdit" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
+             <!-- 删除按钮 -->
+             <el-button type="danger" v-if="isButtonEdit" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <!-- 分页区域 -->
+      <el-pagination  @size-change="change_size_page"  @current-change="change_current_page"  :current-page="searchData.page" :page-sizes="[1,5,10,20,30,50]"  :page-size="searchData.page_size" layout="total, prev, pager, next" :total="searchData.total"/>
+    </el-card>
+
+
+    <!-- 弹窗 新增or修改 -->
+    <el-dialog  :title="addFormTxt[addFormStatus]" :visible.sync="addFormShow" @close="add_dialog_close" width="50%">
+      <div class="">
+        <el-form  ref="addFormRef"  :rules="addFormRules"  :model="addForm"  label-position="right" label-width="100px"  style="width:50%;margin:0 auto 50px">
+            <el-form-item label="类型名称:" prop="name">
+                <el-input   v-model="addForm.name"  :disabled="addFormStatus=='see'"   ></el-input>  
+            </el-form-item>
+
+      
+            
+            <el-form-item label="状态:" prop="is_default" style="text-align:left">
+                <el-switch v-model="addForm.is_default" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="2" :disabled="addFormStatus=='see'"  />
+            </el-form-item>
+
+
+            <el-form-item label="消息内容:" prop="remark">
+              <el-input ref="remark" v-model="addForm.remark" type="textarea" maxlength="200"  style="width: 100%;" :rows="3"  :disabled="addFormStatus=='see'"/>
+            </el-form-item>
+
+ 
+           
+            
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="addFormStatus==='create'?add_dialog_save():edit_dialog_save()">确认</el-button>
+          <el-button @click="addFormShow = false">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+
+ 
+    
+  </div>
+
+
+</template> 
+
+<script>
+import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
+import { parseTime, json2excel } from '@/utils/index.js'
+export default {
+  data() {
+
+
+    
+ 
+  
+    return {
+
+ 
+
+      //接口 - 获取 - 表格
+      url_get_table:'/api/v1/ops/base_setting/calf_type/list',
+      //接口 - 新增 - 表格
+      url_add_table:'/api/v1/ops/base_setting/calf_type/add',  
+      //接口 - 修改 - 表格
+      url_edit_table:'/api/v1/ops/base_setting/calf_type/update', 
+      //接口 - 删除 - 表格
+      url_delete_table:'/api/v1/ops/base_setting/calf_type/is_show', 
+      
+      //接口 - 下拉框 列表 
+      url_get_select1:'/role/getAll',
+
+      //按钮权限
+      isButtonEdit:false,
+
+      //获取 - 表格数据 - 参数
+      searchData:{
+        name: "",
+        page: 1,  //页码
+        page_size: 10,   //每页数量
+        total:0,  //总页数
+        pastureId: ""
+      },
+      tableLoading: false,
+      //表格内容
+      tableList:[
+        //  { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123',roleList:[2,3] },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123',roleList:[] },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"admin", id:100, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"epans", id:200, date:'2023-12-01',email:'测试信息1123' },
+        // { username:"derek", id:300, date:'2023-12-01',email:'测试信息1123' },
+      ],
+
+ 
+      
+      pastureList:[
+    
+      ],
+
+    
+
+ 
+
+
+      addFormShow:false,
+      addFormStatus: '',
+      addFormTxt: {  edit: '修改',  create: '新增' },
+      addForm:{
+        name:'',id:'' 
+      },
+
+      addFormRules:{
+        name: [ { required: true, message: '类型名称必填', trigger: 'blur' },  ],
+   
+
+      },
+
+     
+       
+    }
+  },
+  created(){
+      //获取按钮权限
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "犊牛类型编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
+     
+
+     //获取下拉框
+     // this.get_select_list1()
+
+      //表格 - 初始化 
+      this.get_table_data()
+
+     
+
+    
+  },
+  methods:{
+
+    get_auto_buttons() {
+      // 编辑
+      const isButtonEdit = checkButtons(this.$store.state.buttonsList, "用户管理编辑")
+      this.isButtonEdit = isButtonEdit
+      console.log('this.isButtonEdit==========',this.isButtonEdit)
+    },
+    
+    //获取 下拉框
+    get_select_list1(){
+        var me = this
+        ajaxDataGet(me.url_get_select1, {"roleName": "",  "page": 1,   "page_size": 1000}).then(e => {
+          console.log("下拉框1:",e)
+
+          //打印请求成功结果
+          if(e.data == null || e.data == undefined ||e.data.length == 0   ){
+            me.roleList = []
+          } else {
+            me.roleList = e.data
+          }
+
+         
+  
+        })
+
+
+        ajaxDataGet('/authdata/pasture', {  "page": 1,   "page_size": 1000}).then(e => {
+          console.log("牧场下拉框1:",e)
+
+          //打印请求成功结果
+          if(e.data == null || e.data == undefined ||e.data.length == 0   ){
+            me.pastureList = []
+          } else {
+            me.pastureList = e.data
+          }
+  
+        })
+
+    
+    },
+
+    
+    //获取 表格
+    get_table_data() {
+ 
+     var me = this
+
+     me.tableLoading = true
+     console.log("searchData======>", me.searchData)
+
+      var send_url = me.url_get_table + '?page=' + me.searchData.page +  '&page_size=' + me.searchData.page_size
+
+      ajaxDataPost(send_url,  me.searchData).then(e => {
+        console.log("表格请求结果:",e)
+          //打印请求成功结果
+          if(e.code == 200 ){
+            me.tableList = e.data.list
+            me.searchData.total = e.data.total;	// 总数
+            me.searchData.page = e.data.page;	//页码
+            me.searchData.page_size = e.data.page_size;	//每页数量
+           
+          } else {
+            me.$message({ type: 'error', message: '请求表格列表失败!' + e.msg, duration: 2000 })
+          }
+
+          setTimeout(() => {
+            me.tableLoading = false
+          }, 100)
+  
+        })
+
+       
+    },
+    //搜索 查询表格
+    form_search(){
+      var me = this
+      console.log('请求表格列表searchData',me.searchData)
+      me.get_table_data()
+
+    },
+
+    //重置 表格
+    form_clear(){
+      var me = this
+      me.searchData.name = ""
+      me.get_table_data()
+    },
+
+    //监听 page_size 改变的事件
+    change_size_page(item){
+      console.log(item)
+     // this.searchData.page_size = item
+      //  this.getUserList()
+    },
+
+    //监听 page 改变的事件
+    change_current_page(item){
+      console.log(item)
+       this.searchData.page = item
+       this.get_table_data()
+    },
+
+    //清空弹窗表单信息
+    reset_form(){
+      this.addForm.name = ''
+    },
+
+    //新增
+    form_add() {
+      this.reset_form()
+      this.addFormStatus = 'create'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
+    //编辑
+    form_edit(row) {
+      console.log('行内容row=========', row)
+      //编辑行内容赋值
+      this.addForm = Object.assign({}, row)  
+      this.addFormStatus = 'edit'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+      })
+    },
+
+
+    //新增关闭
+    add_dialog_close(){
+       //内容重置
+       this.$refs['addFormRef'].resetFields()
+    },
+
+    //新增 保存
+    add_dialog_save() {
+      var me = this
+      this.$refs['addFormRef'].validate(valid => {
+        //验证成功
+        if (valid) {
+          //发起请求
+          var send_data = {
+              "name": me.addForm.name,
+          }
+          console.log("弹窗参数:", send_data)
+
+          //关闭弹窗
+          // me.addFormShow = false
+         //加载 - 发送新增保存
+           ajaxDataPost(me.url_add_table, send_data).then(e => {
+                console.log("新增结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success', message: '新增成功!'  , duration: 2000 })
+                  //关闭弹窗
+                  me.addFormShow = false
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '新增失败!' + e.msg, duration: 2000 })
+                }
+            })
+         
+        }
+      })
+    },
+    //编辑 保存
+    edit_dialog_save(){
+      var me = this
+      this.$refs['addFormRef'].validate(valid => {
+        //验证成功
+        if (valid) {
+          //发起请求
+          var send_data = {
+              "name": me.addForm.name,
+              "id": me.addForm.id,
+          }
+          console.log("弹窗参数:", send_data)
+
+          //关闭弹窗
+          // me.addFormShow = false
+         //加载 - 发送新增保存
+         ajaxDataPut(me.url_edit_table, send_data).then(e => {
+                console.log("编辑结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success', message: '编辑成功!'  , duration: 2000 })
+                  //关闭弹窗
+                  me.addFormShow = false
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '编辑失败!' + e.msg, duration: 2000 })
+                }
+            })
+         
+        }
+      })
+    },
+
+
+    
+    
+
+
+
+    form_delete(row) {
+      var me = this
+
+       me.$confirm('是否删除此条内容?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+            console.log("删除的ID参数:", row.id)
+            //加载 - 发送新增保存
+            ajaxDataDelete(me.url_delete_table + '/' +row.id, {}).then(e => {
+                console.log("编辑结果:",e)
+                //打印请求成功结果
+                if(e.code == 200  ){
+                  me.$message({ type: 'success',  message: '删除成功!'  });
+                  me.get_table_data()
+                } else {
+                  me.$message({ type: 'error', message: '删除失败!' + e.msg, duration: 2000 })
+                }
+            })
+
+        
+ 
+          
+        }).catch(() => {
+          me.$message({
+            type: 'info',
+            message: '已取消删除'
+          });          
+        });
+
+
+       
+    },
+
+ 
+    form_export() {
+        //获取请求表格数据的参数
+        //this.download.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
+        //请求表格
+        // GetDataByName(this.download.getdataListParm).then(response => {
+        //     if (response.data.list !== null) {
+        //       this.download.list = response.data.list
+        //     } else {
+        //       this.download.list = []
+        //     }
+        //     var excelDatas = [
+        //       {
+        //         tHeader: ['表头1', '表头2', '表头3', '表头4',],
+        //         filterVal: ['title1', 'title2', 'title3', 'title4'],
+        //         tableDatas: this.download.list,
+        //         sheetName: 'Sheet1'
+        //       }
+        //     ]
+        //     json2excel(excelDatas, '表格大标题', true, 'xlsx')
+        // })
+
+        var excelDatas = [
+            {
+                tHeader: ['表头1', '表头2', '表头3', '表头4',],
+                filterVal: ['title1', 'title2', 'title3', 'title4'],
+                tableDatas: [ 
+                    {title1: "内容1",title2: "内容2",title3: "内容3",title4: "内容4"},
+                    {title1: "内容11",title2: "内容22",title3: "内容32",title4: "内容44"},
+                    {title1: "内容111",title2: "内容222",title3: "内容333",title4: "内容444"},
+                ],
+                sheetName: 'Sheet1'
+            }
+        ]
+        json2excel(excelDatas, '表格大标题', true, 'xlsx')
+    }
+
+     
+
+  }
+}
+</script>
+<!-- 加了scoped,则是仅在此组件里生效 -->
+<style scoped>
+
+</style>

+ 363 - 57
src/views/workManagement/WorkTaskAssign1022.vue

@@ -114,8 +114,9 @@
          <el-table-column label="操作" align="center" width="500" class-name="small-padding fixed-width" fixed="right">
            <template slot-scope="scope">
              <!-- <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button> -->
-              <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_set(scope.row)">发送设置</el-button>
+              <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_set1(scope.row)">发送设置1</el-button>
 
+              <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_set2(scope.row)">发送设置1</el-button>
 
 
               <el-button type="primary" v-if="isButtonEdit " size="mini" icon="el-icon-edit" @click="form_edit1(scope.row)">修改1</el-button>
@@ -328,37 +329,7 @@
              
            </el-row>
 
-           <el-row :gutter="20">
-           
-             <el-col :span="9">
-              <el-form-item label="执行设置:" prop="set_id">
-                 <el-select  v-model="addForm2.set_id"  placeholder="请选择"   style="width: 100%;"  >
-                   <el-option v-for="item in setList1" :key="item.id" :label="item.name" :value="item.id"  />
-                 </el-select>
-               </el-form-item>
-             </el-col>
-
-             <el-col :span="5">
-                 <el-select  v-model="addForm2.set_id"  placeholder="天周月"   style="width: 100%;"  >
-                   <el-option v-for="item in setList2" :key="item.id" :label="item.name" :value="item.id"  />
-                </el-select>
-             </el-col>
-
-             <el-col :span="5">
-                 <el-select  v-model="addForm2.set_id"  placeholder="周几"   style="width: 100%;"  >
-                   <el-option v-for="item in setList31" :key="item.id" :label="item.name" :value="item.id"  />
-                </el-select>
-                <el-select  v-model="addForm2.set_id"  placeholder="几号"   style="width: 100%;"  >
-                   <el-option v-for="item in setList32" :key="item.id" :label="item.name" :value="item.id"  />
-                </el-select>
-             </el-col>
-
-             <el-col :span="5">
-              <el-time-picker v-model="addForm2.feed_time" format='HH:mm:ss' type="time" placeholder="选择时间"   style="width: 80%;" :clearable="false"   />
-             </el-col>
-
-
-           </el-row>
+          
 
            <el-row :gutter="20">
               <h3 style="text-align:left;">
@@ -493,21 +464,21 @@
           <el-row :gutter="20" v-if="seeFormStatus2 =='see'">
              <el-col :span="12">
                <el-form-item label="工单类型:" prop="work_order_category_id">
-                 <el-select  v-model="addForm2.work_order_category_id"  placeholder="请选择"   style="width: 100%;"  >
+                 <el-select  v-model="seeForm2.work_order_category_id"  placeholder="请选择"   style="width: 100%;"  >
                    <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"  />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="工单任务:" prop="remark">
-                 <el-input  v-model="addForm2.remark" type="textarea" maxlength="200"   :rows="1"  />
+                 <el-input  v-model="seeForm2.remark" type="textarea" maxlength="200"   :rows="1"  />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="12">
                <el-form-item label="状态:" prop="work_order_category_id">
-                 <el-select  v-model="addForm2.work_order_category_id"  placeholder="请选择"   style="width: 100%;"  >
+                 <el-select  v-model="seeForm2.work_order_category_id"  placeholder="请选择"   style="width: 100%;"  >
                    <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id"  />
                  </el-select>
                </el-form-item>
@@ -611,7 +582,7 @@
                     <el-table-column  prop="num"  label="数量"     min-width="200px" >   </el-table-column>
                     
                 </el-table>
-                <el-button type="primary"  v-if="seeFormStatus2 =='close'" @click="sure_dialog_close1()">关闭该工单</el-button>
+                <el-button type="primary"  v-if="seeFormStatus2 =='close'" @click="sure_dialog_close2(item)">关闭该工单</el-button>
              </div>
  
             
@@ -687,45 +658,161 @@
 
 
 
-      <!-- 弹窗 发送设置 -->
+      <!-- 弹窗 发送设置 一次性 -->
       <el-dialog   title="发送设置" :visible.sync="setFormShow1" @close="set_dialog_close1" width="50%">
        <div class="">
          <el-form  ref="setFormRef1"  :rules="setFormRules1"  :model="setForm1"  label-position="right" label-width="140px"  style="width:90%;margin:0 auto 50px">
  
- 
            <el-row :gutter="20">
              <el-col :span="12">
-               <el-form-item label="工单类型:" prop="work_order_category_id">
-                 <el-select  v-model="setForm1.work_order_category_id"  placeholder="请选择"   style="width: 100%;"  >
-                   <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"  />
-                 </el-select>
+               <el-form-item label="负责员工:" prop="work_order_category_id">
+                  <el-cascader v-model="setForm1.work_order_category_id" :options="userList" :props="{ checkStrictly: true }" @change="change_user1" ref = "treeCas1" style="width: 100%;"></el-cascader>
                </el-form-item>
              </el-col>
              <el-col :span="12">
+
+              <el-tag style="margin-right:20px" v-for="(item,index) in userClickList1"   :key="item.value"  closable  @close="close_user1(item,index)"> 
+                 {{item.label}}
+              </el-tag>
+              
                 
              </el-col>
               
            </el-row>
            <el-row :gutter="20">
          
-<!--             
-            <el-tree  ref="tree" :data="rightlist" :props="{   label:'name',children:'barn_list'  }" show-checkbox   node-key="idTxt"  default-expand-all :default-checked-keys="checkedIdTxtArr"  @check-change="change_check" :filter-node-method="filterNode"> </el-tree> -->
+              <el-col :span="12">
+                <el-form-item label="消息模板:" prop="work_order_category_id">
+                  <el-select  v-model="setForm1.work_order_category_id"  placeholder="请选择"   style="width: 100%;"  >
+                    <el-option v-for="item in messageList" :key="item.id" :label="item.name" :value="item.id"  />
+                  </el-select>
+                </el-form-item>
+              </el-col>
 
+              <el-col :span="12">
+                  
+              </el-col>
+           </el-row>
 
-          
-                 
+           <el-row :gutter="20">
+              <el-col :span="12">
+                <el-form-item label="发送方式:" prop="work_order_category_id">
+                  <el-select  v-model="setForm1.work_order_category_id"  placeholder="请选择"   style="width: 100%;"  >
+                    <el-option v-for="item in sendMethodList" :key="item.id" :label="item.name" :value="item.id"  />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              
+              <el-col :span="12"> 
+              </el-col>
+           </el-row>
+
+           <el-row :gutter="20">
+              <el-col :span="12">
+                <el-form-item label="发送时间:" prop="feed_time">
+                  <el-time-picker v-model="setForm1.feed_time" format='HH:mm:ss' type="time" placeholder="选择时间"   style="width: 100%;" :clearable="false"   />
+                </el-form-item>
+              </el-col>
+              
+              <el-col :span="12"> 
+              </el-col>
            </el-row>
+
  
+      
+             
+         </el-form>
+         <div slot="footer" class="dialog-footer">
+           <el-button type="primary"  @click="set_save1()">确认</el-button>
+           <el-button @click="setFormShow1 = false">关闭</el-button>
+         </div>
+       </div>
+      </el-dialog>
+
+
+      <!-- 弹窗 发送设置 周期性-->
+      <el-dialog   title="发送设置" :visible.sync="setFormShow2" @close="set_dialog_close2" width="50%">
+       <div class="">
+         <el-form  ref="setFormRef2"  :rules="setFormRules2"  :model="setForm2"  label-position="right" label-width="140px"  style="width:90%;margin:0 auto 50px">
+ 
+           <el-row :gutter="20">
+             <el-col :span="12">
+               <el-form-item label="负责员工:" prop="work_order_category_id">
+                  <el-cascader v-model="setForm2.work_order_category_id" :options="userList" :props="{ checkStrictly: true }" @change="change_user2" ref = "treeCas2" style="width: 100%;"></el-cascader>
+               </el-form-item>
+             </el-col>
+             <el-col :span="12">
+
+              <el-tag style="margin-right:20px" v-for="(item,index) in userClickList2"   :key="item.value"  closable  @close="close_user1(item,index)"> 
+                 {{item.label}}
+              </el-tag>
+              
+                
+             </el-col>
+              
+           </el-row>
+           <el-row :gutter="20">
+         
+              <el-col :span="12">
+                <el-form-item label="消息模板:" prop="work_order_category_id">
+                  <el-select  v-model="setForm2.work_order_category_id"  placeholder="请选择"   style="width: 100%;"  >
+                    <el-option v-for="item in messageList" :key="item.id" :label="item.name" :value="item.id"  />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="12">
+                  
+              </el-col>
+           </el-row>
+
+           <el-row :gutter="20">
+           
+
+             <el-col :span="12">
+                <el-form-item label="发送方式:" prop="set_id">
+                  <el-select  v-model="setForm2.set_id"  placeholder="天周月"   style="width: 100%;"  >
+                    <el-option v-for="item in setList2" :key="item.id" :label="item.name" :value="item.id"  />
+                  </el-select>
+                </el-form-item>
+             </el-col>
+
+             <el-col :span="6">
+                 <el-select  v-model="setForm2.set_id"  placeholder="周几"   style="width: 100%;"  >
+                   <el-option v-for="item in setList31" :key="item.id" :label="item.name" :value="item.id"  />
+                </el-select>
+                <el-select  v-model="setForm2.set_id"  placeholder="几号"   style="width: 100%;"  >
+                   <el-option v-for="item in setList32" :key="item.id" :label="item.name" :value="item.id"  />
+                </el-select>
+             </el-col>
+
+             <el-col :span="6">
+              <el-time-picker v-model="setForm2.feed_time" format='HH:mm:ss' type="time" placeholder="选择时间"   style="width: 80%;" :clearable="false"   />
+             </el-col>
+
+           </el-row>
+
+           <el-row :gutter="20">
+              <el-col :span="12">
+                <el-form-item label="发送时间:" prop="feed_time">
+                  <el-time-picker v-model="setForm2.feed_time" format='HH:mm:ss' type="time" placeholder="选择时间"   style="width: 100%;" :clearable="false"   />
+                </el-form-item>
+              </el-col>
+              
+              <el-col :span="12"> 
+              </el-col>
+           </el-row>
+
  
       
              
          </el-form>
          <div slot="footer" class="dialog-footer">
-           <el-button type="primary" v-if="addFormStatus1==='create' || addFormStatus1==='edit'" @click="addFormStatus1==='create'?add_dialog_save1():edit_dialog_save1()">确认</el-button>
-           <el-button @click="addFormShow1 = false">关闭</el-button>
+           <el-button type="primary"  @click="set_save1()">确认</el-button>
+           <el-button @click="setFormShow1 = false">关闭</el-button>
          </div>
        </div>
-     </el-dialog>
+      </el-dialog>
   
      
    </div>
@@ -797,7 +884,16 @@
        ],
  
  
-       
+       messageList:[
+         
+       ],
+
+       sendMethodList:[
+         {name:"定时",id:"定时"},
+         {name:"立即",id:"立即"},
+       ],
+
+
        typeList:[
          
        ],
@@ -907,6 +1003,18 @@
        },
 
 
+       
+       setFormShow2:false,
+       setFormStatus2: '',
+       setFormTxt2: {  edit: '修改',  create: '新增' },
+       setForm2:{
+         remark:'',user_phone:'',  work_order_category_id:undefined,user_id:undefined,id:undefined,
+       },
+       setFormRules2:{
+         name: [ { required: true, message: '类型名称必填', trigger: 'blur' },  ],
+       },
+
+
  
        addFormShow1:false,
        addFormStatus1: '',
@@ -1044,9 +1152,41 @@
            { id: 31,  cowshedGroup: 'B组(总数:100)',  groupnum: '200', num: '33',  cowshed: '003舍'  }, 
            { id: 32, cowshedGroup: 'B组(总数:100)',  groupnum: '200', num: '33', cowshed: '006舍' }, 
        ],
+       
+
+       userClickList1:[
+         {label:"员工1",value:"员工ID1"}
+       ],
+
+       userClickList2:[
+         {label:"员工1",value:"员工ID1"}
+       ],
  
- 
- 
+       userList:[
+        {
+          value: '角色ID1', label: '角色1',  
+          children: [
+            { value: '员工ID1', label: '员工1' }, 
+            { value: '员工ID2', label: '员工2' }
+          ]
+        }, 
+        {
+          value: '角色ID2',  label: '角色2',
+          children: [
+            { value: '员工ID3', label: '员工3' }, 
+            { value: '员工ID4', label: '员工4' }
+          ]
+          
+        },
+         {
+          value: '角色ID3',  label: '角色ID3',
+          children: [
+            {  value: '员工3',  label: '员工3'  }, 
+            { value: '员工4',  label: '员工4'   }, 
+            {   value: '员工5', label: '员工5' }
+          ]
+        }
+      ],
  
        
  
@@ -1392,6 +1532,16 @@
          }
        me.get_table_data()
  
+     },
+
+
+      //搜索 查询表格
+      form_search_result2(){
+       var me = this
+       console.log('请求表格列表searchData',me.searchData)
+        
+       me.get_table_data()
+ 
      },
  
      //重置 表格
@@ -1556,9 +1706,13 @@
       this.seeFormShow1 = false
      },
  
-     sure_dialog_close2(){
+     sure_dialog_close2(row){
+      console.log(row)
       this.seeFormShow2 = false
      },
+
+
+     
  
 
      see_dialog_close1(){
@@ -1600,13 +1754,11 @@
  
  
      
-     form_set(row) {
+     form_set1(row) {
        var me = this
        console.log('行内容row=========', row)
        //编辑行内容赋值
        this.setForm1 = Object.assign({}, row)  
-  
-    
  
  
        this.setFormShow1 = true
@@ -1615,6 +1767,97 @@
        })
      },
 
+
+     form_set2(row) {
+       var me = this
+       console.log('行内容row=========', row)
+       //编辑行内容赋值
+       this.setForm2 = Object.assign({}, row)  
+ 
+ 
+       this.setFormShow2 = true
+       this.$nextTick(() => {
+         this.$refs['setFormRef2'].clearValidate()
+       })
+     },
+
+     set_dialog_close1(){
+      this.setFormShow1 = false
+     },
+     set_dialog_close2(){
+      this.setFormShow2 = false
+     },
+
+     set_save1(){
+       var me = this
+       this.$refs['setFormRef1'].validate(valid => {
+         //验证成功
+         if (valid) {
+           //发起请求
+           var send_data = {
+            
+               "id": me.addForm1.id,
+               "work_order_category_id": me.addForm.work_order_category_id,
+               "user_id": me.addForm.user_id,
+               "user_phone": me.addForm.user_phone, 
+           }
+           console.log("弹窗参数:", send_data)
+ 
+           //关闭弹窗
+           // me.addFormShow = false
+          //加载 - 发送新增保存
+          ajaxDataPut(me.url_edit_table, send_data).then(e => {
+                 console.log("编辑结果:",e)
+                 //打印请求成功结果
+                 if(e.code == 200  ){
+                   me.$message({ type: 'success', message: '编辑成功!'  , duration: 2000 })
+                   //关闭弹窗
+                   me.addFormShow = false
+                   me.get_table_data()
+                 } else {
+                   me.$message({ type: 'error', message: '编辑失败!' + e.msg, duration: 2000 })
+                 }
+             })
+          
+         }
+       })
+     },
+
+     set_save2(){
+       var me = this
+       this.$refs['setFormRef1'].validate(valid => {
+         //验证成功
+         if (valid) {
+           //发起请求
+           var send_data = {
+            
+               "id": me.addForm1.id,
+               "work_order_category_id": me.addForm.work_order_category_id,
+               "user_id": me.addForm.user_id,
+               "user_phone": me.addForm.user_phone, 
+           }
+           console.log("弹窗参数:", send_data)
+ 
+           //关闭弹窗
+           // me.addFormShow = false
+          //加载 - 发送新增保存
+          ajaxDataPut(me.url_edit_table, send_data).then(e => {
+                 console.log("编辑结果:",e)
+                 //打印请求成功结果
+                 if(e.code == 200  ){
+                   me.$message({ type: 'success', message: '编辑成功!'  , duration: 2000 })
+                   //关闭弹窗
+                   me.addFormShow = false
+                   me.get_table_data()
+                 } else {
+                   me.$message({ type: 'error', message: '编辑失败!' + e.msg, duration: 2000 })
+                 }
+             })
+          
+         }
+       })
+     },
+
  
      //编辑
      form_edit1(row) {
@@ -1842,7 +2085,7 @@
          }
        })
      },
-
+     
 
      //编辑 保存
      edit_dialog_save1(){
@@ -2032,7 +2275,70 @@
            
      },
  
+     change_user1(value) {
+        console.log(value)
+        var me = this
+        //选中的是最后的子节点
+        if(value.length == 2){
+          var nodesInfo = this.$refs['treeCas1'].getCheckedNodes()
+          console.log(nodesInfo)
+          var click_node = {"label":nodesInfo[0].data.label,"value":nodesInfo[0].data.value}
+          
+          var click_value = nodesInfo[0].data.value
+  
+
+          var isExist = me.userClickList1.filter(function(item){
+            return item.value == click_value
+          })
+          console.log('isExist',isExist)
+              
+          if(isExist.length == 0){
+            me.userClickList1.push(click_node)
+          }  
+        }
+       
+ 
+
+     },
+
+     change_user2(value) {
+        console.log(value)
+        var me = this
+        //选中的是最后的子节点
+        if(value.length == 2){
+          var nodesInfo = this.$refs['treeCas2'].getCheckedNodes()
+          console.log(nodesInfo)
+          var click_node = {"label":nodesInfo[0].data.label,"value":nodesInfo[0].data.value}
+          
+          var click_value = nodesInfo[0].data.value
   
+
+          var isExist = me.userClickList2.filter(function(item){
+            return item.value == click_value
+          })
+          console.log('isExist',isExist)
+              
+          if(isExist.length == 0){
+            me.userClickList2.push(click_node)
+          }  
+        }
+       
+ 
+
+     },
+
+     close_user1(item,index){
+      console.log(item,index)
+
+      this.userClickList1.splice(index, 1);
+     },
+
+     close_user2(item,index){
+      console.log(item,index)
+
+      this.userClickList2.splice(index, 1);
+     },
+      
   
      form_export() {
      //获取请求表格数据的参数

+ 34 - 33
src/views/workManagement/WorkTaskImplement.vue

@@ -1,41 +1,42 @@
 <template>
  
-  <div>
-        1.1版本页面,待开发
-  </div>
-
-
-</template> 
-
-<script>
-import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
-import { parseTime, json2excel } from '@/utils/index.js'
-export default {
-  data() {
-
-
+    <div>
+          1.0.2版本页面,待开发
+    </div>
+  
+  
+  </template> 
+  
+  <script>
+  import {  ajaxDataGet, ajaxDataPost, ajaxDataPut, ajaxDataDelete, checkButtons} from '@/api/common'
+  import { parseTime, json2excel } from '@/utils/index.js'
+  export default {
+    data() {
+  
+  
+      
+   
     
- 
+      return {
   
-    return {
-
+    
+         
+      }
+    },
+    created(){
+      
+      
+    },
+    methods:{
   
+      
        
+  
     }
-  },
-  created(){
-    
-    
-  },
-  methods:{
-
-    
-     
-
   }
-}
-</script>
- 
-<style scoped>
-
-</style>
+  </script>
+   
+  <style scoped>
+  
+  </style>
+  

+ 230 - 278
src/views/workManagement/WorkTaskImplement1022.vue

@@ -13,18 +13,18 @@
           <el-select v-model="searchData.work_order_category_id" filterable placeholder="类型" class="g-mr20" style="width: 180px;" clearable>
             <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id" />
           </el-select>
-          <el-select v-model="searchData.status" filterable placeholder="状态" class="g-mr20" style="width: 180px;" clearable>
-            <el-option v-for="item in statusList" :key="item.id" :label="item.name" :value="item.id" />
+          <el-select v-model="searchData.status" filterable placeholder="工单类型" class="g-mr20" style="width: 180px;" clearable>
+            <el-option v-for="item in orderTypeList" :key="item.id" :label="item.name" :value="item.id" />
           </el-select>
 
-          <el-date-picker v-model="searchData.inputDatetime1" class="g-mr20" type="daterange" range-separator="至" start-placeholder="完成时间" end-placeholder="完成时间" style="width: 250px;" />
+ 
 
           <el-date-picker v-model="searchData.inputDatetime2" class="g-mr20" type="daterange" range-separator="至" start-placeholder="派单时间" end-placeholder="派单时间" style="width: 250px;" />
         
           
           <el-button type="primary"   @click="form_search">搜索</el-button>
           <el-button type="primary"   @click="form_clear">重置</el-button>
-          <el-button type="primary"   v-if="isButtonEdit" @click="form_add">添加</el-button>
+          
            <!-- <el-button type="primary"   @click="form_export">导出</el-button> -->
       </div>
 
@@ -38,8 +38,8 @@
         </el-table-column>
         <el-table-column label="工单编号" min-width="200px" align="center">
           <template slot-scope="scope">
-            <!-- <span>{{ scope.row.number }}</span> -->
-            <el-button type="primary" size="mini"  @click="form_see(scope.row)">{{ scope.row.number }}</el-button>
+            <span>{{ scope.row.number }}</span>  
+           
           </template>
         </el-table-column>
         <el-table-column label="类型" min-width="150px" align="center">
@@ -56,6 +56,15 @@
             <span v-if = "scope.row.status == 4">已关闭</span>
           </template>
         </el-table-column>
+        <el-table-column label="工单类型" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <!-- <span v-if = "scope.row.status == 0">未知</span> -->
+            <span v-if = "scope.row.status == 1">已创建未执行</span>
+            <span v-if = "scope.row.status == 2">执行中</span>
+            <span v-if = "scope.row.status == 3">已完成</span>
+            <span v-if = "scope.row.status == 4">已关闭</span>
+          </template>
+        </el-table-column>
         <el-table-column label="对象" min-width="150px" align="center">
           <template slot-scope="scope">
              <!-- <el-button type="primary" size="mini"  @click="form_see(scope.row)">查看</el-button> -->
@@ -79,7 +88,7 @@
           </template>
         </el-table-column>
         
-        <el-table-column label="完成时间" min-width="150px" align="center">
+        <el-table-column label="派单时间" min-width="150px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.finished_at_format }}</span>
           </template>
@@ -93,7 +102,7 @@
              <!-- 修改按钮 -->
     
              <!-- 删除按钮 -->
-             <el-button type="danger" v-if="isButtonEdit &&(scope.row.status == 1 || scope.row.status == 2)" size="mini" icon="el-icon-delete" @click="form_complete(scope.row)">完成工单</el-button>
+             <el-button type="primary"   size="mini"  @click="form_see2(scope.row)(scope.row)">完成工单</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -108,65 +117,89 @@
       <el-pagination  @size-change="change_size_page"  @current-change="change_current_page"  :current-page="searchData.page" :page-sizes="[1,5,10,20,30,50]"  :page-size="searchData.page_size" layout="total, prev, pager, next" :total="searchData.total"/>
     </el-card>
 
-
-    <!-- 弹窗 新增or修改 -->
-    <el-dialog  :title="addFormTxt[addFormStatus]" :visible.sync="addFormShow" @close="add_dialog_close" width="50%">
-      <div class="">
-        <el-form  ref="addFormRef"  :rules="addFormRules"  :model="addForm"  label-position="right" label-width="140px"  style="width:90%;margin:0 auto 50px">
-
-
-          <el-row :gutter="20">
-            <el-col :span="12">
-              <el-form-item label="工单类型:" prop="work_order_category_id">
-                <el-select  v-model="addForm.work_order_category_id"  placeholder="请选择" class="filter-item" style="width: 100%;" :disabled=" addFormStatus=='see'">
-                  <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"  />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="负责人员:" prop="user_id">
-                <el-select  v-model="addForm.user_id"  placeholder="请选择" class="filter-item" style="width: 100%;" @change = "change_person"  :disabled=" addFormStatus=='see'">
-                  <el-option v-for="item in personList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
+     <!-- 弹窗  详情 周期工单  关闭-->
+   <el-dialog   title="工单信息" :visible.sync="seeFormShow2" @close="see_dialog_close2" width="50%">
+     <div class="">
+       <el-form  ref="seeFormRef2"   :model="seeForm2"  label-position="right" label-width="140px"  style="width:90%;margin:0 auto 50px">
+
+        <el-row :gutter="20"  >
+           <el-col :span="8">
+             <el-form-item label="工单编号:" prop="remark">
+               <el-input  v-model="seeForm2.remark" type="input"    disabled />
+             </el-form-item>
+           </el-col>
+           <el-col :span="8">
+             <el-form-item label="工单类型:" prop="work_order_category_id">
+               <el-select  v-model="seeForm2.work_order_category_id"  placeholder="请选择"   style="width: 100%;"  >
+                 <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"   disabled/>
+               </el-select>
+             </el-form-item>
+           </el-col>
+           <el-col :span="8">
+              <el-form-item label="状态:" prop="work_order_category_id">
+               <el-select  v-model="seeForm2.work_order_category_id"  placeholder="请选择"   style="width: 100%;"  >
+                 <el-option v-for="item in enableList" :key="item.id" :label="item.name" :value="item.id"  disabled/>
+               </el-select>
+             </el-form-item>
+             
+           </el-col>
+         </el-row>
+         <el-row :gutter="20">
+           <el-col :span="24">
+              <el-form-item label="派单员工:" prop="remark">
+               <el-input  v-model="seeForm2.remark" type="textarea" maxlength="200"   :rows="1"  disabled />
+             </el-form-item>
+           </el-col>
           </el-row>
-          <el-row :gutter="20">
-            <el-col :span="12">
-              <el-form-item label="工单任务:" prop="remark">
-                <el-input  v-model="addForm.remark" type="textarea" maxlength="200"   :rows="3" :disabled=" addFormStatus=='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="负责人手机号:" prop="user_phone">
-                <el-input  v-model="addForm.user_phone" type="input"  disabled />
-              </el-form-item>
-            </el-col>
+         <el-row :gutter="20">
+           <el-col :span="24">
+              <el-form-item label="任务:" prop="remark">
+               <el-input  v-model="seeForm2.remark" type="textarea" maxlength="200"   :rows="1"  disabled />
+             </el-form-item>
+           </el-col>
           </el-row>
 
 
-          <!-- <el-row :gutter="20">
-              <el-transfer  :titles="['栏舍组名称', '栏舍名称组']" v-model="transDataChooseRight1" :data="transDataList1" :props="{  key: 'id',   label: 'name'  }" @change="change_transData1"></el-transfer>
-          </el-row> -->
 
-          <el-row :gutter="20">
-              <el-transfer  :titles="['栏舍名称', '栏舍名称']" v-model="transDataChooseRight2" :data="transDataList2" :props="{  key: 'id',   label: 'name'  }" @change="change_transData2"></el-transfer>
-          </el-row>
-           
-            
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button type="primary" v-if="addFormStatus==='create' || addFormStatus==='edit'" @click="addFormStatus==='create'?add_dialog_save():edit_dialog_save()">确认</el-button>
-          <el-button @click="addFormShow = false">关闭</el-button>
-        </div>
-      </div>
-    </el-dialog>
+        
 
- 
+         
+
+
+
+         <el-row :gutter="20">
+
+           <div v-for="item in tableSeeList2">
+               <h3>{{item.date}}</h3>
+              
+               <el-table  :data="item.tableArr"   style="width: 100%;margin-bottom: 20px;"    row-key="id"  border :span-method="ObjectSpanMethod" >
+                  <el-table-column  prop="cowshedGroup"    label="栏舍组"         min-width="200px" >  </el-table-column>
     
-  </div>
+                  <el-table-column   prop="cowshed"   label="栏舍"  min-width="200px" >   </el-table-column>
+                  <el-table-column  prop="num"  label="数量"     min-width="200px" >   </el-table-column>
+                  
+              </el-table>
+              <el-button type="primary"   @click="sure_dialog_close2(item)">完成工单</el-button>
+           </div>
+
+          
+              
+         </el-row>
+
+   
+       </el-form>
+       <div slot="footer" class="dialog-footer">
+       
+       
+         <el-button    @click="see_dialog_close2()">返回</el-button>
+       </div>
+     </div>
+   </el-dialog>
 
+    
+  </div>
 
+  
 </template> 
 
 <script>
@@ -239,15 +272,51 @@ export default {
         
         ],
 
-      statusList:[
-        // {id: 0, name: '未知'},
-        {id: 1, name: '已创建未执行'},
-        {id: 2, name: '执行中'},
-        {id: 3, name: '已完成'},
-        {id: 4, name: '已关闭'},
-      ],
+        orderTypeList:[
+       // {id: 0, name: '未知'},
+       {id: 1, name: '周期工单'},
+       {id: 2, name: '一次性工单'},
+ 
+     ],
     
-   
+
+
+     enableList:[
+       {id: 1, name: '开启'},
+       {id: 2, name: '关闭'},
+     ],
+
+     seeFormShow2:false,
+     seeFormStatus2: 'see',
+     seeFormTxt2: {  edit: '修改',  create: '新增' },
+     seeForm2:{
+       remark:'',user_phone:'',  work_order_category_id:undefined,user_id:undefined,id:undefined,
+     },
+
+     tableSeeList2:[
+       {date:"123123", id: 1,tableArr: [
+            {  id: 1,  cowshedGroup: 'A组(总数:100)', groupnum: '100',   num: '33',    cowshed: '001舍' },   
+            { id: 31,  cowshedGroup: 'A组(总数:100)',  groupnum: '100', num: '33',  cowshed: '002舍'  }, 
+            { id: 32, cowshedGroup: 'A组(总数:100)',   groupnum: '100',num: '33', cowshed: '003舍' }, 
+            {  id: 1,  cowshedGroup: 'B组(总数:100)',   groupnum: '200',num: '33',    cowshed: '003舍' },   
+            { id: 31,  cowshedGroup: 'B组(总数:100)',  groupnum: '200', num: '33',  cowshed: '003舍'  }, 
+            { id: 32, cowshedGroup: 'B组(总数:100)',  groupnum: '200', num: '33', cowshed: '006舍' }, 
+          ]
+       } ,
+       {date:"2222", id: 1,tableArr: [
+            {  id: 1,  cowshedGroup: 'A组(总数:100)', groupnum: '100',   num: '33',    cowshed: '001舍' },   
+            { id: 31,  cowshedGroup: 'A组(总数:100)',  groupnum: '100', num: '33',  cowshed: '002舍'  }, 
+            { id: 32, cowshedGroup: 'A组(总数:100)',   groupnum: '100',num: '33', cowshed: '003舍' }, 
+            {  id: 1,  cowshedGroup: 'B组(总数:100)',   groupnum: '200',num: '33',    cowshed: '003舍' },   
+            { id: 31,  cowshedGroup: 'B组(总数:100)',  groupnum: '200', num: '33',  cowshed: '003舍'  }, 
+            { id: 32, cowshedGroup: 'B组(总数:100)',  groupnum: '200', num: '33', cowshed: '006舍' }, 
+          ]
+
+       }
+
+
+     ],
+
  
 
 
@@ -265,37 +334,12 @@ export default {
       },
 
 
-      //穿梭框右边的值
-      transDataChooseRight1:[],
-      //穿梭框所有列表
-      transDataList1:[
-        // {key:1,label:'组1',disabled:false},
-        // {key:2,label:'组2',disabled:false},
-        // {key:3,label:'组3',disabled:false},
-        // {key:4,label:'组4',disabled:false},
-        // {key:5,label:'组5',disabled:false},
-        // {key:6,label:'组6',disabled:false},
-        // {key:7,label:'组7',disabled:false},
-      ],
-
-      //穿梭框右边的值
-      transDataChooseRight2:[],
-      //穿梭框所有列表
-      transDataList2:[
-        // {key:1,label:'组1',disabled:false},
-        // {key:2,label:'组2',disabled:false},
-        // {key:3,label:'组3',disabled:false},
-        // {key:4,label:'组4',disabled:false},
-        // {key:5,label:'组5',disabled:false},
-        // {key:6,label:'组6',disabled:false},
-        // {key:7,label:'组7',disabled:false},
-      ],
-
-     
        
     }
   },
   created(){
+      var me = this
+
       //获取按钮权限
       const isButtonEdit = checkButtons(this.$store.state.buttonsList, "犊牛类型编辑")
       this.isButtonEdit = isButtonEdit
@@ -308,11 +352,71 @@ export default {
       //表格 - 初始化 
       this.get_table_data()
 
-     
+       //不定项的合并单元格
+       me.tableSeeList2.forEach(function(item,index){
+       me.getSpanArr2(item.tableArr, index)
+     })
+
 
     
   },
-  methods:{
+  watch: {
+     filterText(val) {
+       this.$refs.tree.filter(val);
+     }
+   },
+ methods:{
+
+
+   getSpanArr2(list,index) {
+     var me = this
+       // 先给所有的数据都加一个v.rowspan = 1
+       list.forEach(item => {
+           item.rowspan = 1;
+           item.rowspan1 = 1;
+       
+       });
+       // 双层循环
+       for (let i = 0; i < list.length; i++) {
+           for (let j = i + 1; j < list.length; j++) {
+               //此处可根据相同字段进行合并
+               if (list[i].date== list[j].date) {
+                   list[i].rowspan++;
+                   list[j].rowspan--;
+               }
+           }
+           // 这里跳过已经重复的数据
+           i = i + list[i].rowspan - 1;
+           i = i + list[i].rowspan1 - 1;
+       }
+       me.tableSeeList2[index].tableArr = list;
+   },
+
+   
+   // 合并单元格相同内容
+   ObjectSpanMethod({ row, column, rowIndex, columnIndex }) {
+       // 第一列
+       if (columnIndex === 0) {
+           return {
+               rowspan: row.rowspan,
+               colspan: 1,
+           };
+       }
+          // 第二列
+          // if (columnIndex === 1) {
+          //     return {
+          //         rowspan: row.rowspan1,
+          //         colspan: 1,
+          //     };
+          // }
+      
+  },
+  
+   filterNode(value, data) {
+       if (!value) return true;
+       return data.name.indexOf(value) !== -1;
+     },
+
 
     get_auto_buttons() {
       // 编辑
@@ -499,193 +603,41 @@ export default {
      
     },
 
-    //新增
-    form_add() {
-      this.reset_form()
-      this.addFormStatus = 'create'
-      this.addFormShow = true
-      this.$nextTick(() => {
-        this.$refs['addFormRef'].clearValidate()
-      })
-    },
-
-
-    form_see(row) {
-      console.log('行内容row=========', row)
-      //编辑行内容赋值
-      this.addForm = Object.assign({}, row)  
-      this.addFormStatus = 'see'
-      this.transDataChooseRight2 = row.barns
-      this.addFormShow = true
-      this.$nextTick(() => {
-        this.$refs['addFormRef'].clearValidate()
-      })
-    },
-
-
-    //编辑
-    form_edit(row) {
-      console.log('行内容row=========', row)
-      //编辑行内容赋值
-      this.addForm = Object.assign({}, row)  
-
-      this.transDataChooseRight2 = row.barns
-  
-
-      this.addFormStatus = 'edit'
-      this.addFormShow = true
-      this.$nextTick(() => {
-        this.$refs['addFormRef'].clearValidate()
-      })
-    },
-
-
-    //新增关闭
-    add_dialog_close(){
-       //内容重置
-       this.$refs['addFormRef'].resetFields()
-    },
-
-    //新增 保存
-    add_dialog_save() {
-      var me = this
-      this.$refs['addFormRef'].validate(valid => {
-        //验证成功
-        if (valid) {
-          //发起请求
-          var send_data = {
-              "work_order_category_id": me.addForm.work_order_category_id,
-              "user_id": me.addForm.user_id,
-              "user_phone": me.addForm.user_phone,
-              "remark": me.addForm.remark,
-              "barns": me.transDataChooseRight2,
-           
-          }
-
-        
-          console.log("弹窗参数:", send_data)
-
-          //关闭弹窗
-          // me.addFormShow = false
-         //加载 - 发送新增保存
-           ajaxDataPost(me.url_add_table, send_data).then(e => {
-                console.log("新增结果:",e)
-                //打印请求成功结果
-                if(e.code == 200  ){
-                  me.$message({ type: 'success', message: '新增成功!'  , duration: 2000 })
-                  //关闭弹窗
-                  me.addFormShow = false
-                  me.get_table_data()
-                } else {
-                  me.$message({ type: 'error', message: '新增失败!' + e.msg, duration: 2000 })
-                }
-            })
-         
-        }
-      })
-    },
-    //编辑 保存
-    edit_dialog_save(){
-      var me = this
-      this.$refs['addFormRef'].validate(valid => {
-        //验证成功
-        if (valid) {
-          //发起请求
-          var send_data = {
-           
-              "id": me.addForm.id,
-              "work_order_category_id": me.addForm.work_order_category_id,
-              "user_id": me.addForm.user_id,
-              "user_phone": me.addForm.user_phone,
-              "remark": me.addForm.remark,
-              "barns": me.transDataChooseRight2,
-          }
-          console.log("弹窗参数:", send_data)
-
-          //关闭弹窗
-          // me.addFormShow = false
-         //加载 - 发送新增保存
-         ajaxDataPut(me.url_edit_table, send_data).then(e => {
-                console.log("编辑结果:",e)
-                //打印请求成功结果
-                if(e.code == 200  ){
-                  me.$message({ type: 'success', message: '编辑成功!'  , duration: 2000 })
-                  //关闭弹窗
-                  me.addFormShow = false
-                  me.get_table_data()
-                } else {
-                  me.$message({ type: 'error', message: '编辑失败!' + e.msg, duration: 2000 })
-                }
-            })
-         
-        }
-      })
-    },
-
-
     
-    
-
-
+    form_see2(row) {
+     console.log('行内容row=========', row)
+     //编辑行内容赋值
+     this.seeForm2 = Object.assign({}, row)  
+     this.seeFormStatus2 = 'see'
+     this.seeFormShow2 = true
+     this.$nextTick(() => {
+       this.$refs['seeFormRef2'].clearValidate()
+     })
+   },
+
+   form_close2(row) {
+     console.log('行内容row=========', row)
+     //编辑行内容赋值
+     this.seeForm2 = Object.assign({}, row)  
+     this.seeFormStatus2 = 'close'
+     this.seeFormShow2 = true
+     this.$nextTick(() => {
+       this.$refs['seeFormRef2'].clearValidate()
+     })
+   },
 
-    form_complete(row) {
-      var me = this
-
-       me.$confirm('是否完成工单?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-            console.log("删除的ID参数:", row.id)
-            //加载 - 发送新增保存
-            ajaxDataPut(me.url_complete_table + '/' +row.id, {}).then(e => {
-                console.log("编辑结果:",e)
-                //打印请求成功结果
-                if(e.code == 200  ){
-                  me.$message({ type: 'success',  message: '完成成功!'  });
-                  me.get_table_data()
-                } else {
-                  me.$message({ type: 'error', message: '完成失败!' + e.msg, duration: 2000 })
-                }
-            })
-
-
-            
-         
-      
+    
+   see_dialog_close2(){
+      //内容重置
+      this.$refs['seeFormRef2'].resetFields()
+      this.seeFormShow2 = false
+   },
+   sure_dialog_close2(row){
+      console.log(row)
+    this.seeFormShow2 = false
+   },
 
-        
  
-          
-        }).catch(() => {
-          me.$message({
-            type: 'info',
-            message: '已取消'
-          });          
-        });
-
-
-       
-    },
-
-    change_person(value){
-      var me = this 
-      console.log("更改人员Id",value)
-      var item  = me.personList.find(obj => obj.id == value)
-      console.log("更改人员当前的内容",item)
-      me.addForm.user_phone = item.phone
-          
-    },
-
-    //监听 - 穿梭框选到右边的值
-    change_transData1(value){
-      console.log("穿梭框选到右边的值",value)
-    },
-
-    //监听 - 穿梭框选到右边的值
-    change_transData2(value){
-      console.log("穿梭框选到右边的值",value)
-    },
  
     form_export() {
     //获取请求表格数据的参数