Selaa lähdekoodia

蒙牛权限接口全部修改

Shan9312 1 vuosi sitten
vanhempi
commit
6a740780eb
100 muutettua tiedostoa jossa 15986 lisäystä ja 19087 poistoa
  1. 4 2
      .env.development
  2. 14 22
      src/api/common.js
  3. 5 4
      src/views/asset/SST/index.vue
  4. 23 33
      src/views/asset/assetDesignee/index.vue
  5. 101 119
      src/views/asset/assetDesignee/index1.vue
  6. 206 208
      src/views/asset/assetinventory/index.vue
  7. 121 160
      src/views/asset/basics/index.vue
  8. 4 3
      src/views/asset/equipmentAllocation/index.vue
  9. 4 3
      src/views/asset/install/index.vue
  10. 4 3
      src/views/asset/standardAssetAllocation/index.vue
  11. 5 4
      src/views/basic/brand/index.vue
  12. 21 20
      src/views/basic/otherinfo/index.vue
  13. 28 27
      src/views/console/emp/index.vue
  14. 5 4
      src/views/console/feedings/index.vue
  15. 25 24
      src/views/console/ranchManagement/index.vue
  16. 513 513
      src/views/console/role/index.vue
  17. 5 4
      src/views/console/safetyStock/index.vue
  18. 92 119
      src/views/cost/biomassConsum/index.vue
  19. 12 13
      src/views/cost/budget/index.vue
  20. 92 120
      src/views/cost/coalConsum/index.vue
  21. 91 118
      src/views/cost/coalConsum/index1.vue
  22. 55 54
      src/views/cost/diesel/index.vue
  23. 1 1
      src/views/cost/elec/index.vue
  24. 5 4
      src/views/cost/gas/index.vue
  25. 91 119
      src/views/cost/gasolineConsum/index.vue
  26. 3 2
      src/views/cost/generation/index.vue
  27. 3 2
      src/views/cost/methane/index.vue
  28. 3 2
      src/views/cost/other/index.vue
  29. 5 4
      src/views/cost/steam/index.vue
  30. 16 15
      src/views/cost/water/index.vue
  31. 58 71
      src/views/custom/allot/index.vue
  32. 5 4
      src/views/custom/allot/index1.vue
  33. 32 35
      src/views/custom/basic/index.vue
  34. 3 2
      src/views/custom/contract/index.vue
  35. 2964 2971
      src/views/custom/contractManagement/index.vue
  36. 38 38
      src/views/custom/custom/index.vue
  37. 4 3
      src/views/custom/inventory/index.vue
  38. 3 2
      src/views/custom/outRecord/index.vue
  39. 113 143
      src/views/custom/outStock/index.vue
  40. 9 8
      src/views/custom/outStock/index1.vue
  41. 659 661
      src/views/custom/purchase/index.vue
  42. 44 44
      src/views/custom/purchase/index1.vue
  43. 94 142
      src/views/custom/purchase/index2.vue
  44. 12 26
      src/views/custom/receive/index.vue
  45. 11 25
      src/views/custom/receive/index1.vue
  46. 3 2
      src/views/custom/record/index.vue
  47. 5 4
      src/views/custom/refuse/index.vue
  48. 62 75
      src/views/custom/retreat/index.vue
  49. 72 104
      src/views/custom/returngoods/index.vue
  50. 0 2457
      src/views/custom/storage/index.vue
  51. 789 797
      src/views/custom/subscribe/index.vue
  52. 97 99
      src/views/custom/writeoff/index.vue
  53. 101 100
      src/views/custom/writeoff/index1.vue
  54. 107 108
      src/views/custom/writeoff/index2.vue
  55. 4 3
      src/views/electro/electroData/index.vue
  56. 21 35
      src/views/evaluationVerification/assessment/index.vue
  57. 2 1
      src/views/evaluationVerification/assessment/index1.vue
  58. 2 1
      src/views/form/index.vue
  59. 50 61
      src/views/maintenance/maintain/index.vue
  60. 558 653
      src/views/maintenance/maintenancePlan/index.vue
  61. 3 2
      src/views/maintenance/repair/index.vue
  62. 4 3
      src/views/maintenance/spotCheck/index.vue
  63. 1567 1625
      src/views/maintenance/subcontractingMainten/tabPage/tab1.vue
  64. 349 387
      src/views/maintenance/subcontractingMainten/tabPage/tab11.vue
  65. 2345 2345
      src/views/maintenance/subcontractingMainten/tabPage/tab2.vue
  66. 3 2
      src/views/maintenance/upkeep/index.vue
  67. 125 125
      src/views/maintenance/vehicleRecords/index.vue
  68. 3 2
      src/views/report/consume/index.vue
  69. 154 196
      src/views/report/energyConsum/index.vue
  70. 3 2
      src/views/report/farmEquipment/index.vue
  71. 3 3
      src/views/report/inventorySpareParts/index.vue
  72. 12 11
      src/views/report/inventorySummary/index.vue
  73. 4 4
      src/views/report/inventorySummary/index1.vue
  74. 11 15
      src/views/report/inventoryTurnover/index.vue
  75. 15 18
      src/views/report/maintenanceCategoryAnalysis/index.vue
  76. 53 60
      src/views/report/maintenanceCycle/index.vue
  77. 3 2
      src/views/report/maintenanceCycle/index1.vue
  78. 77 87
      src/views/report/maintenanceFault/index.vue
  79. 2 2
      src/views/report/purchaseAndwarehousing/index.vue
  80. 263 266
      src/views/report/queryCombustion/index.vue
  81. 225 226
      src/views/report/queryElec/index.vue
  82. 248 251
      src/views/report/queryRepair/index.vue
  83. 215 216
      src/views/report/queryWater/index.vue
  84. 52 63
      src/views/report/repairRecord/index.vue
  85. 5 4
      src/views/report/sparePartReceive/index.vue
  86. 4 3
      src/views/report/sparePartsSafety/index.vue
  87. 4 3
      src/views/report/standingBook/index.vue
  88. 54 70
      src/views/report/stopRecord/index.vue
  89. 37 45
      src/views/report/stopRecord/index2.vue
  90. 4 4
      src/views/report/timelyArrivalRate/index.vue
  91. 45 38
      src/views/report/vehiclerunningtime/index.vue
  92. 4 3
      src/views/special/earlyWarning/components/fireExtinguisher.vue
  93. 631 630
      src/views/special/earlyWarning/components/insulatAingAppliances.vue
  94. 651 650
      src/views/special/earlyWarning/components/pressureGauge.vue
  95. 654 653
      src/views/special/earlyWarning/components/safetyValve.vue
  96. 4 3
      src/views/special/earlyWarning/components/specialEquipment.vue
  97. 651 650
      src/views/special/earlyWarning/components/thermometer.vue
  98. 14 13
      src/views/special/measure/index.vue
  99. 3 2
      src/views/specialEquipment/basic/index.vue
  100. 3 2
      src/views/specialEquipment/check/index.vue

+ 4 - 2
.env.development

@@ -9,8 +9,10 @@ ENV = 'development'
 # 白少后台本地
 # VUE_APP_BASE_API = 'http://192.168.1.56:8082/'
 # 线上测试
-VUE_APP_BASE_API = 'http://tmrwatch.cn:8082/'
-# VUE_APP_BASE_API = 'http://8.130.17.8:8082/' // 蒙牛
+# VUE_APP_BASE_API = 'http://tmrwatch.cn:8082/'
+VUE_APP_BASE_API = 'http://8.130.17.8:8082/'
+
+#// 蒙牛
 
 # VUE_APP_BASE_API = 'http://127.0.0.1:8082/'
 

+ 14 - 22
src/api/common.js

@@ -1,7 +1,7 @@
 import request from '@/utils/request'
 import parseTime from '@/utils/index.js'
 
-export function postJson(url,data) {
+export function postJson(url, data) {
   return request({
     url: process.env.VUE_APP_BASE_API + url,
     method: 'post',
@@ -10,7 +10,6 @@ export function postJson(url,data) {
   })
 }
 
-
 export function partslistSGv2(data) {
   return request({
     url: '/authdata/partslistSGv2',
@@ -19,8 +18,6 @@ export function partslistSGv2(data) {
   })
 }
 
-
-
 export function startStopRecord(data) {
   return request({
     url: '/authdata/startStopRecord',
@@ -29,7 +26,6 @@ export function startStopRecord(data) {
   })
 }
 
-
 export function GetDataByName(data) {
   return request({
     url: '/authdata/GetDataByName',
@@ -85,7 +81,6 @@ export function EasSync(data) {
   })
 }
 
-
 export function SapTrans(data) {
   return request({
     url: '/authdata/sap/transfer/send',
@@ -118,7 +113,6 @@ export function SapUse(data) {
   })
 }
 
-
 export function SapLaid(data) {
   return request({
     url: '/authdata/sap/laidproof/send',
@@ -127,7 +121,6 @@ export function SapLaid(data) {
   })
 }
 
-
 export function SapOrder(data) {
   return request({
     url: '/authdata/sap/order/send',
@@ -136,7 +129,6 @@ export function SapOrder(data) {
   })
 }
 
-
 export function SrmOrder(data) {
   return request({
     url: '/authdata/srm/order/send',
@@ -191,9 +183,9 @@ export function removeimage(data) {
     data
   })
 }
-export function getJson(url,data) {
+export function getJson(url, data) {
   return request({
-    url:  url + data,
+    url: url + data,
     method: 'get'
   })
 }
@@ -268,7 +260,6 @@ export function updateAndInster(data) {
   })
 }
 
-
 export function transData(a, idStr, pidStr, chindrenStr) {
   var r = []; var hash = {}; var id = idStr; var pid = pidStr; var children = chindrenStr; var i = 0; var j = 0; var len = a.length
   for (; i < len; i++) {
@@ -326,14 +317,15 @@ export function DownloadExcel(data, filename) {
   }
 }
 // 用于获取本月或指定月份的最后一天
-export function getMonthFinalDay(year,month){
-	var day='';
-	if(year==null || year==undefined || year==''){
-		year = new Date().getFullYear();
-	}
-	if(month==null ||  month==undefined || month==''){
-		month = new Date().getMonth()+1;
-	}
-	day = new Date(new Date(year,month).setDate(0)).getDate();
-	return year+"-"+month+"-"+day;
+export function getMonthFinalDay(year, month) {
+  var day = ''
+  if (year == null || year == undefined || year == '') {
+    year = new Date().getFullYear()
+  }
+  if (month == null || month == undefined || month == '') {
+    month = new Date().getMonth() + 1
+  }
+  day = new Date(new Date(year, month).setDate(0)).getDate()
+  return year + '-' + month + '-' + day
 }
+

+ 5 - 4
src/views/asset/SST/index.vue

@@ -255,7 +255,7 @@
               <span>{{ scope.row.runTime }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="部门"   prop="departmentName" min-width="110px" align="center">
+          <el-table-column label="部门" prop="departmentName" min-width="110px" align="center">
             <template slot-scope="scope">
               <span>{{ scope.row.departmentName }}</span>
             </template>
@@ -303,7 +303,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       tableKey: 0,
       list: null,
       total: 0,
@@ -375,7 +375,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['设备使用记录'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['设备使用记录'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -572,7 +573,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list
         this.getDepartDownList()

+ 23 - 33
src/views/asset/assetDesignee/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
     这个页面取消,暂停开发
- 
+
   </div>
 </template>
 
@@ -48,7 +48,7 @@ export default {
           }, 0)
         }, trigger: 'blur' }]
       },
-      placeholder:"请选择设备类别",
+      placeholder: '请选择设备类别',
       findAllBrand: [], findAllProvider: [],
       findAllAssetType: [], findAllPasture: [], findAllDepart: [], findAllEmploye: [],
       getDictByName: [], upkeepgrades: [], createDepartList: [],
@@ -62,10 +62,11 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
-        { name: 'getdictbyname', offset: 0, pagecount: 0, params: ['保养级别'] }
+        { name: 'getdictbyname', offset: 0, pagecount: 0, params: ['保养级别'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
-      disabled: false,  
+      disabled: false,
       nodeKey: 'id',
       defaultCheckedKeys: [],
       parentClass: [],
@@ -77,9 +78,9 @@ export default {
       listLoading: true,
       getdataListParm: {
         name: 'getAssetList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
-        parammaps: {proId:'',brandId:'', assetCode:'',eqCode: '', eqName: '', departmentId: '', pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), status: '', inputDatetime1: '', startTime: '', stopTime: '', inputDatetime2: '', startTime2: '', stopTime2: '', inputDatetime3: '', startTime3: '', stopTime3: '', warning: '', eqClassId: '' }
+        parammaps: { proId: '', brandId: '', assetCode: '', eqCode: '', eqName: '', departmentId: '', pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), status: '', inputDatetime1: '', startTime: '', stopTime: '', inputDatetime2: '', startTime2: '', stopTime2: '', inputDatetime3: '', startTime3: '', stopTime3: '', warning: '', eqClassId: '' }
       },
-     
+
       textMap: { update: '编辑', create: '新增', card: '查看设备信息', examine: '审核', change: '批量变更' },
       dialogFormVisible: false,
       dialogStatus: '',
@@ -98,7 +99,7 @@ export default {
       createTemp: { inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'), employeId: this.$store.state.user.employeid, inputUser: this.$store.state.user.employeid, deptId: this.$store.state.user.departmentid, departmentName: Cookies.get('departmentname'), pastureId: this.$store.state.user.pastureid, assetCode: '', eqClassName: '', eqClassId: '', eqCode: '', eqName: '', specification: '', providerName: '', brandName: '', financeCode: '', status: '正常', purpose: '', purchaseDate: parseTime(new Date(), '{y}-{m}-{d}'), entranceDate: parseTime(new Date(), '{y}-{m}-{d}'), yearUpkeepCost: '', yearMaintainDost: '', yuanzhi: '', baseHours: '', upkeepgrade: '', salvage: '', subtractvalue: '', yearMaintainCost: '', brandId: '', providerId: '', inputUserName: '', employeName: this.$store.state.user.employename, depreciation: '' },
       requestParam: { name: 'insertAsset', offset: 0, pagecount: 0, parammaps: {}},
       seeTemp: {},
- 
+
       dialogFormVisible_See: false,
       activeName: 'first',
 
@@ -241,7 +242,7 @@ export default {
         sheetname: 'SheetJS'
       }
     },
-   
+
     // 设置上传地址
     uploadExcelUrl() {
       // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
@@ -249,12 +250,11 @@ export default {
     }
   },
   created() {
-     
- 
+
   },
   methods: {
-     // 导入
-     beforeImportExcel(file) {
+    // 导入
+    beforeImportExcel(file) {
       const isLt2M = file.size / 1024 / 1024 < 10
       if (!isLt2M) {
         this.$message.error('上传文件大小不能超过 10MB!')
@@ -276,8 +276,6 @@ export default {
             type: 'danger',
             duration: 2000
           })
-
-          
         }
       } else {
         this.$notify({
@@ -352,7 +350,7 @@ export default {
           this.findAllBrand = response.data.findAllBrand.list
           this.findAllProvider = response.data.findAllProvider.list
           this.findAllAssetType = response.data.findAllAssetType.list
-          this.findAllPasture = response.data.findAllPasture.list
+          this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
           this.findAllEmploye = response.data.findAllEmploye.list
           this.getDictByName = response.data.getDictByName.list
           this.upkeepgrades = response.data.getdictbyname.list
@@ -424,7 +422,7 @@ export default {
         console.log('table数据', response.data.list)
         if (response.data.list !== null) {
           this.list = response.data.list
-           
+
           this.pageNum = response.data.pageNum
           this.pageSize = response.data.pageSize
         } else {
@@ -437,7 +435,7 @@ export default {
         this.get_select_list()
       })
     },
-     
+
     SHStatus: function(cellValue) {
       if (cellValue.SHStatus == 0) {
         return '审核中'
@@ -485,7 +483,7 @@ export default {
       this.getdataListParm.offset = 1
       this.get_table_data()
     },
- 
+
     handlePicChange(file, fileList) {
       if (fileList.length > 0) {
         this.$nextTick(() => {
@@ -644,7 +642,7 @@ export default {
       this.createTemp.yearUpkeepCost = ''
       this.createTemp.yearMaintainDost = ''
       this.createTemp.yuanzhi = ''
- 
+
       this.createTemp.baseHours = ''
       this.createTemp.upkeepgrade = 113
       this.createTemp.salvage = ''
@@ -695,9 +693,9 @@ export default {
         //   this.$message({ type: 'warning', message: '请选择具体设备类型' })
         // }
         this.createTemp.eqClassId = checkedData.eqClassId
-          this.createTemp.eqName = checkedData.NewName
-          this.getdataListParm.parammaps.eqClassId = checkedData.eqClassId
-          this.getEQNumber()
+        this.createTemp.eqName = checkedData.NewName
+        this.getdataListParm.parammaps.eqClassId = checkedData.eqClassId
+        this.getEQNumber()
       } else {
         this.defaultCheckedKeys = []
         this.createTemp.eqClassId = ''
@@ -1409,7 +1407,7 @@ export default {
       this.getChartSeeParm.offset = 1
       this.getChartSeeList()
     },
- 
+
     form_delete(row) {
       MessageBox.confirm('确认删除此信息?', {
         confirmButtonText: '确认',
@@ -1424,7 +1422,7 @@ export default {
             this.getdataListParm.parammaps.inputDatetime1 = ''
           }
           this.get_table_data()
-        
+
           this.dialogFormVisible = false
           this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
         })
@@ -1441,18 +1439,13 @@ export default {
     getEQNumber() {
       this.getdataEQNumber.parammaps.pastureId = Cookies.get('pastureid')
       GetDataByName(this.getdataEQNumber).then(response => {
-
-        
         this.createTemp.assetCode = response.data.list[0].createNumber
         console.log(response.data.list[0].createNumber)
         console.log(this.createTemp.assetCode)
         this.$forceUpdate()
-        
       })
     },
 
-   
- 
     changeSHStatue(val) {
       if (val == 2) {
         this.statueReason = true
@@ -1460,10 +1453,7 @@ export default {
         this.statueReason = false
       }
     },
-   
- 
-   
-   
+
     changeBatchDept(item) {
       console.log(item)
       this.batchChange.getdataListParmPerson.parammaps.deptId = item

+ 101 - 119
src/views/asset/assetDesignee/index1.vue

@@ -5,90 +5,86 @@
       <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
       <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
     </div>
- 
-        <div class="filter-container">
-          <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;" @change="changePastureName">
-            <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
-          </el-select>
-          <tree-select
-            v-model="getdataListParm.parammaps.eqClassId"
-            :height="150"
-            :width="250"
-            class="typeSelect"
-            size="small"
-            :data="parentClass"
-            :default-props="defaultProps"
-            :node-key="nodeKey"
-            clearable
-            :disabled="disabled"
-             placeholder="请选择设备类别"
-            :checked-keys="defaultCheckedKeys"
-            style="display: inline-block;"
-            @popoverHide="popoverHide"
-          />
- 
-          <el-input v-model="getdataListParm.parammaps.eqCode" placeholder="指定维修人" clearable style="width: 150px;" class="filter-item" />
-          
-          <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
-          <div>
-            <el-button v-if="isBasicsAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
 
+    <div class="filter-container">
+      <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;" @change="changePastureName">
+        <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
+      <tree-select
+        v-model="getdataListParm.parammaps.eqClassId"
+        :height="150"
+        :width="250"
+        class="typeSelect"
+        size="small"
+        :data="parentClass"
+        :default-props="defaultProps"
+        :node-key="nodeKey"
+        clearable
+        :disabled="disabled"
+        placeholder="请选择设备类别"
+        :checked-keys="defaultCheckedKeys"
+        style="display: inline-block;"
+        @popoverHide="popoverHide"
+      />
 
-            <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
-              <el-button  v-waves class="filter-item" type="warning" icon="el-icon-upload2">导入</el-button>
-            </el-upload>
+      <el-input v-model="getdataListParm.parammaps.eqCode" placeholder="指定维修人" clearable style="width: 150px;" class="filter-item" />
 
-        
-          </div>
-          <el-table
-            :key="tableKey"
-            v-loading="listLoading"
-            element-loading-text="给我一点时间"
-            :data="list"
-            border
-            fit
-            highlight-current-row
-            style="width: 100%;"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable"
-   
-            @sort-change="tableSort2"
-          >
- 
-            <el-table-column label="序号" align="center" type="index" width="50px">
-              <template slot-scope="scope">
-                <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="牧场" align="center" prop="pastureName" />
-            <el-table-column label="部门" align="center" prop="deptName" />
-            <el-table-column label="资产名称" align="center" prop="eqName" />
-            <el-table-column label="指定维修人" align="center" prop="eqCode" />
-            <el-table-column label="一级督办" align="center" prop="specification" />
-            <el-table-column label="二级督办" align="center" prop="brandName" />
-            <el-table-column label="三级督办" align="center" prop="brandName" />
-            <el-table-column label="推送时间(分)" align="center" prop="brandName" />
-             
-            
-            <el-table-column label="折旧年限" sortable align="center" prop="depreciation" />
-            <el-table-column label="使用时长(年)" sortable align="center" prop="serviceDuration" />
-            <el-table-column label="使用率(%)" sortable align="center" prop="utilizationRate" />
-            <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
-              <template slot-scope="{row}">
-                <el-button v-if="isBasicsCard" type="primary" size="mini" @click="form_see(row)">查看</el-button>
-                <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button>
-                <el-button v-if="isBasicsDel2" style="display:inline-block" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
-                <el-button v-else style="display:none" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
-              </template>
-            </el-table-column>
-          </el-table>
-          <pagination v-show="total>=0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
-        </div>
-     
+      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
+      <div>
+        <el-button v-if="isBasicsAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
+
+        <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
+          <el-button v-waves class="filter-item" type="warning" icon="el-icon-upload2">导入</el-button>
+        </el-upload>
+
+      </div>
+      <el-table
+        :key="tableKey"
+        v-loading="listLoading"
+        element-loading-text="给我一点时间"
+        :data="list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable"
+
+        @sort-change="tableSort2"
+      >
+
+        <el-table-column label="序号" align="center" type="index" width="50px">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="牧场" align="center" prop="pastureName" />
+        <el-table-column label="部门" align="center" prop="deptName" />
+        <el-table-column label="资产名称" align="center" prop="eqName" />
+        <el-table-column label="指定维修人" align="center" prop="eqCode" />
+        <el-table-column label="一级督办" align="center" prop="specification" />
+        <el-table-column label="二级督办" align="center" prop="brandName" />
+        <el-table-column label="三级督办" align="center" prop="brandName" />
+        <el-table-column label="推送时间(分)" align="center" prop="brandName" />
+
+        <el-table-column label="折旧年限" sortable align="center" prop="depreciation" />
+        <el-table-column label="使用时长(年)" sortable align="center" prop="serviceDuration" />
+        <el-table-column label="使用率(%)" sortable align="center" prop="utilizationRate" />
+        <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button v-if="isBasicsCard" type="primary" size="mini" @click="form_see(row)">查看</el-button>
+            <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button>
+            <el-button v-if="isBasicsDel2" style="display:inline-block" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
+            <el-button v-else style="display:none" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="total>=0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
+    </div>
 
     <!-- 新增 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible"  v-show = "dialogFormVisible" :close-on-click-modal="false" width="90%">
+    <el-dialog v-show="dialogFormVisible" :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
       <div class="app-add">
         <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="115px" style="width: 90%;margin:0 auto 30px">
           <el-row>
@@ -113,12 +109,12 @@
           <el-row>
             <el-col :span="6">
               <el-form-item label="资产编号:" prop="assetCode">
-                <el-input ref="assetCode" v-model="createTemp.assetCode" placeholder="请输入编号" disabled   />
+                <el-input ref="assetCode" v-model="createTemp.assetCode" placeholder="请输入编号" disabled />
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="设备名称:" prop="eqName">
-                <el-input ref="eqName" v-model="createTemp.eqName" placeholder="请输入设备名称"  disabled/>
+                <el-input ref="eqName" v-model="createTemp.eqName" placeholder="请输入设备名称" disabled />
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -474,9 +470,7 @@
                   </el-row>
                   <el-row>
                     <el-col>
-                      <el-form-item label="操作:">
-                        
-                      </el-form-item>
+                      <el-form-item label="操作:" />
                     </el-col>
                   </el-row>
                 </div>
@@ -699,7 +693,7 @@
                     </el-select>
                     <el-date-picker ref="inputDatetime2" v-model="getChartSeeParm.parammaps.inputDatetime2" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
                     <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_searchChartSee">搜索</el-button>
-                 
+
                   </div>
                   <el-table
                     :key="tableKey"
@@ -796,7 +790,7 @@
         </div>
       </div>
     </el-dialog>
- 
+
     <!-- 变更 -->
     <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_change" :close-on-click-modal="false" width="30%">
       <div class="app-change">
@@ -872,7 +866,7 @@ export default {
           }, 0)
         }, trigger: 'blur' }]
       },
-      placeholder:"请选择设备类别",
+      placeholder: '请选择设备类别',
       findAllBrand: [], findAllProvider: [],
       findAllAssetType: [], findAllPasture: [], findAllDepart: [], findAllEmploye: [],
       getDictByName: [], upkeepgrades: [], createDepartList: [],
@@ -889,7 +883,7 @@ export default {
         { name: 'getdictbyname', offset: 0, pagecount: 0, params: ['保养级别'] }
       ],
       getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
-      disabled: false,  
+      disabled: false,
       nodeKey: 'id',
       defaultCheckedKeys: [],
       parentClass: [],
@@ -901,9 +895,9 @@ export default {
       listLoading: true,
       getdataListParm: {
         name: 'getAssetList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
-        parammaps: {proId:'',brandId:'', assetCode:'',eqCode: '', eqName: '', departmentId: '', pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), status: '', inputDatetime1: '', startTime: '', stopTime: '', inputDatetime2: '', startTime2: '', stopTime2: '', inputDatetime3: '', startTime3: '', stopTime3: '', warning: '', eqClassId: '' }
+        parammaps: { proId: '', brandId: '', assetCode: '', eqCode: '', eqName: '', departmentId: '', pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), status: '', inputDatetime1: '', startTime: '', stopTime: '', inputDatetime2: '', startTime2: '', stopTime2: '', inputDatetime3: '', startTime3: '', stopTime3: '', warning: '', eqClassId: '' }
       },
-     
+
       textMap: { update: '编辑', create: '新增', card: '查看设备信息', examine: '审核', change: '批量变更' },
       dialogFormVisible: false,
       dialogStatus: '',
@@ -922,7 +916,7 @@ export default {
       createTemp: { inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'), employeId: this.$store.state.user.employeid, inputUser: this.$store.state.user.employeid, deptId: this.$store.state.user.departmentid, departmentName: Cookies.get('departmentname'), pastureId: this.$store.state.user.pastureid, assetCode: '', eqClassName: '', eqClassId: '', eqCode: '', eqName: '', specification: '', providerName: '', brandName: '', financeCode: '', status: '正常', purpose: '', purchaseDate: parseTime(new Date(), '{y}-{m}-{d}'), entranceDate: parseTime(new Date(), '{y}-{m}-{d}'), yearUpkeepCost: '', yearMaintainDost: '', yuanzhi: '', baseHours: '', upkeepgrade: '', salvage: '', subtractvalue: '', yearMaintainCost: '', brandId: '', providerId: '', inputUserName: '', employeName: this.$store.state.user.employename, depreciation: '' },
       requestParam: { name: 'insertAsset', offset: 0, pagecount: 0, parammaps: {}},
       seeTemp: {},
- 
+
       dialogFormVisible_See: false,
       activeName: 'first',
 
@@ -1065,7 +1059,7 @@ export default {
         sheetname: 'SheetJS'
       }
     },
-   
+
     // 设置上传地址
     uploadExcelUrl() {
       // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
@@ -1078,19 +1072,17 @@ export default {
       that.buttons = response.data.list
       that.get_auto_buttons()
     })
- 
+
     this.getDownClassList()
     this.getdataListParm.parammaps.pastureName = Cookies.get('pasturename')
-        this.getdataListParm.parammaps.pastureId = Cookies.get('pastureid')
- 
+    this.getdataListParm.parammaps.pastureId = Cookies.get('pastureid')
 
     this.get_table_data()
     // Window.addEventListener('keyup', )
- 
   },
   methods: {
-     // 导入
-     beforeImportExcel(file) {
+    // 导入
+    beforeImportExcel(file) {
       const isLt2M = file.size / 1024 / 1024 < 10
       if (!isLt2M) {
         this.$message.error('上传文件大小不能超过 10MB!')
@@ -1112,8 +1104,6 @@ export default {
             type: 'danger',
             duration: 2000
           })
-
-          
         }
       } else {
         this.$notify({
@@ -1188,7 +1178,7 @@ export default {
           this.findAllBrand = response.data.findAllBrand.list
           this.findAllProvider = response.data.findAllProvider.list
           this.findAllAssetType = response.data.findAllAssetType.list
-          this.findAllPasture = response.data.findAllPasture.list
+          this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
           this.findAllEmploye = response.data.findAllEmploye.list
           this.getDictByName = response.data.getDictByName.list
           this.upkeepgrades = response.data.getdictbyname.list
@@ -1260,7 +1250,7 @@ export default {
         console.log('table数据', response.data.list)
         if (response.data.list !== null) {
           this.list = response.data.list
-           
+
           this.pageNum = response.data.pageNum
           this.pageSize = response.data.pageSize
         } else {
@@ -1273,7 +1263,7 @@ export default {
         this.get_select_list()
       })
     },
-     
+
     SHStatus: function(cellValue) {
       if (cellValue.SHStatus == 0) {
         return '审核中'
@@ -1321,7 +1311,7 @@ export default {
       this.getdataListParm.offset = 1
       this.get_table_data()
     },
- 
+
     handlePicChange(file, fileList) {
       if (fileList.length > 0) {
         this.$nextTick(() => {
@@ -1480,7 +1470,7 @@ export default {
       this.createTemp.yearUpkeepCost = ''
       this.createTemp.yearMaintainDost = ''
       this.createTemp.yuanzhi = ''
- 
+
       this.createTemp.baseHours = ''
       this.createTemp.upkeepgrade = 113
       this.createTemp.salvage = ''
@@ -1531,9 +1521,9 @@ export default {
         //   this.$message({ type: 'warning', message: '请选择具体设备类型' })
         // }
         this.createTemp.eqClassId = checkedData.eqClassId
-          this.createTemp.eqName = checkedData.NewName
-          this.getdataListParm.parammaps.eqClassId = checkedData.eqClassId
-          this.getEQNumber()
+        this.createTemp.eqName = checkedData.NewName
+        this.getdataListParm.parammaps.eqClassId = checkedData.eqClassId
+        this.getEQNumber()
       } else {
         this.defaultCheckedKeys = []
         this.createTemp.eqClassId = ''
@@ -2245,7 +2235,7 @@ export default {
       this.getChartSeeParm.offset = 1
       this.getChartSeeList()
     },
- 
+
     form_delete(row) {
       MessageBox.confirm('确认删除此信息?', {
         confirmButtonText: '确认',
@@ -2260,7 +2250,7 @@ export default {
             this.getdataListParm.parammaps.inputDatetime1 = ''
           }
           this.get_table_data()
-        
+
           this.dialogFormVisible = false
           this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
         })
@@ -2277,18 +2267,13 @@ export default {
     getEQNumber() {
       this.getdataEQNumber.parammaps.pastureId = Cookies.get('pastureid')
       GetDataByName(this.getdataEQNumber).then(response => {
-
-        
         this.createTemp.assetCode = response.data.list[0].createNumber
         console.log(response.data.list[0].createNumber)
         console.log(this.createTemp.assetCode)
         this.$forceUpdate()
-        
       })
     },
 
-   
- 
     changeSHStatue(val) {
       if (val == 2) {
         this.statueReason = true
@@ -2296,10 +2281,7 @@ export default {
         this.statueReason = false
       }
     },
-   
- 
-   
-   
+
     changeBatchDept(item) {
       console.log(item)
       this.batchChange.getdataListParmPerson.parammaps.deptId = item

+ 206 - 208
src/views/asset/assetinventory/index.vue

@@ -22,161 +22,161 @@
       <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="handleDelete">批量删除</el-button>
     </div>
     <el-table
-        :key="tableKey"
-        v-loading="listLoading"
-        element-loading-text="给我一点时间"
-        :data="list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable"
-        @selection-change="handleSelectionChange"
-        :max-height="myHeight"
-      >
-        <el-table-column type="selection" width="55" />
-        <el-table-column label="序号" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="牧场" align="center" prop="pastureName" />
-        <el-table-column label="部门" align="center" prop="departmentName" />
-        <el-table-column label="资产编号" align="center" prop="assetCode" />
-       <el-table-column label="资产名称" align="center" prop="eqName" />
-        <el-table-column label="设备内部编号" align="center" prop="eqCode" />
-        <el-table-column label="实物入账日期" align="center" prop="rzdate" />
-        <el-table-column label="计量单位"   align="center" prop="unit" />
-        <el-table-column label="规格" align="center" prop="specification" />
-        <el-table-column label="资产数量" align="center" prop="quantity" />
-        <el-table-column label="资产原值" sortable align="center" prop="yuanzhi" />
-        <el-table-column label="实际盘点数" sortable align="center" prop="count" />
-        <el-table-column label="盈亏量" sortable align="center" prop="profit" />
-        <el-table-column label="有无标签" sortable align="center" prop="tag" />
-        <el-table-column label="导入日期" sortable align="center" prop="importdate" />
-        <el-table-column label="盘点时间" sortable align="center" prop="inventorydate" />
-        <el-table-column label="盘点人" sortable align="center" prop="checkTakerName" />
-        <el-table-column label="备注" sortable align="center" prop="remark" />
-        <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="{row}">
-            <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
-            <el-button type="danger" size="mini" @click="form_delete(row)">删除</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="total>=0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
-      <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="80%">
-        <div class="app-change">
-          <el-form ref="seeTemp" :model="see.temp" label-position="right" label-width="115px" style="width: 90%;margin:0 auto 30px" @click.native.prevent @submit.native.prevent>
-            <el-row>
-              <el-col :span="6">
-                <el-form-item label="牧场:" prop="pastureName">
-                  <el-input ref="pastureName" v-model="see.temp.pastureName" placeholder="牧场" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="6">
-                <el-form-item label="部门:" prop="departmentName">
-                 <el-input ref="departmentName" v-model="see.temp.departmentName" placeholder="部门" disabled />
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-row>
-              <el-col :span="6">
-                <el-form-item label="设备内部编号:" prop="assetCode">
-                 <el-input ref="assetCode" v-model="see.temp.assetCode" placeholder="设备内部编号" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="6">
-                <el-form-item label="资产名称:" prop="eqName">
-                 <el-input ref="eqName" v-model="see.temp.eqName" placeholder="资产名称" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="6">
-                <el-form-item label="资产编号:" prop="eqCode">
-                  <el-input ref="eqCode" v-model="see.temp.eqCode" placeholder="资产编号" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="6">
-                <el-form-item label="实物入账日期:" prop="rzdate">
-                 <el-input ref="rzdate" v-model="see.temp.rzdate" placeholder="实物入账日期" disabled />
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-row>
-              <el-col :span="6">
-                <el-form-item label="计量单位:" prop="unit">
-                  <el-input ref="unit" v-model="see.temp.unit" placeholder="计量单位" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="6">
-                <el-form-item label="规格:" prop="specification">
-                 <el-input ref="specification" v-model="see.temp.specification" placeholder="规格" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="6">
-                <el-form-item label="资产数量:" prop="quantity">
-                 <el-input ref="quantity" v-model="see.temp.quantity" placeholder="资产数量" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="6">
-                <el-form-item label="资产原值:" prop="yuanzhi">
-                 <el-input ref="yuanzhi" v-model="see.temp.yuanzhi" placeholder="资产原值" disabled />
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-row>
-              <el-col :span="6">
-                <el-form-item label="实际盘点数:" prop="count">
-                  <el-input ref="count" v-model="see.temp.count" placeholder="实际盘点数" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="6">
-                <el-form-item label="盈亏量:" prop="profit">
-                 <el-input ref="profit" v-model="see.temp.profit" placeholder="盈亏量" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="6">
-                <el-form-item label="有无标签:" prop="tag">
-                 <el-input ref="tag" v-model="see.temp.tag" placeholder="有无标签" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="6">
-                <el-form-item label="导入日期:" prop="importdate">
-                 <el-input ref="importdate" v-model="see.temp.importdate" placeholder="导入日期" disabled />
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-row>
-              <el-col :span="6">
-                <el-form-item label="盘点时间:" prop="inventorydate">
-                  <el-input ref="inventorydate" v-model="see.temp.inventorydate" placeholder="盘点时间" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="6">
-                <el-form-item label="盘点人:" prop="checkTakerName">
-                 <el-input ref="checkTakerName" v-model="see.temp.checkTakerName" placeholder="盘点人" disabled />
-                </el-form-item>
-              </el-col>
-              <el-col :span="6">
-                <el-form-item label="备注:" prop="remark">
-                 <el-input ref="remark" v-model="see.temp.remark" placeholder="备注" disabled />
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-          <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
-            <el-button @click="dialogFormVisible = false;">关闭</el-button>
-          </div>
+      :key="tableKey"
+      v-loading="listLoading"
+      element-loading-text="给我一点时间"
+      :data="list"
+      border
+      fit
+      highlight-current-row
+      style="width: 100%;"
+      :row-style="rowStyle"
+      :cell-style="cellStyle"
+      class="elTable"
+      :max-height="myHeight"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" />
+      <el-table-column label="序号" align="center" type="index" width="50px">
+        <template slot-scope="scope">
+          <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="牧场" align="center" prop="pastureName" />
+      <el-table-column label="部门" align="center" prop="departmentName" />
+      <el-table-column label="资产编号" align="center" prop="assetCode" />
+      <el-table-column label="资产名称" align="center" prop="eqName" />
+      <el-table-column label="设备内部编号" align="center" prop="eqCode" />
+      <el-table-column label="实物入账日期" align="center" prop="rzdate" />
+      <el-table-column label="计量单位" align="center" prop="unit" />
+      <el-table-column label="规格" align="center" prop="specification" />
+      <el-table-column label="资产数量" align="center" prop="quantity" />
+      <el-table-column label="资产原值" sortable align="center" prop="yuanzhi" />
+      <el-table-column label="实际盘点数" sortable align="center" prop="count" />
+      <el-table-column label="盈亏量" sortable align="center" prop="profit" />
+      <el-table-column label="有无标签" sortable align="center" prop="tag" />
+      <el-table-column label="导入日期" sortable align="center" prop="importdate" />
+      <el-table-column label="盘点时间" sortable align="center" prop="inventorydate" />
+      <el-table-column label="盘点人" sortable align="center" prop="checkTakerName" />
+      <el-table-column label="备注" sortable align="center" prop="remark" />
+      <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
+          <el-button type="danger" size="mini" @click="form_delete(row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination v-show="total>=0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="80%">
+      <div class="app-change">
+        <el-form ref="seeTemp" :model="see.temp" label-position="right" label-width="115px" style="width: 90%;margin:0 auto 30px" @click.native.prevent @submit.native.prevent>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="牧场:" prop="pastureName">
+                <el-input ref="pastureName" v-model="see.temp.pastureName" placeholder="牧场" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="部门:" prop="departmentName">
+                <el-input ref="departmentName" v-model="see.temp.departmentName" placeholder="部门" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="设备内部编号:" prop="assetCode">
+                <el-input ref="assetCode" v-model="see.temp.assetCode" placeholder="设备内部编号" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="资产名称:" prop="eqName">
+                <el-input ref="eqName" v-model="see.temp.eqName" placeholder="资产名称" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="资产编号:" prop="eqCode">
+                <el-input ref="eqCode" v-model="see.temp.eqCode" placeholder="资产编号" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="实物入账日期:" prop="rzdate">
+                <el-input ref="rzdate" v-model="see.temp.rzdate" placeholder="实物入账日期" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="计量单位:" prop="unit">
+                <el-input ref="unit" v-model="see.temp.unit" placeholder="计量单位" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="规格:" prop="specification">
+                <el-input ref="specification" v-model="see.temp.specification" placeholder="规格" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="资产数量:" prop="quantity">
+                <el-input ref="quantity" v-model="see.temp.quantity" placeholder="资产数量" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="资产原值:" prop="yuanzhi">
+                <el-input ref="yuanzhi" v-model="see.temp.yuanzhi" placeholder="资产原值" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="实际盘点数:" prop="count">
+                <el-input ref="count" v-model="see.temp.count" placeholder="实际盘点数" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="盈亏量:" prop="profit">
+                <el-input ref="profit" v-model="see.temp.profit" placeholder="盈亏量" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="有无标签:" prop="tag">
+                <el-input ref="tag" v-model="see.temp.tag" placeholder="有无标签" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="导入日期:" prop="importdate">
+                <el-input ref="importdate" v-model="see.temp.importdate" placeholder="导入日期" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="盘点时间:" prop="inventorydate">
+                <el-input ref="inventorydate" v-model="see.temp.inventorydate" placeholder="盘点时间" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="盘点人:" prop="checkTakerName">
+                <el-input ref="checkTakerName" v-model="see.temp.checkTakerName" placeholder="盘点人" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="备注:" prop="remark">
+                <el-input ref="remark" v-model="see.temp.remark" placeholder="备注" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
+          <el-button @click="dialogFormVisible = false;">关闭</el-button>
         </div>
-      </el-dialog>
-    </div>
+      </div>
+    </el-dialog>
+  </div>
   </div>
 </template>
 
 <script>
-import { GetDataByName, GetDataByNames,checkButtons,postJson,getJson } from '@/api/common'
+import { GetDataByName, GetDataByNames, checkButtons, postJson, getJson } from '@/api/common'
 import { parseTime, json2excel } from '@/utils/index.js'
 import Pagination from '@/components/Pagination'
 import { MessageBox } from 'element-ui'
@@ -194,26 +194,26 @@ export default {
       listLoading: true,
       getdataListParm: {
         name: 'getAssetList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
-        parammaps: { pastureId: parseInt(Cookies.get('pastureid')),  inputDatetime: '', startTime: '', stopTime: '', departmentId: '' }
+        parammaps: { pastureId: parseInt(Cookies.get('pastureid')), inputDatetime: '', startTime: '', stopTime: '', departmentId: '' }
       },
       isAssetinventorySee: [], isBasicsCard: [], isBasicsUpdate: [], isBasicsDel: [], isBasicsDel2: [], isBasic: [], isBasicSH: [], isBasicExamine: [],
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': "18" }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': '18' }}
       ],
       getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
       findAllPasture: [], findAllDepart: [],
-      selectionList:[],
+      selectionList: [],
       textMap: { see: '查看设备信息' },
       dialogFormVisible: false,
       dialogStatus: '',
-      see:{
-        temp:{}
+      see: {
+        temp: {}
       },
-      isPercentage:false,
+      isPercentage: false,
       uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
   computed: {
@@ -237,12 +237,9 @@ export default {
     }
   },
 
-
-
   created() {
     // this.get_buttons()
     this.get_table_data()
-
   },
   methods: {
     // get_buttons() {
@@ -254,7 +251,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         if (response.data.list !== null) {
-          this.findAllPasture = response.data.findAllPasture.list
+          this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
           this.getDepartDownList()
         }
       })
@@ -271,20 +268,20 @@ export default {
         this.getdataListParm.parammaps.startTime = ''
         this.getdataListParm.parammaps.stopTime = ''
       } else {
-        this.getdataListParm.parammaps.startTime = parseTime(this.getdataListParm.parammaps.inputDatetime[0],'{y}-{m}')+'-01'
-        this.getdataListParm.parammaps.stopTime = parseTime(this.getdataListParm.parammaps.inputDatetime[1],'{y}-{m}')+ '-31'
+        this.getdataListParm.parammaps.startTime = parseTime(this.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}') + '-01'
+        this.getdataListParm.parammaps.stopTime = parseTime(this.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}') + '-31'
       }
       // if( this.getdataListParm.parammaps.startTime == undefined){ this.getdataListParm.parammaps.startTime = ''}
       // if( this.getdataListParm.parammaps.stopTime == undefined){ this.getdataListParm.parammaps.stopTime = ''}
-      if( this.getdataListParm.parammaps.departmentId == undefined){ this.getdataListParm.parammaps.departmentId = ''}
-      let url ='/authdata/stock/list?'
-      let data = 'offset=' + this.getdataListParm.offset
-                + '&pagecount=' + this.getdataListParm.pagecount
-                + '&pastureId=' + this.getdataListParm.parammaps.pastureId
-                + '&departmentId=' + this.getdataListParm.parammaps.departmentId
-                + '&startdate=' + this.getdataListParm.parammaps.startTime
-                + '&enddate=' + this.getdataListParm.parammaps.stopTime
-      getJson(url,data).then(response => {
+      if (this.getdataListParm.parammaps.departmentId == undefined) { this.getdataListParm.parammaps.departmentId = '' }
+      const url = '/authdata/stock/list?'
+      const data = 'offset=' + this.getdataListParm.offset +
+                '&pagecount=' + this.getdataListParm.pagecount +
+                '&pastureId=' + this.getdataListParm.parammaps.pastureId +
+                '&departmentId=' + this.getdataListParm.parammaps.departmentId +
+                '&startdate=' + this.getdataListParm.parammaps.startTime +
+                '&enddate=' + this.getdataListParm.parammaps.stopTime
+      getJson(url, data).then(response => {
         console.log('table数据', response.data.list)
         if (response.data.list !== null) {
           this.list = response.data.list
@@ -320,22 +317,22 @@ export default {
       this.getdataListParm.offset = 1
       this.get_table_data()
     },
-    form_see(row){
+    form_see(row) {
       this.see.temp = Object.assign({}, row) // copy obj
       this.dialogStatus = 'see'
       this.dialogFormVisible = true
     },
-    form_delete(row){
+    form_delete(row) {
       MessageBox.confirm('确认删除此信息?', {
         confirmButtonText: '确认',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        let url = 'authdata/stock/del'
-        let data = {
-          id:[row.id]
+        const url = 'authdata/stock/del'
+        const data = {
+          id: [row.id]
         }
-        postJson(url,data).then(response => {
+        postJson(url, data).then(response => {
           if (response.msg !== 'fail') {
             this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
             this.get_table_data()
@@ -345,26 +342,26 @@ export default {
         })
       })
     },
-    handleDelete(){
-      if(this.selectionList.length == 0){
+    handleDelete() {
+      if (this.selectionList.length == 0) {
         this.$message({ type: 'error', message: '请选择要删除的信息!', duration: 2000 })
         return false
       }
-      let array = []
-      this.selectionList.forEach((item)=>{
+      const array = []
+      this.selectionList.forEach((item) => {
         array.push(item.id)
       })
-      let str = '确认删除选择的'+ array.length+ '条信息?'
+      const str = '确认删除选择的' + array.length + '条信息?'
       MessageBox.confirm(str, {
         confirmButtonText: '确认',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        let url = 'authdata/stock/del'
-        let data = {
-          id:array
+        const url = 'authdata/stock/del'
+        const data = {
+          id: array
         }
-        postJson(url,data).then(response => {
+        postJson(url, data).then(response => {
           if (response.msg !== 'fail') {
             this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
             this.get_table_data()
@@ -374,11 +371,11 @@ export default {
         })
       })
     },
-    handleDownloadTemp(){
+    handleDownloadTemp() {
       const elecExcelDatas = [
         {
-          tHeader: ['序号','牧场','部门', '资产编号', '资产名称', '设备内部编号', '实物入账日期', '计量单位', '规格', '资产数量', '资产原值', '实际盘点数', '盈亏量', '有无标签', '备注'  ],
-          filterVal: ['','','', '', '', '', '', '', '', '', '', '', '', '', ''],
+          tHeader: ['序号', '牧场', '部门', '资产编号', '资产名称', '设备内部编号', '实物入账日期', '计量单位', '规格', '资产数量', '资产原值', '实际盘点数', '盈亏量', '有无标签', '备注'],
+          filterVal: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', ''],
           tableDatas: [],
           sheetName: '资产盘点模板'
         }
@@ -402,18 +399,18 @@ export default {
         this.getdataListParm.parammaps.startTime = ''
         this.getdataListParm.parammaps.stopTime = ''
       } else {
-        this.getdataListParm.parammaps.startTime = parseTime(this.getdataListParm.parammaps.inputDatetime[0],'{y}-{m}')+'-01'
-        this.getdataListParm.parammaps.stopTime = parseTime(this.getdataListParm.parammaps.inputDatetime[1],'{y}-{m}')+ '-31'
+        this.getdataListParm.parammaps.startTime = parseTime(this.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}') + '-01'
+        this.getdataListParm.parammaps.stopTime = parseTime(this.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}') + '-31'
       }
-      if( this.getdataListParm.parammaps.departmentId == undefined){ this.getdataListParm.parammaps.departmentId = ''}
-      let url ='/authdata/stock/list?'
-      let data = 'offset=' + this.getdataListParm.offset
-                + '&pagecount='+9999999
-                + '&pastureId=' + this.getdataListParm.parammaps.pastureId
-                + '&departmentId=' + this.getdataListParm.parammaps.departmentId
-                + '&startdate=' + this.getdataListParm.parammaps.startTime
-                + '&enddate=' + this.getdataListParm.parammaps.stopTime
-      getJson(url,data).then(response => {
+      if (this.getdataListParm.parammaps.departmentId == undefined) { this.getdataListParm.parammaps.departmentId = '' }
+      const url = '/authdata/stock/list?'
+      const data = 'offset=' + this.getdataListParm.offset +
+                '&pagecount=' + 9999999 +
+                '&pastureId=' + this.getdataListParm.parammaps.pastureId +
+                '&departmentId=' + this.getdataListParm.parammaps.departmentId +
+                '&startdate=' + this.getdataListParm.parammaps.startTime +
+                '&enddate=' + this.getdataListParm.parammaps.stopTime
+      getJson(url, data).then(response => {
         var downLoadList = response.data.list
         if (response.data.list !== '') {
           this.percentage = 99
@@ -423,8 +420,8 @@ export default {
         }
         const elecExcelDatas = [
           {
-            tHeader: ['牧场','部门', '资产编号', '资产名称', '设备内部编号', '实物入账日期', '计量单位', '规格', '资产数量', '资产原值', '实际盘点数', '盈亏量', '有无标签','导入日期','盘点日期','盘点人', '备注'],
-            filterVal: ['pastureName','departmentName', 'eqCode', 'eqName', 'assetCode', 'rzdate', 'unit', 'specification', 'quantity', 'yuanzhi', 'count', 'profit', 'tag', 'importdate', 'inventorydate', 'checkTakerName', 'remark'],
+            tHeader: ['牧场', '部门', '资产编号', '资产名称', '设备内部编号', '实物入账日期', '计量单位', '规格', '资产数量', '资产原值', '实际盘点数', '盈亏量', '有无标签', '导入日期', '盘点日期', '盘点人', '备注'],
+            filterVal: ['pastureName', 'departmentName', 'eqCode', 'eqName', 'assetCode', 'rzdate', 'unit', 'specification', 'quantity', 'yuanzhi', 'count', 'profit', 'tag', 'importdate', 'inventorydate', 'checkTakerName', 'remark'],
             tableDatas: downLoadList,
             sheetName: '资产盘点'
           }
@@ -433,7 +430,7 @@ export default {
       })
     },
     // 导入
-     beforeImportExcel(file) {
+    beforeImportExcel(file) {
       const isLt2M = file.size / 1024 / 1024 < 10
       if (!isLt2M) {
         this.$message.error('上传文件大小不能超过 10MB!')
@@ -448,10 +445,10 @@ export default {
           import('@/vendor/Export2Excel').then(excel => {
             const list1 = res.data.result
             const tHeader = [
-              '牧场','部门', '资产编号', '资产名称', '设备内部编号', '实物入账日期', '计量单位', '规格', '资产数量', '资产原值', '实际盘点数', '盈亏量', '有无标签', '备注','报错信息'
+              '牧场', '部门', '资产编号', '资产名称', '设备内部编号', '实物入账日期', '计量单位', '规格', '资产数量', '资产原值', '实际盘点数', '盈亏量', '有无标签', '备注', '报错信息'
             ]
             const filterVal = [
-              '牧场','部门', '资产编号', '资产名称', '设备内部编号', '实物入账日期', '计量单位', '规格', '资产数量', '资产原值', '实际盘点数', '盈亏量', '有无标签', '备注','error_msg'
+              '牧场', '部门', '资产编号', '资产名称', '设备内部编号', '实物入账日期', '计量单位', '规格', '资产数量', '资产原值', '实际盘点数', '盈亏量', '有无标签', '备注', 'error_msg'
             ]
             const data1 = this.formatJson(filterVal, list1)
             excel.export_json_to_excel({
@@ -481,9 +478,10 @@ export default {
     formatJsonTemp(filterVal, jsonData) {
       return jsonData.map(v =>
         filterVal.map(j => {
-          if (j === 'timestamp') { return parseTime(v[j])  } else { return v[j] } })
+          if (j === 'timestamp') { return parseTime(v[j]) } else { return v[j] }
+        })
       )
-    },
+    }
   }
 }
 </script>

+ 121 - 160
src/views/asset/basics/index.vue

@@ -46,14 +46,12 @@
           <el-input v-model="getdataListParm.parammaps.brand" placeholder="品牌" clearable style="width: 120px;" class="filter-item" />
           <!-- <el-input v-model="getdataListParm.parammaps.proName" placeholder="供应商" clearable style="width: 120px;" class="filter-item" /> -->
 
-
           <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
           <div>
             <el-button v-if="isBasicsAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
 
-
             <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
-              <el-button  v-waves class="filter-item" type="warning" icon="el-icon-upload2">导入</el-button>
+              <el-button v-waves class="filter-item" type="warning" icon="el-icon-upload2">导入</el-button>
             </el-upload>
 
             <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
@@ -71,9 +69,9 @@
             :row-style="rowStyle"
             :cell-style="cellStyle"
             class="elTable"
+            :max-height="myHeight"
             @selection-change="handleSelectionChange"
             @sort-change="tableSort2"
-            :max-height="myHeight"
           >
             <el-table-column type="selection" width="55" />
             <el-table-column label="序号" align="center" type="index" width="50px">
@@ -107,7 +105,7 @@
               </template>
             </el-table-column>
             <el-table-column label="设备内部编号" align="center" prop="eqCode" />
-           <el-table-column label="财务编号" align="center" prop="financeCode" />
+            <el-table-column label="财务编号" align="center" prop="financeCode" />
             <el-table-column label="规格" align="center" prop="specification" />
             <el-table-column label="品牌" align="center" prop="brandName" />
             <el-table-column label="状态" align="center" prop="status">
@@ -122,7 +120,7 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="用途"   align="center" prop="purpose" />
+            <el-table-column label="用途" align="center" prop="purpose" />
             <el-table-column label="部门" align="center" prop="deptName" />
             <el-table-column label="责任人" align="center" prop="employeName" />
             <el-table-column label="审批日期" sortable align="center" prop="spDate" />
@@ -146,7 +144,7 @@
             <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
               <template slot-scope="{row}">
                 <el-button v-if="isBasicsCard" type="primary" size="mini" @click="form_see(row)">查看</el-button>
-                <el-button type="success" size="mini" v-if="roleSet1(row)"  @click="form_edit(row)">编辑</el-button>
+                <el-button v-if="roleSet1(row)" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
                 <el-button v-if="roleSet2(row)" style="display:inline-block" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
                 <!-- <el-button v-if="isBasicsDel2" style="display:inline-block" type="danger" size="mini" @click="form_delete(row)">删除</el-button> -->
                 <el-button v-else style="display:none" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
@@ -236,7 +234,7 @@
     </el-tabs>
 
     <!-- 新增 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible"  v-show = "dialogFormVisible" :close-on-click-modal="false" width="90%">
+    <el-dialog v-show="dialogFormVisible" :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
       <div class="app-add">
         <el-form ref="createTemp" :rules="rulesCreate" :model="createTemp" label-position="right" label-width="115px" style="width: 90%;margin:0 auto 30px">
           <el-row>
@@ -261,12 +259,12 @@
           <el-row>
             <el-col :span="6">
               <el-form-item label="资产编号:" prop="assetCode">
-                <el-input ref="assetCode" v-model="createTemp.assetCode" placeholder="请输入编号" disabled   />
+                <el-input ref="assetCode" v-model="createTemp.assetCode" placeholder="请输入编号" disabled />
               </el-form-item>
             </el-col>
             <el-col :span="6">
               <el-form-item label="设备名称:" prop="eqName">
-                <el-input ref="eqName" v-model="createTemp.eqName" placeholder="请输入设备名称"  disabled/>
+                <el-input ref="eqName" v-model="createTemp.eqName" placeholder="请输入设备名称" disabled />
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -409,7 +407,7 @@
           <el-row>
             <el-col :span="6">
               <el-form-item label="指定维修人:" prop="maintenance">
-                <el-select v-model="createTemp.maintenance" multiple  filterable placeholder="指定维修人" class="filter-item" style="width: 100%;" >
+                <el-select v-model="createTemp.maintenance" multiple filterable placeholder="指定维修人" class="filter-item" style="width: 100%;">
                   <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
@@ -437,7 +435,7 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="二级督办:" prop="leveltwo">
-                <el-select v-model="createTemp.leveltwo"  filterable placeholder="设备助理" class="filter-item" style="width:100%">
+                <el-select v-model="createTemp.leveltwo" filterable placeholder="设备助理" class="filter-item" style="width:100%">
                   <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
@@ -453,7 +451,7 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="三级督办:" prop="levelthree">
-                <el-select v-model="createTemp.levelthree"  filterable placeholder="场长" class="filter-item" style="width:100%">
+                <el-select v-model="createTemp.levelthree" filterable placeholder="场长" class="filter-item" style="width:100%">
                   <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
@@ -663,58 +661,57 @@
                 </el-row>
 
                 <el-row>
-                <el-col :span="6">
-                  <el-form-item label="指定维修人:" prop="maintenanceName">
-                    <el-input ref="maintenanceName" v-model="seeTemp.maintenanceName" placeholder="" disabled />
-                  </el-form-item>
-                </el-col>
-
+                  <el-col :span="6">
+                    <el-form-item label="指定维修人:" prop="maintenanceName">
+                      <el-input ref="maintenanceName" v-model="seeTemp.maintenanceName" placeholder="" disabled />
+                    </el-form-item>
+                  </el-col>
 
-                <el-col :span="6">
-                  <el-form-item label="一级督办:" prop="leveloneName">
-                    <el-input ref="leveloneName" v-model="seeTemp.leveloneName" placeholder="" disabled />
-                  </el-form-item>
-                </el-col>
-                <el-col :span="6">
-                  <el-form-item label="一级间隔时间(小时):" prop="leveloneTime">
-                    <el-input ref="leveloneTime" v-model="seeTemp.leveloneTime" placeholder="" disabled />
-                  </el-form-item>
-                </el-col>
-                <el-col :span="6">
-                  <el-form-item label="二级督办:" prop="leveltwoName">
-                    <el-input ref="leveltwoName" v-model="seeTemp.leveltwoName" placeholder="" disabled />
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row>
-                <el-col :span="6">
-                  <el-form-item label="二级间隔时间(小时):" prop="leveltwoTime">
-                    <el-input ref="leveltwoTime" v-model="seeTemp.leveltwoTime" placeholder="" disabled />
-                  </el-form-item>
-                </el-col>
-                <el-col :span="6">
-                  <el-form-item label="三级督办:" prop="levelthreeName">
-                    <el-input ref="levelthreeName" v-model="seeTemp.levelthreeName" placeholder="" disabled />
-                  </el-form-item>
-                </el-col>
-                <el-col :span="6">
-                  <el-form-item label="三级间隔时间(小时):" prop="levelthreeTime">
-                    <el-input ref="levelthreeTime" v-model="seeTemp.levelthreeTime" placeholder="" disabled />
-                  </el-form-item>
-                </el-col>
-                <el-col :span="6">
-                  <el-form-item label="物联网编码" prop="license">
-                    <el-input ref="license" v-model="seeTemp.license" placeholder="物联网编码" disabled />
-                  </el-form-item>
-                </el-col>
-               </el-row>
-               <el-row>
-                 <el-col :span="6">
-                   <el-form-item label="标准工作时长" prop="duration">
-                     <el-input ref="duration" v-model="seeTemp.duration" placeholder="标准工作时长" disabled />
-                   </el-form-item>
-                 </el-col>
-               </el-row>
+                  <el-col :span="6">
+                    <el-form-item label="一级督办:" prop="leveloneName">
+                      <el-input ref="leveloneName" v-model="seeTemp.leveloneName" placeholder="" disabled />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="6">
+                    <el-form-item label="一级间隔时间(小时):" prop="leveloneTime">
+                      <el-input ref="leveloneTime" v-model="seeTemp.leveloneTime" placeholder="" disabled />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="6">
+                    <el-form-item label="二级督办:" prop="leveltwoName">
+                      <el-input ref="leveltwoName" v-model="seeTemp.leveltwoName" placeholder="" disabled />
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row>
+                  <el-col :span="6">
+                    <el-form-item label="二级间隔时间(小时):" prop="leveltwoTime">
+                      <el-input ref="leveltwoTime" v-model="seeTemp.leveltwoTime" placeholder="" disabled />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="6">
+                    <el-form-item label="三级督办:" prop="levelthreeName">
+                      <el-input ref="levelthreeName" v-model="seeTemp.levelthreeName" placeholder="" disabled />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="6">
+                    <el-form-item label="三级间隔时间(小时):" prop="levelthreeTime">
+                      <el-input ref="levelthreeTime" v-model="seeTemp.levelthreeTime" placeholder="" disabled />
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="6">
+                    <el-form-item label="物联网编码" prop="license">
+                      <el-input ref="license" v-model="seeTemp.license" placeholder="物联网编码" disabled />
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row>
+                  <el-col :span="6">
+                    <el-form-item label="标准工作时长" prop="duration">
+                      <el-input ref="duration" v-model="seeTemp.duration" placeholder="标准工作时长" disabled />
+                    </el-form-item>
+                  </el-col>
+                </el-row>
                 <el-row>
                   <el-col>
                     <el-form-item label="设备图片:">
@@ -1151,7 +1148,7 @@ export default {
       isBasicsAdd: [], isBasicsCard: [], isBasicsUpdate: [], isBasicsDel: [], isBasicsDel2: [], isBasic: [], isBasicSH: [], isBasicExamine: [],
       rules: {
         // assetCode: [{ required: true, message: '必填', trigger: 'blur' }],
-        //eqName: [{ required: true, message: '必填', trigger: 'blur' }],
+        // eqName: [{ required: true, message: '必填', trigger: 'blur' }],
         eqCode: [{ required: true, message: '必填', trigger: 'blur' }],
         financeCode: [{ required: true, message: '必填', trigger: 'blur' }],
         departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
@@ -1173,7 +1170,7 @@ export default {
       },
       rulesCreate: {
         // assetCode: [{ required: true, message: '必填', trigger: 'blur' }],
-        //eqName: [{ required: true, message: '必填', trigger: 'blur' }],
+        // eqName: [{ required: true, message: '必填', trigger: 'blur' }],
         eqCode: [{ required: true, message: '必填', trigger: 'blur' }],
         financeCode: [{ required: true, message: '必填', trigger: 'blur' }],
         departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
@@ -1187,12 +1184,10 @@ export default {
         leveltwoTime: [{ required: true, message: '必填', trigger: 'blur' }],
         levelthreeTime: [{ required: true, message: '必填', trigger: 'blur' }],
 
-
         levelone: [{ required: true, message: '必填', trigger: 'blur' }],
         leveltwo: [{ required: true, message: '必填', trigger: 'blur' }],
         levelthree: [{ required: true, message: '必填', trigger: 'blur' }],
 
-
         depreciation: [{ type: 'number', required: true, validator: (rule, value, callback) => {
           if (!value) {
             callback(new Error('不能为空'))
@@ -1208,7 +1203,7 @@ export default {
           }, 0)
         }, trigger: 'blur' }]
       },
-      placeholder:"请选择设备类别",
+      placeholder: '请选择设备类别',
       findAllBrand: [], findAllProvider: [],
       findAllAssetType: [], findAllPasture: [], findAllDepart: [], findAllEmploye: [],
       getDictByName: [], upkeepgrades: [], createDepartList: [],
@@ -1221,11 +1216,12 @@ export default {
         { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
         { name: 'findAlllAssetProvider', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': "18" }},
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': '18' }},
         // { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
-        { name: 'getdictbyname', offset: 0, pagecount: 0, params: ['保养级别'] }
+        { name: 'getdictbyname', offset: 0, pagecount: 0, params: ['保养级别'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
       disabled: false,
@@ -1240,7 +1236,7 @@ export default {
       listLoading: true,
       getdataListParm: {
         name: 'getAssetList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
-        parammaps: {proId:'',brandId:'', assetCode:'',eqCode: '', eqName: '', departmentId: '', pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), status: '', inputDatetime1: '', startTime: '', stopTime: '', inputDatetime2: '', startTime2: '', stopTime2: '', inputDatetime3: '', startTime3: '', stopTime3: '', warning: '', eqClassId: '' }
+        parammaps: { proId: '', brandId: '', assetCode: '', eqCode: '', eqName: '', departmentId: '', pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), status: '', inputDatetime1: '', startTime: '', stopTime: '', inputDatetime2: '', startTime2: '', stopTime2: '', inputDatetime3: '', startTime3: '', stopTime3: '', warning: '', eqClassId: '' }
       },
       listSH: [], totalSH: 0, listLoadingSH: true, tabName: '',
       getdataListParmSH: {
@@ -1262,7 +1258,7 @@ export default {
       uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
       width: '',
 
-      createTemp: { license:'',duration:'',inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'), employeId: this.$store.state.user.employeid, inputUser: this.$store.state.user.employeid, deptId: this.$store.state.user.departmentid, departmentName: Cookies.get('departmentname'), pastureId: this.$store.state.user.pastureid, assetCode: '', eqClassName: '', eqClassId: '', eqCode: '', eqName: '', specification: '', providerName: '', brandName: '', financeCode: '', status: '正常', purpose: '', purchaseDate: parseTime(new Date(), '{y}-{m}-{d}'), entranceDate: parseTime(new Date(), '{y}-{m}-{d}'), yearUpkeepCost: '', yearMaintainDost: '', yuanzhi: '', baseHours: '', upkeepgrade: '', salvage: '', subtractvalue: '', yearMaintainCost: '', brandId: '', providerId: '', inputUserName: '', employeName: this.$store.state.user.employename, depreciation: '5', maintenance: '', levelone: '', leveltwo: '', levelthree: '', pushTime: '', leveloneTime: '', leveltwoTime: '', levelthreeTime: '' },
+      createTemp: { license: '', duration: '', inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'), employeId: this.$store.state.user.employeid, inputUser: this.$store.state.user.employeid, deptId: this.$store.state.user.departmentid, departmentName: Cookies.get('departmentname'), pastureId: this.$store.state.user.pastureid, assetCode: '', eqClassName: '', eqClassId: '', eqCode: '', eqName: '', specification: '', providerName: '', brandName: '', financeCode: '', status: '正常', purpose: '', purchaseDate: parseTime(new Date(), '{y}-{m}-{d}'), entranceDate: parseTime(new Date(), '{y}-{m}-{d}'), yearUpkeepCost: '', yearMaintainDost: '', yuanzhi: '', baseHours: '', upkeepgrade: '', salvage: '', subtractvalue: '', yearMaintainCost: '', brandId: '', providerId: '', inputUserName: '', employeName: this.$store.state.user.employename, depreciation: '5', maintenance: '', levelone: '', leveltwo: '', levelthree: '', pushTime: '', leveloneTime: '', leveltwoTime: '', levelthreeTime: '' },
       requestParam: { name: 'insertAsset', offset: 0, pagecount: 0, parammaps: {}},
       seeTemp: {},
       dialogFormVisible_Examine: false,
@@ -1390,7 +1386,7 @@ export default {
       },
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 250
+      myHeight: document.documentElement.clientHeight - 85 - 250
     }
   },
   computed: {
@@ -1418,23 +1414,15 @@ export default {
     }
   },
 
-
-
   created() {
-
-
-
-
-
-
     const gshebquanx = Cookies.get('gshebquanx')
-    console.log("gshebquanx===================",gshebquanx)
+    console.log('gshebquanx===================', gshebquanx)
 
-    //不是设备处长,没有所有权限
-    if(gshebquanx == '0'){
+    // 不是设备处长,没有所有权限
+    if (gshebquanx == '0') {
       this.requestParams[4].parammaps.id = Cookies.get('pastureid')
     } else {
-      this.requestParams[4].parammaps.id = "18"
+      this.requestParams[4].parammaps.id = '18'
     }
 
     const that = this
@@ -1549,9 +1537,9 @@ export default {
   },
   methods: {
 
-    roleSet1(row){
+    roleSet1(row) {
       var result = true
-      if(row.pastureId == "18" || row.pastureId  ==  Cookies.get('pastureid') || row.pastureId == "0"){
+      if (row.pastureId == '18' || row.pastureId == Cookies.get('pastureid') || row.pastureId == '0') {
         result = true
       } else {
         result = false
@@ -1560,12 +1548,11 @@ export default {
       return result
     },
 
-    roleSet2(row){
-
+    roleSet2(row) {
       var result = true
-      if( (row.pastureId == "18" || row.pastureId == "0" ) && this.isBasicsDel2 ){
+      if ((row.pastureId == '18' || row.pastureId == '0') && this.isBasicsDel2) {
         result = true
-      } else if( (row.pastureId  ==  Cookies.get('pastureid') || row.pastureId == "0" )  && this.isBasicsDel2 ){
+      } else if ((row.pastureId == Cookies.get('pastureid') || row.pastureId == '0') && this.isBasicsDel2) {
         result = true
       } else {
         result = false
@@ -1574,10 +1561,8 @@ export default {
       return result
     },
 
-
-
-     // 导入
-     beforeImportExcel(file) {
+    // 导入
+    beforeImportExcel(file) {
       const isLt2M = file.size / 1024 / 1024 < 10
       if (!isLt2M) {
         this.$message.error('上传文件大小不能超过 10MB!')
@@ -1599,8 +1584,6 @@ export default {
             type: 'danger',
             duration: 2000
           })
-
-
         }
       } else {
         this.$notify({
@@ -1675,7 +1658,7 @@ export default {
           this.findAllBrand = response.data.findAllBrand.list
           this.findAllProvider = response.data.findAllProvider.list
           this.findAllAssetType = response.data.findAllAssetType.list
-          this.findAllPasture = response.data.findAllPasture.list
+          this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
           this.findAllEmploye = response.data.findAllEmploye.list
           this.getDictByName = response.data.getDictByName.list
           this.upkeepgrades = response.data.getdictbyname.list
@@ -1930,7 +1913,7 @@ export default {
       this.width = width + 'px'
     },
     add_dialog_saveAdd() {
-      console.log('点击了保存',this.createTemp.maintenance)
+      console.log('点击了保存', this.createTemp.maintenance)
       this.isokDisable = true
       setTimeout(() => {
         this.isokDisable = false
@@ -2035,7 +2018,6 @@ export default {
       this.createTemp.maintenance = []
     },
 
-
     form_add() {
       this.resetCreateTemp()
       this.edit = 1
@@ -2074,9 +2056,9 @@ export default {
         //   this.$message({ type: 'warning', message: '请选择具体设备类型' })
         // }
         this.createTemp.eqClassId = checkedData.eqClassId
-          this.createTemp.eqName = checkedData.NewName
-          this.getdataListParm.parammaps.eqClassId = checkedData.eqClassId
-          this.getEQNumber()
+        this.createTemp.eqName = checkedData.NewName
+        this.getdataListParm.parammaps.eqClassId = checkedData.eqClassId
+        this.getEQNumber()
       } else {
         this.defaultCheckedKeys = []
         this.createTemp.eqClassId = ''
@@ -2129,14 +2111,13 @@ export default {
             }
           }
 
+          if (this.requestParam.parammaps.maintenance.length != 0 && this.requestParam.parammaps.maintenance) {
+            if (this.requestParam.parammaps.maintenance.length > 4) {
+              this.$notify({ title: '提示', message: '指定维修人最多4个人!', type: 'success', duration: 2000 })
+              return false
+            }
 
-          if(this.requestParam.parammaps.maintenance.length != 0 && this.requestParam.parammaps.maintenance){
-              if(this.requestParam.parammaps.maintenance.length > 4){
-                this.$notify({ title: '提示', message: '指定维修人最多4个人!', type: 'success', duration: 2000 })
-                return false
-              }
-
-             this.requestParam.parammaps.maintenance = this.requestParam.parammaps.maintenance.toString()
+            this.requestParam.parammaps.maintenance = this.requestParam.parammaps.maintenance.toString()
           }
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
@@ -2202,12 +2183,12 @@ export default {
             }
           }
 
-          if(this.requestParam.parammaps.maintenance.length != 0 && this.requestParam.parammaps.maintenance){
-              if(this.requestParam.parammaps.maintenance.length > 4){
-              this.$notify({ title: '提示', message: '指定维修人最多4个人!', type: 'success', duration: 2000 })
-              return false
-            }
-             this.requestParam.parammaps.maintenance = this.requestParam.parammaps.maintenance.toString()
+          if (this.requestParam.parammaps.maintenance.length != 0 && this.requestParam.parammaps.maintenance) {
+            if (this.requestParam.parammaps.maintenance.length > 4) {
+              this.$notify({ title: '提示', message: '指定维修人最多4个人!', type: 'success', duration: 2000 })
+              return false
+            }
+            this.requestParam.parammaps.maintenance = this.requestParam.parammaps.maintenance.toString()
           }
           PostDataByName(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
@@ -2236,7 +2217,6 @@ export default {
         this.createTemp.inputUser = parseInt(row.inputUser)
       }
 
-
       if (row.levelone !== undefined) {
         this.createTemp.levelone = parseInt(row.levelone)
       }
@@ -2257,20 +2237,18 @@ export default {
         this.createTemp.levelthreeTime = parseInt(row.levelthreeTime)
       }
 
-
-      if (row.maintenance && row.maintenance.length>0) {
-        var newArr = row.maintenance.split(",")
+      if (row.maintenance && row.maintenance.length > 0) {
+        var newArr = row.maintenance.split(',')
         var arr2 = []
-        newArr.forEach(function(item){
+        newArr.forEach(function(item) {
           arr2.push(parseInt(item))
         })
-        console.log('arr2',arr2)
+        console.log('arr2', arr2)
         this.createTemp.maintenance = arr2
-      }else{
-        this.$set(this.createTemp,'maintenance',[])
+      } else {
+        this.$set(this.createTemp, 'maintenance', [])
       }
 
-
       if (this.createTemp.eqClassId !== undefined) {
         this.defaultCheckedKeys = [this.createTemp.eqClassId]
       } else {
@@ -2303,9 +2281,6 @@ export default {
       } else {
         this.showUpload = false
       }
-
-
-
     },
     edit_dialog_save() {
       console.log(this.createTemp.maintenance)
@@ -2352,21 +2327,19 @@ export default {
               this.requestParam.parammaps.picpath = this.createTemp.picId
             }
 
+            if (this.requestParam.parammaps.maintenance.length != 0 && this.requestParam.parammaps.maintenance) {
+              if (this.requestParam.parammaps.maintenance.length > 4) {
+                this.$notify({ title: '提示', message: '指定维修人最多4个人!', type: 'success', duration: 2000 })
+                return false
+              }
 
-          if(this.requestParam.parammaps.maintenance.length != 0 && this.requestParam.parammaps.maintenance){
-
-            if(this.requestParam.parammaps.maintenance.length > 4){
-              this.$notify({ title: '提示', message: '指定维修人最多4个人!', type: 'success', duration: 2000 })
-              return false
+              this.requestParam.parammaps.maintenance = this.requestParam.parammaps.maintenance.toString()
             }
-
-            this.requestParam.parammaps.maintenance = this.requestParam.parammaps.maintenance.toString()
-          }
-          if(this.requestParam.parammaps.duration == undefined || this.requestParam.parammaps.duration == "" || this.requestParam.parammaps.duration == null){
-            this.requestParam.parammaps.duration == 0
-            this.$set(this.requestParam.parammaps,'duration',0)
-          }
-            console.log(this.createTemp.maintenance,'maintenance')
+            if (this.requestParam.parammaps.duration == undefined || this.requestParam.parammaps.duration == '' || this.requestParam.parammaps.duration == null) {
+              this.requestParam.parammaps.duration == 0
+              this.$set(this.requestParam.parammaps, 'duration', 0)
+            }
+            console.log(this.createTemp.maintenance, 'maintenance')
             PostDataByName(this.requestParam).then(response => {
               console.log(response)
               if (response.msg !== 'fail') {
@@ -2379,12 +2352,12 @@ export default {
                 this.$notify({ title: '成功', message: '保存成功-', type: 'success', duration: 2000 })
                 // this.reload()
               } else {
-                let arr = this.requestParam.parammaps.maintenance.split(",")
-                let arr1 = []
-                for(let i =0 ;i<arr.length;i++){
+                const arr = this.requestParam.parammaps.maintenance.split(',')
+                const arr1 = []
+                for (let i = 0; i < arr.length; i++) {
                   arr1.push(parseInt(arr[i]))
                 }
-                this.$set(this.createTemp,'maintenance',arr1)
+                this.$set(this.createTemp, 'maintenance', arr1)
                 failproccess(response, this.$notify)
               }
             })
@@ -2894,9 +2867,6 @@ export default {
           }
           console.log(this.downLoadList2)
 
-
-
-
           const ExcelDatas = [
             {
               tHeader: ['类型', '单号', '领用日期', '领用部门', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '出库数量', '退库数量', '单价', '总价'],
@@ -2940,13 +2910,10 @@ export default {
     getEQNumber() {
       this.getdataEQNumber.parammaps.pastureId = Cookies.get('pastureid')
       GetDataByName(this.getdataEQNumber).then(response => {
-
-
         this.createTemp.assetCode = response.data.list[0].createNumber
         console.log(response.data.list[0].createNumber)
         console.log(this.createTemp.assetCode)
         this.$forceUpdate()
-
       })
     },
 
@@ -3052,20 +3019,14 @@ export default {
         }
         console.log(this.downLoadList)
 
-
-
         const elecExcelDatas = [
           {
-            tHeader: ['牧场','设备类别', '资产编号', '设备名称', '设备内部编号', '设备规格', '品牌', '供应商', '用途', '状态', '购置日期', '入场日期', '折旧年限', '财务编号', '原值', '残值', '月核减值', '保养级别', '保养费用', '维修费用', '基数(小时)',  '部门', '责任人', '录入人', '录入时间', '使用时长(年)', '使用率(%)', '指定维修人', '一级督办', '一级间隔时间', '二级督办', '二级间隔时间', '三级督办', '三级间隔时间','物联网编码','标准工作时长'],
-            filterVal: ['pastureName','eqClassName', 'assetCode', 'eqName', 'eqCode', 'specification', 'brandName', 'providerName', 'purpose', 'status', 'purchaseDate', 'entranceDate', 'depreciation', 'financeCode', 'yuanzhi', 'salvage', 'subtractvalue', 'upkeepgrade', 'yearUpkeepCost', 'yearMaintainCost', 'baseHours', 'deptName', 'employeName', 'inputUserName', 'inputDatetime', 'serviceDuration', 'utilizationRate', 'maintenanceName',  'leveloneName', 'leveloneTime','leveltwoName', 'leveltwoTime','levelthreeName','levelthreeTime','license','duration' ],
+            tHeader: ['牧场', '设备类别', '资产编号', '设备名称', '设备内部编号', '设备规格', '品牌', '供应商', '用途', '状态', '购置日期', '入场日期', '折旧年限', '财务编号', '原值', '残值', '月核减值', '保养级别', '保养费用', '维修费用', '基数(小时)', '部门', '责任人', '录入人', '录入时间', '使用时长(年)', '使用率(%)', '指定维修人', '一级督办', '一级间隔时间', '二级督办', '二级间隔时间', '三级督办', '三级间隔时间', '物联网编码', '标准工作时长'],
+            filterVal: ['pastureName', 'eqClassName', 'assetCode', 'eqName', 'eqCode', 'specification', 'brandName', 'providerName', 'purpose', 'status', 'purchaseDate', 'entranceDate', 'depreciation', 'financeCode', 'yuanzhi', 'salvage', 'subtractvalue', 'upkeepgrade', 'yearUpkeepCost', 'yearMaintainCost', 'baseHours', 'deptName', 'employeName', 'inputUserName', 'inputDatetime', 'serviceDuration', 'utilizationRate', 'maintenanceName', 'leveloneName', 'leveloneTime', 'leveltwoName', 'leveltwoTime', 'levelthreeName', 'levelthreeTime', 'license', 'duration'],
             tableDatas: this.downLoadList,
             sheetName: '设备基础信息'
           }
 
-
-
-
-
         ]
         json2excel(elecExcelDatas, '设备基础信息', true, 'xlsx')
       })

+ 4 - 3
src/views/asset/equipmentAllocation/index.vue

@@ -221,7 +221,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'getPastureList', offset: 0, pagecount: 0, parammaps: {}}
+        { name: 'getPastureList', offset: 0, pagecount: 0, parammaps: {}},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
@@ -296,7 +297,7 @@ export default {
       postDataPramas: {},
       findAllDepartIn: [], // 调入部门
       getParmDeptList: { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: {}},
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
   created() {
@@ -309,7 +310,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.findAllPastureIn = response.data.getPastureList.list

+ 4 - 3
src/views/asset/install/index.vue

@@ -302,7 +302,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       tableKey: 0,
       list: null,
       total: 0,
@@ -345,7 +345,8 @@ export default {
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -561,7 +562,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list
         this.getDepartDownList()

+ 4 - 3
src/views/asset/standardAssetAllocation/index.vue

@@ -97,7 +97,8 @@ export default {
     return {
       findAllPasture: [], findAllDepart: [],
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
       disabled: false, placeholder: '请选择设备类别',
@@ -124,7 +125,7 @@ export default {
       isokDisable: false,
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
   created() {
@@ -136,7 +137,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         if (response.data.list !== null) {
-          this.findAllPasture = response.data.findAllPasture.list
+          this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
           this.getDepartDownList()
         }
       })

+ 5 - 4
src/views/basic/brand/index.vue

@@ -24,8 +24,8 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
-      @sort-change="tableSort"
       :max-height="myHeight"
+      @sort-change="tableSort"
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
@@ -182,7 +182,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 150,
+      myHeight: document.documentElement.clientHeight - 85 - 150,
       disabled: false,
       tableKey: 0,
       list: null,
@@ -214,7 +214,8 @@ export default {
 
       // 2-1.请求下拉框接口
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, params: [] }
+        { name: 'findAllPasture', offset: 0, pagecount: 0, params: [] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
 
       temp: {},
@@ -354,7 +355,7 @@ export default {
     // 2-2:下拉框
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
       })
     },
     form_search() {

+ 21 - 20
src/views/basic/otherinfo/index.vue

@@ -14,8 +14,8 @@
       </el-autocomplete>
       <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
       <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
-      <el-button class="filter-item"  style="margin-left: 10px;display: inline-block;" type="info" icon="el-icon-tickets" @click="handleDownloadTemp"> 模板 </el-button>
-      <el-button v-if="isOtherinfoExport" class="filter-item" type="success"  style="margin-left: 10px;" icon="el-icon-download" @click="handleDownload">导出</el-button>
+      <el-button class="filter-item" style="margin-left: 10px;display: inline-block;" type="info" icon="el-icon-tickets" @click="handleDownloadTemp"> 模板 </el-button>
+      <el-button v-if="isOtherinfoExport" class="filter-item" type="success" style="margin-left: 10px;" icon="el-icon-download" @click="handleDownload">导出</el-button>
       <el-upload :headers="headers" style="margin-left: 10px;display: inline-block;" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
         <el-button v-waves class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
       </el-upload>
@@ -33,8 +33,8 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
-      @sort-change="tableSort"
       :max-height="myHeight"
+      @sort-change="tableSort"
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
@@ -244,9 +244,9 @@
 
 <script>
 // 引入
-import { GetDataByName, GetDataByNames, PostDataByName, getRecuData, ExecDataByConfig, failproccess,checkButtons } from '@/api/common'
+import { GetDataByName, GetDataByNames, PostDataByName, getRecuData, ExecDataByConfig, failproccess, checkButtons } from '@/api/common'
 import waves from '@/directive/waves'
-import { parseTime, sortChange,json2excel } from '@/utils/index.js'
+import { parseTime, sortChange, json2excel } from '@/utils/index.js'
 import { validateEMail } from '@/utils/validate.js'
 import Pagination from '@/components/Pagination'
 import { MessageBox } from 'element-ui'
@@ -258,9 +258,9 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
-      isOtherinfoExport:[],
-      buttons:[],
+      myHeight: document.documentElement.clientHeight - 85 - 200,
+      isOtherinfoExport: [],
+      buttons: [],
       isokDisable: false,
       tableKey: 0,
       tableKey2: 0,
@@ -322,7 +322,8 @@ export default {
         // { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllAsset', offset: 0, pagecount: 0, params: [] },
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
       dataform: { deptId: '', parentId: '' },
@@ -353,8 +354,8 @@ export default {
       cardNumber: '',
       isPercentage: false,
       percentage: 1,
-      downLoadParm:{},
-      downLoadList:[]
+      downLoadParm: {},
+      downLoadList: []
     }
   },
   computed: {
@@ -459,8 +460,8 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
-        // this.findAllDepart = response.data.findAllDepart.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
+        this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.findAllAsset = response.data.findAllAsset.list
         this.getDictByName = response.data.getDictByName.list
@@ -985,12 +986,12 @@ export default {
       this.downLoadParm.name = 'getOilcardList'
       this.downLoadParm.parammaps = this.getdataListParm.parammaps
       GetDataByName(this.downLoadParm).then(response => {
-        if(response.data.list !== null && response.data.list !== ''){
-          for(let i=0;i<response.data.list.length;i++){
-            if(response.data.list[i].enable == 0){
-              this.$set(response.data.list[i],'enable','启用')
-            }else{
-              this.$set(response.data.list[i],'enable','停用')
+        if (response.data.list !== null && response.data.list !== '') {
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (response.data.list[i].enable == 0) {
+              this.$set(response.data.list[i], 'enable', '启用')
+            } else {
+              this.$set(response.data.list[i], 'enable', '停用')
             }
           }
         }
@@ -1012,7 +1013,7 @@ export default {
         ]
         json2excel(elecExcelDatas, '油卡', true, 'xlsx')
       })
-    },
+    }
 
   }
 }

+ 28 - 27
src/views/console/emp/index.vue

@@ -38,8 +38,8 @@
         row-key="id"
         default-expand-all
         :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
-        @sort-change="tableSort"
         :max-height="myHeight"
+        @sort-change="tableSort"
       >
         <el-table-column label="序号" align="center" type="index" width="50px">
           <template slot-scope="scope">
@@ -83,7 +83,7 @@
         </el-table-column>
         <el-table-column label="状态" min-width="130px" header-align="center" align="center">
           <template slot-scope="scope">
-            <span>{{scope.row.workstr}}</span>
+            <span>{{ scope.row.workstr }}</span>
           </template>
         </el-table-column>
         <el-table-column label="账号数" sortable prop="isuser" min-width="90px" header-align="center" align="center">
@@ -143,8 +143,8 @@
           </el-form-item>
           <el-form-item label="状态" prop="work">
             <el-select v-model="dataform.work">
-                <el-option v-for="item in workList" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
+              <el-option v-for="item in workList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
           </el-form-item>
           <el-form-item label="联系方式" prop="tel">
             <el-input ref="tel" v-model="dataform.tel" />
@@ -186,7 +186,7 @@ import waves from '@/directive/waves' // waves directive
 import { isIntegerZero } from '@/utils/validate'
 import { validatePhoneTwo } from '@/utils/validate'
 import enterToNext from '@/directive/enterToNext' // enterToNext directive
-import { PostDataByName, GetDataByName, getRecuData,ExecDataByConfig, GetDataByNames, checkButtons, failproccess,GetAccount } from '@/api/common'
+import { PostDataByName, GetDataByName, getRecuData, ExecDataByConfig, GetDataByNames, checkButtons, failproccess, GetAccount } from '@/api/common'
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination
 import { MessageBox } from 'element-ui'
 import Cookies from 'js-cookie'
@@ -197,14 +197,14 @@ export default {
   directives: { waves, enterToNext },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 150,
+      myHeight: document.documentElement.clientHeight - 85 - 150,
       isEmpAdd: [],
       isEmpUpdate: [],
       isEmpDel: [],
       disabled: false,
       tableKey: 0,
       list: [{ sqlname: '', id: 0, sqlstr: '' }],
-      workList:[{id:1,name:'在职'},{id:0,name:'离职'}],
+      workList: [{ id: 1, name: '在职' }, { id: 0, name: '离职' }],
       parentDept: [],
       total: 0,
       listLoading: true,
@@ -278,7 +278,8 @@ export default {
 
       // 2-1.请求下拉框接口
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
 
       dialogFormVisible: false,
@@ -355,7 +356,7 @@ export default {
     // 2-2:下拉框
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
       })
     },
 
@@ -503,28 +504,28 @@ export default {
           this.requestParam.common = { 'returnmap': '0' }
           this.requestParam.data = []
           this.requestParam.data[0] = { 'name': 'updateEmp', 'type': 'e', 'parammaps': {
-            easName:this.dataform.easName,
-            empname:this.dataform.empname,
-            deptid:this.dataform.deptid,
-            tel:this.dataform.tel,
-            position:this.dataform.position,
-            remark:this.dataform.remark,
-            sort:this.dataform.sort,
-            enable:this.dataform.enable,
-            pastureId:this.dataform.pastureId,
-            empCode:this.dataform.empCode,
-            id:this.dataform.id,
-            work:this.dataform.work,
+            easName: this.dataform.easName,
+            empname: this.dataform.empname,
+            deptid: this.dataform.deptid,
+            tel: this.dataform.tel,
+            position: this.dataform.position,
+            remark: this.dataform.remark,
+            sort: this.dataform.sort,
+            enable: this.dataform.enable,
+            pastureId: this.dataform.pastureId,
+            empCode: this.dataform.empCode,
+            id: this.dataform.id,
+            work: this.dataform.work
           }}
           var enable = 0
-          if(this.dataform.work == 0){
+          if (this.dataform.work == 0) {
             enable = 0
-          }else{
+          } else {
             enable = this.dataform.enable
           }
           this.requestParam.data[1] = { 'name': 'editUserEnable', 'type': 'e', 'parammaps': {
-            enable:enable,
-            empid:this.dataform.id
+            enable: enable,
+            empid: this.dataform.id
           }}
           ExecDataByConfig(this.requestParam).then(() => {
             this.get_table_data()
@@ -560,8 +561,8 @@ export default {
         console.log(this.downLoadList)
         const elecExcelDatas = [
           {
-            tHeader: ['牧场', '姓名', '部门', '职位', '电话','状态', '工号'],
-            filterVal: ['pastureName', 'empname', 'deptname', 'position', 'tel','workstr', 'empCode'],
+            tHeader: ['牧场', '姓名', '部门', '职位', '电话', '状态', '工号'],
+            filterVal: ['pastureName', 'empname', 'deptname', 'position', 'tel', 'workstr', 'empCode'],
             tableDatas: this.downLoadList,
             sheetName: '员工信息'
           }

+ 5 - 4
src/views/console/feedings/index.vue

@@ -30,8 +30,8 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
-      @sort-change="tableSort"
       :max-height="myHeight"
+      @sort-change="tableSort"
     >
       <!-- table表格 -->
       <el-table-column label="序号" align="center" type="index" width="50px">
@@ -136,7 +136,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       // 校验规则
       rules: {
         pastureId: [{ required: true, message: '必填', trigger: 'blur' }],
@@ -193,7 +193,8 @@ export default {
       cellStyle: { padding: 0 + 'px' },
       findAllPasture: [],
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       tableKey: 0,
       list: null,
@@ -257,7 +258,7 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
       })
     },
     get_table_data() {

+ 25 - 24
src/views/console/ranchManagement/index.vue

@@ -62,15 +62,15 @@
         <el-form ref="createTemp" :rules="create.rules" :model="create.temp" label-position="right" label-width="110px" style="width: 80%;margin: 0 auto;">
           <el-row>
             <el-col :span="24">
-              <el-form-item label="奶源部:" prop="areaId" v-if="create.dialogStatus =='create'">
-                <el-select  v-model="create.temp.areaId" placeholder="奶源部" style="width: 100%;">
+              <el-form-item v-if="create.dialogStatus =='create'" label="奶源部:" prop="areaId">
+                <el-select v-model="create.temp.areaId" placeholder="奶源部" style="width: 100%;">
                   <el-option v-for="item in regionList" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
-              <el-form-item label="奶源部:"  v-else>
+              <el-form-item v-else label="奶源部:">
                 <!-- <el-input ref="areaName" v-model="create.temp.areaName" placeholder="所属区域"  style="width: 100%;" /> -->
-                <el-select  v-model="create.temp.areaid" placeholder="奶源部" style="width: 100%;" :disabled="create.dialogStatus =='see'" >
-                  <el-option  v-for="item in regionList" :key="item.id" :label="item.name" :value="parseInt(item.id)" />
+                <el-select v-model="create.temp.areaid" placeholder="奶源部" style="width: 100%;" :disabled="create.dialogStatus =='see'">
+                  <el-option v-for="item in regionList" :key="item.id" :label="item.name" :value="parseInt(item.id)" />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -78,21 +78,21 @@
           <el-row>
             <el-col :span="24">
               <el-form-item label="牧场:" prop="pastureName">
-                <el-input ref="pastureName" v-model="create.temp.pastureName" placeholder="牧场" style="width: 100%;" :disabled="create.dialogStatus =='see'"  /><!-- :disabled="create.dialogStatus =='see'"  -->
+                <el-input ref="pastureName" v-model="create.temp.pastureName" placeholder="牧场" style="width: 100%;" :disabled="create.dialogStatus =='see'" /><!-- :disabled="create.dialogStatus =='see'"  -->
               </el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="24">
               <el-form-item label="牧场全称:" prop="companyName">
-                <el-input ref="companyName" v-model="create.temp.companyName" placeholder="牧场全称"  style="width: 100%;" :disabled="create.dialogStatus =='see'"  />
+                <el-input ref="companyName" v-model="create.temp.companyName" placeholder="牧场全称" style="width: 100%;" :disabled="create.dialogStatus =='see'" />
               </el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="24">
               <el-form-item label="牧场编号:" prop="pastureNumber">
-                <el-input ref="pastureNumber" v-model="create.temp.pastureNumber" placeholder="牧场编号" style="width: 100%;" :disabled="create.dialogStatus =='see'"  />
+                <el-input ref="pastureNumber" v-model="create.temp.pastureNumber" placeholder="牧场编号" style="width: 100%;" :disabled="create.dialogStatus =='see'" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -120,8 +120,8 @@
           <el-row>
             <el-col :span="24">
               <el-form-item label="供应负责人:" prop="empId">
-                <el-select  v-model="create.temp.empId" filterable placeholder="供应负责人" style="width: 100%;" :disabled="create.dialogStatus =='see'"  @change="changeEmp">
-                  <el-option  v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
+                <el-select v-model="create.temp.empId" filterable placeholder="供应负责人" style="width: 100%;" :disabled="create.dialogStatus =='see'" @change="changeEmp">
+                  <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -129,7 +129,7 @@
           <el-row>
             <el-col :span="24">
               <el-form-item label="负责人电话:" prop="tel">
-                <el-input ref="tel" v-model="create.temp.tel"  disabled style="width: 100%;" />
+                <el-input ref="tel" v-model="create.temp.tel" disabled style="width: 100%;" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -167,16 +167,17 @@ export default {
   components: { Pagination },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       requestParams: [
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'getareaList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: {}},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       findAllPasture: [],
       findAllEmploye: [],
       regionList: [], // 所属区域
-      areaIds:[],
+      areaIds: [],
       table: {
         tableKey: 0,
         list: null,
@@ -201,7 +202,7 @@ export default {
           pastureNumber: [{ required: true, message: '必填', trigger: 'blur' }]
         },
         temp: {
-          areaId: '', pastureName: '', pastureNumber: '', longitude: '', latitude: '', note: '', sort: '',center:'',empId:'',tel:''
+          areaId: '', pastureName: '', pastureNumber: '', longitude: '', latitude: '', note: '', sort: '', center: '', empId: '', tel: ''
         }
       },
       postDataParam: {},
@@ -218,12 +219,12 @@ export default {
   methods: {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.regionList = response.data.getareaList.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.regionList.forEach(row => {
-          this.areaIds[row.id]= row.name
-        });
+          this.areaIds[row.id] = row.name
+        })
       })
     },
     get_table_data() {
@@ -264,7 +265,7 @@ export default {
         this.$refs['createTemp'].clearValidate()
       })
     },
-    changeEmp(item){
+    changeEmp(item) {
       console.log(item)
       this.create.temp.tel = this.findAllEmploye.find(obj => obj.id == item).tel
     },
@@ -283,7 +284,7 @@ export default {
             longitude: this.create.temp.longitude,
             latitude: this.create.temp.latitude,
             note: this.create.temp.note,
-            center:this.create.temp.center,
+            center: this.create.temp.center,
             companyName: this.create.temp.companyName,
             empId: this.create.temp.empId
           }}
@@ -321,11 +322,11 @@ export default {
           this.postDataParam.common = { 'returnmap': '0' }
           this.postDataParam.data = []
           this.postDataParam.data[0] = { 'name': 'updatePastureDept', 'type': 'e', 'parammaps': {
-            name:this.create.temp.pastureName,
-            companyName:this.create.temp.companyName,
-            pastureNumber:this.create.temp.pastureNumber,
-            center:this.create.temp.center,
-            region:this.areaIds[this.create.temp.areaid],
+            name: this.create.temp.pastureName,
+            companyName: this.create.temp.companyName,
+            pastureNumber: this.create.temp.pastureNumber,
+            center: this.create.temp.center,
+            region: this.areaIds[this.create.temp.areaid],
             longitude: this.create.temp.longitude,
             latitude: this.create.temp.latitude,
             note: this.create.temp.note,

+ 513 - 513
src/views/console/role/index.vue

@@ -1,513 +1,513 @@
-<template>
-  <div class="app-container">
-    <div class="app-container">
-      <div class="filter-container">
-        <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="form_add"> 新增 </el-button>
-      </div>
-      <el-table
-        v-loading="listLoading"
-        element-loading-text="给我一点时间"
-        :data="list"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable"
-        row-key="id"
-        default-expand-all
-        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
-        @sort-change="tableSort"
-        :max-height="myHeight"
-      >
-        <el-table-column label="角色名称" header-align="center" min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.name }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="顺序" sortable prop="sort" min-width="80px" header-align="center" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.sort }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="启用" min-width="80px" header-align="center" align="center">
-          <template slot-scope="scope">
-            <el-switch v-model="scope.row.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" header-align="center" align="center" width="330" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="{row}">
-            <el-button type="warning" size="mini" @click="handleMenu(row)">菜单</el-button>
-            <el-button type="warning" size="mini" style="width:70px" @click="handleDataRole(row)">数据权限</el-button>
-            <el-button type="primary" size="mini" @click="form_edit(row)">编辑</el-button>
-            <el-button v-if="row.status!='已删'" size="mini" type="danger" @click="form_delete(row)">删除</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
-
-      <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
-        <el-form ref="dataForm" :rules="rules" :model="dataform" label-position="left" label-width="100px" style="width: 600px; margin-left:50px;">
-          <el-form-item label="角色名称" prop="name">
-            <el-input ref="name" v-model="dataform.name" />
-          </el-form-item>
-          <el-form-item label="顺序" prop="sort">
-            <el-input ref="sort" v-model="dataform.sort" />
-          </el-form-item>
-          <el-form-item label="EAS信息接收" prop="easInformationReception">
-            <el-switch ref="easInformationReception" v-model="dataform.easInformationReception" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
-          </el-form-item>
-          <el-form-item label="启用" prop="enable">
-            <el-switch ref="enable" v-model="dataform.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
-          </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button v-if="dialogStatus==='create'" type="success" @click="add_dialog_save_again()"> 确认新增 </el-button>
-          <el-button type="primary" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()"> 确认 </el-button>
-          <el-button @click="dialogFormVisible = false;get_table_data();"> 关闭 </el-button>
-        </div>
-      </el-dialog>
-
-      <el-dialog :title="textMap['dataRole']" :visible.sync="dialogDataRoleVisible" :close-on-click-modal="false">
-        <el-form ref="dataRoleTemp" :rules="rules" label-position="left" :model="dataRoleTemp" label-width="100px" style="width: 800px; margin-left:50px;">
-          <el-form-item label="数据权限" prop="datarole">
-            <el-radio-group v-model="dataRoleTemp.datarole">
-              <el-radio :label="3">全部数据</el-radio>
-              <el-radio :label="4">区域数据</el-radio>
-              <el-radio :label="5">奶源部数据</el-radio>
-              <el-radio :label="2">牧场数据</el-radio>
-              <el-radio :label="1">部门数据</el-radio>
-              <el-radio :label="0">个人数据</el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <el-form-item v-if="dataRoleTemp.datarole == 1" label="部门" prop="deptNameList">
-            <el-select v-model="dataRoleTemp.deptNameList" style="width:500px;" multiple placeholder="部门">
-              <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.name" />
-            </el-select>
-          </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="edit_dialog_saveRole()"> 确认 </el-button>
-          <el-button @click="dialogDataRoleVisible = false;get_table_data()"> 关闭 </el-button>
-        </div>
-      </el-dialog>
-      <el-dialog :title="textMap['menu']" :visible.sync="dialogMenuVisible" :close-on-click-modal="false">
-        <el-form :rules="rules" label-position="left" label-width="100px" style="width: 600px; margin-left:50px;">
-          <el-form-item label="菜单" prop="menuname">
-            <tree-select
-              :disabled="disabled"
-              :height="280"
-              :width="200"
-              size="small"
-              multiple
-              :data="parentMenu"
-              :default-props="defaultProps"
-              collapse-tags
-              check-strictly
-              :node-key="nodeKey"
-              :checked-keys="defaultCheckedKeys"
-              @popoverHide="popoverHide"
-            />
-          </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button :disabled="isokDisable" type="primary" @click="updateMenu()"> 确认 </el-button>
-          <el-button @click="dialogMenuVisible = false;get_table_data()"> 关闭 </el-button>
-        </div>
-      </el-dialog>
-    </div>
-  </div>
-</template>
-
-<script>
-import TreeSelect from '@/components/TreeSelect'
-import waves from '@/directive/waves' // waves directive
-import { isIntegerZero } from '@/utils/validate'
-import { PostDataByName, GetDataByName, UpdateDataRelation, ExecDataByConfig, getRecuData, failproccess } from '@/api/common'
-import Pagination from '@/components/Pagination' // secondary package based on el-pagination
-import { MessageBox } from 'element-ui'
-import Cookies from 'js-cookie'
-import { sortChange } from '@/utils/index.js'
-export default {
-  name: 'Role',
-  components: { Pagination, TreeSelect },
-  directives: { waves },
-  data() {
-    return {
-      myHeight:document.documentElement.clientHeight - 85- 180,
-      disabled: false,
-      tableKey: 0,
-      list: [{ 'sqlname': '', 'id': 0, 'sqlstr': '' }],
-      parentMenu: [],
-      total: 0,
-      listLoading: true,
-      requestParam: {
-        name: 'createRole', offset: 0, pagecount: 0, params: []
-      },
-      UpdateDataRelationParam: {
-        name: '', dataname: '', datavalue: '', valuename: '', values: ''
-      },
-      dataform: {
-        id: '', name: '', selectMenus: [], sort: '', enable: '', easInformationReception: ''
-      },
-      getdataListParm: { name: 'getRoleall',
-        offset: 1, pagecount: 10, returntype: 'Map',
-        parammaps: { pastureId: Cookies.get('pastureid') }},
-      getMenuParm: { name: 'getMenuandButtonRecuRule', idname: 'id', params: [-1] },
-      rules: {
-        name: [{ type: 'string', required: true, message: '名称必填', trigger: 'change' }],
-        sort: [{ validator: isIntegerZero, trigger: 'blur' }],
-        datarole: [{ required: true, message: '必填', trigger: 'blur' }]
-      },
-      dialogFormVisible: false,
-      dialogMenuVisible: false,
-      dialogDataRoleVisible: false,
-      selectedMenu: '',
-      dialogStatus: '',
-      textMap: { update: '编辑', create: '新增', menu: '授权菜单', dataRole: '数据权限' },
-      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      defaultProps: { children: 'children', label: 'title' },
-      nodeKey: 'id',
-      defaultCheckedKeys: [],
-      getDataRoleListParm: {
-        name: 'getDataRole', offset: 1, pagecount: '', returntype: 'Map', parammaps: {}
-      },
-      getEchoDeptParm: {
-        name: 'getRoleDepartmentName', offset: 1, pagecount: '', returntype: 'Map', parammaps: {}
-      },
-      isokDisable: false,
-      dataRoleTemp: {},
-      dataRolelist: [],
-      deptList: [],
-      findAllDepart: [],
-      getDepartParam: { name: 'getDepatmentOnlyName', offset: 0, pagecount: 0 },
-      requestParam2: {},
-      requestParam3: {}
-    }
-  },
-  created() {
-    this.get_table_data()
-    this.getDepartDownList()
-  },
-  methods: {
-    tableSort(column) {
-      sortChange(column, this.list)
-    },
-    popoverHide(checkedIds, checkedData) {
-      this.dataform.selectMenus = checkedIds
-      this.selectedMenu = checkedIds
-      this.UpdateDataRelationParam.values = checkedIds
-    },
-    getMenuList() {
-      getRecuData(this.getMenuParm).then(response => {
-        this.parentMenu = response.data
-      })
-    },
-    getDepartDownList() {
-      GetDataByName(this.getDepartParam).then(response => {
-        this.findAllDepart = response.data.list
-      })
-    },
-    get_table_data() {
-      this.listLoading = true
-      GetDataByName(this.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          for (var i = 0; i < response.data.list.length; i++) {
-            response.data.list[i].enable = parseInt(response.data.list[i].enable)
-          }
-          this.list = response.data.list
-        }
-        if (response.data.total) {
-          this.total = response.data.total
-        }
-        this.getMenuList()
-        // Just to simulate the time of the request
-        setTimeout(() => {
-          this.listLoading = false
-        }, 0.5 * 1000)
-      })
-    },
-    resetRequestParam() {
-      this.dataform.id = ''
-      this.dataform.name = ''
-      this.dataform.sort = '0'
-      this.dataform.enable = 1
-      this.dataform.easInformationReception = 0
-    },
-    form_add() {
-      this.resetRequestParam()
-      this.dialogStatus = 'create'
-      this.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.$refs['dataForm'].clearValidate()
-        this.$refs.name.focus()
-      })
-    },
-    add_dialog_save() {
-      this.$refs['dataForm'].validate((valid) => {
-        if (valid) {
-          this.requestParam.name = 'createRole'
-          this.requestParam.params = []
-          this.requestParam.params[0] = this.dataform.name
-          this.requestParam.params[1] = this.dataform.sort
-          this.requestParam.params[2] = this.dataform.enable
-          this.requestParam.params[3] = this.dataform.easInformationReception
-          PostDataByName(this.requestParam).then(() => {
-            this.get_table_data()
-            this.dialogFormVisible = false
-            this.$notify({
-              title: '成功',
-              message: '新增成功',
-              type: 'success',
-              duration: 2000
-            })
-          })
-        }
-      })
-    },
-    add_dialog_save_again() {
-      this.$refs['dataForm'].validate((valid) => {
-        if (valid) {
-          this.requestParam.name = 'createRole'
-          this.requestParam.params = []
-          this.requestParam.params[0] = this.dataform.name
-          this.requestParam.params[1] = this.dataform.sort
-          this.requestParam.params[2] = this.dataform.enable
-          this.requestParam.params[3] = this.dataform.easInformationReception
-          PostDataByName(this.requestParam).then(() => {
-            this.$nextTick(() => {
-              this.$refs['name'].focus()
-            })
-            this.get_table_data()
-            this.resetRequestParam()
-            this.$notify({
-              title: '成功',
-              message: '新增成功',
-              type: 'success',
-              duration: 2000
-            })
-          })
-        }
-      })
-    },
-    handleMenu(row) {
-      this.requestParam.name = 'getMenuByRole'
-      this.requestParam.params = []
-      this.requestParam.params[0] = row.id
-      this.requestParam.pagecount = 0
-      this.requestParam.returntype = 'list'
-      this.dataform.id = row.id
-      this.dialogMenuVisible = true
-
-      console.log("this.requestParam",this.requestParam)
-      GetDataByName(this.requestParam).then(response => {
-        this.selectedMenu = response.data.lists.menu_id
-        this.defaultCheckedKeys = this.selectedMenu
-        this.UpdateDataRelationParam.values = this.defaultCheckedKeys
-      })
-    },
-    updateMenu() {
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.UpdateDataRelationParam.name = 'role_menu'
-      this.UpdateDataRelationParam.dataname = 'role_id'
-      this.UpdateDataRelationParam.datavalue = this.dataform.id
-      this.UpdateDataRelationParam.valuename = 'menu_id'
-      this.UpdateDataRelationParam.values = this.selectedMenu
-
-      UpdateDataRelation(this.UpdateDataRelationParam).then(() => {
-        this.dialogMenuVisible = false
-        this.$notify({
-          title: '成功',
-          message: '修改成功',
-          type: 'success',
-          duration: 2000
-        })
-      })
-    },
-    form_edit(row) {
-      console.log(row, '=====')
-      this.dataform.id = row.id
-      this.dataform.name = row.name
-      this.dataform.sort = row.sort
-      this.dataform.enable = row.enable
-      this.dataform.easInformationReception = row.easInformationReception
-      this.dialogStatus = 'update'
-      this.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.$refs['dataForm'].clearValidate()
-        this.$refs.name.focus()
-      })
-    },
-    edit_dialog_save() {
-      this.$refs['dataForm'].validate((valid) => {
-        if (valid) {
-          this.requestParam.name = 'updateRole'
-          this.requestParam.params = []
-          this.requestParam.params[0] = this.dataform.name
-          this.requestParam.params[1] = this.dataform.sort
-          this.requestParam.params[2] = this.dataform.enable
-          this.requestParam.params[3] = this.dataform.easInformationReception
-          this.requestParam.params[4] = this.dataform.id
-          PostDataByName(this.requestParam).then(() => {
-            this.get_table_data()
-            this.resetRequestParam()
-            this.dialogFormVisible = false
-            this.$notify({
-              title: '成功',
-              message: '修改成功',
-              type: 'success',
-              duration: 2000
-            })
-          })
-        }
-      })
-    },
-    handleEnableChange(index, row) {
-      this.requestParam.name = 'updateRole'
-      this.requestParam.params = []
-      this.requestParam.params[0] = row.name
-      this.requestParam.params[1] = row.sort
-      this.requestParam.params[2] = row.enable
-      this.requestParam.params[3] = row.id
-      PostDataByName(this.requestParam).then(() => {
-        this.$notify({
-          title: '成功',
-          message: '修改成功',
-          type: 'success',
-          duration: 2000
-        })
-      })
-    },
-    form_delete(row) {
-      MessageBox.confirm('名称:' + row.name, '确认删除?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.requestParam.name = 'deleteRole'
-        this.requestParam.params = []
-        this.requestParam.params[0] = row.id
-        PostDataByName(this.requestParam).then(() => {
-          this.get_table_data()
-          this.resetRequestParam()
-          this.dialogFormVisible = false
-          this.$notify({
-            title: '成功',
-            message: '删除成功',
-            type: 'success',
-            duration: 2000
-          })
-        })
-      })
-    },
-    handleDataRole(row) {
-      if (row.deptNameList == undefined) {
-        this.$set(row, 'deptNameList', [])
-      }
-      this.dataRoleTemp = Object.assign({}, row)
-      this.$set(this.dataRoleTemp, 'datarole', 0)
-      this.dialogDataRoleVisible = true
-      this.getDataRoleListParm.parammaps.id = row.id
-      GetDataByName(this.getDataRoleListParm).then(response => {
-        this.dataRolelist = response.data.list
-        this.$set(this.dataRoleTemp, 'datarole', response.data.list[0].datarole)
-        if (this.dataRoleTemp.datarole == 1) {
-          this.getEchoDeptParm.parammaps = {}
-          this.getEchoDeptParm.parammaps.role_id = row.id
-          GetDataByName(this.getEchoDeptParm).then(response => {
-            var deptNameArr = []
-            for (let i = 0; i < response.data.list.length; i++) {
-              deptNameArr.push(response.data.list[i].name)
-            }
-            this.$set(this.dataRoleTemp, 'deptNameList', deptNameArr)
-            this.$forceUpdate()
-            console.log(this.dataRoleTemp.deptNameList)
-          })
-        }
-      })
-    },
-
-    edit_dialog_saveRole() {
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['dataRoleTemp'].validate((valid) => {
-        if (valid) {
-          if (this.dataRoleTemp.datarole == 1) {
-            console.log('quanbu', this.dataRoleTemp.deptNameList)
-            if (this.dataRoleTemp.deptNameList == undefined || this.dataRoleTemp.deptNameList.length == 0) {
-              this.$message({ type: 'warning', message: '请选择部门' })
-              return false
-            }
-            this.requestParam2 = {}
-            this.requestParam2.common = { 'returnmap': '0' }
-            this.requestParam2.data = []
-            for (let i = 0; i < this.dataRoleTemp.deptNameList.length; i++) {
-              this.requestParam2.data.push({ 'name': 'getDepartmentId', 'type': 'sm', 'parammaps': { 'name': this.dataRoleTemp.deptNameList[i] }})
-            }
-            ExecDataByConfig(this.requestParam2).then(response => {
-              console.log('新增保存发送参数', this.requestParam2)
-              if (response.msg == 'fail') {
-                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-              } else {
-                var arr = []
-                for (let i = 0; i < response.data.length; i++) {
-                  for (let j = 0; j < response.data[i].resultmaps.length; j++) {
-                    arr.push(response.data[i].resultmaps[j].id)
-                  }
-                }
-                this.requestParam3.name = 'role_department'
-                this.requestParam3.dataname = 'role_id'
-                this.requestParam3.datavalue = this.dataRoleTemp.id
-                this.requestParam3.valuename = 'department_id'
-                this.requestParam3.values = arr
-                UpdateDataRelation(this.requestParam3).then(response => {
-                  if (response.msg == 'fail') {
-                    this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-                  } else {
-                    this.requestParam.name = 'setDataRole'
-                    this.requestParam.parammaps = {}
-                    this.requestParam.parammaps.id = this.dataRoleTemp.id
-                    this.requestParam.parammaps.datarole = this.dataRoleTemp.datarole
-                    PostDataByName(this.requestParam).then(response => {
-                      console.log('设置数据权限保存发送参数', this.requestParam)
-                      if (response.msg !== 'fail') {
-                        this.get_table_data()
-                        this.dialogDataRoleVisible = false
-                        this.$notify({ title: '成功', message: '设置成功', type: 'success', duration: 2000 })
-                      } else {
-                        failproccess(response, this.$notify)
-                      }
-                    })
-                  }
-                })
-              }
-            })
-          } else {
-            this.requestParam.name = 'setDataRole'
-            this.requestParam.parammaps = {}
-            this.requestParam.parammaps.id = this.dataRoleTemp.id
-            this.requestParam.parammaps.datarole = this.dataRoleTemp.datarole
-            PostDataByName(this.requestParam).then(response => {
-              console.log('设置数据权限保存发送参数', this.requestParam)
-              if (response.msg !== 'fail') {
-                this.get_table_data()
-                this.dialogDataRoleVisible = false
-                this.$notify({ title: '成功', message: '设置成功', type: 'success', duration: 2000 })
-              } else {
-                failproccess(response, this.$notify)
-              }
-            })
-          }
-        }
-      })
-    }
-  }
-}
-</script>
+<template>
+  <div class="app-container">
+    <div class="app-container">
+      <div class="filter-container">
+        <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="form_add"> 新增 </el-button>
+      </div>
+      <el-table
+        v-loading="listLoading"
+        element-loading-text="给我一点时间"
+        :data="list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable"
+        row-key="id"
+        default-expand-all
+        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+        :max-height="myHeight"
+        @sort-change="tableSort"
+      >
+        <el-table-column label="角色名称" header-align="center" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.name }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="顺序" sortable prop="sort" min-width="80px" header-align="center" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.sort }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="启用" min-width="80px" header-align="center" align="center">
+          <template slot-scope="scope">
+            <el-switch v-model="scope.row.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.$index, scope.row)" />
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" header-align="center" align="center" width="330" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button type="warning" size="mini" @click="handleMenu(row)">菜单</el-button>
+            <el-button type="warning" size="mini" style="width:70px" @click="handleDataRole(row)">数据权限</el-button>
+            <el-button type="primary" size="mini" @click="form_edit(row)">编辑</el-button>
+            <el-button v-if="row.status!='已删'" size="mini" type="danger" @click="form_delete(row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
+
+      <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
+        <el-form ref="dataForm" :rules="rules" :model="dataform" label-position="left" label-width="100px" style="width: 600px; margin-left:50px;">
+          <el-form-item label="角色名称" prop="name">
+            <el-input ref="name" v-model="dataform.name" />
+          </el-form-item>
+          <el-form-item label="顺序" prop="sort">
+            <el-input ref="sort" v-model="dataform.sort" />
+          </el-form-item>
+          <el-form-item label="EAS信息接收" prop="easInformationReception">
+            <el-switch ref="easInformationReception" v-model="dataform.easInformationReception" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
+          </el-form-item>
+          <el-form-item label="启用" prop="enable">
+            <el-switch ref="enable" v-model="dataform.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button v-if="dialogStatus==='create'" type="success" @click="add_dialog_save_again()"> 确认新增 </el-button>
+          <el-button type="primary" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()"> 确认 </el-button>
+          <el-button @click="dialogFormVisible = false;get_table_data();"> 关闭 </el-button>
+        </div>
+      </el-dialog>
+
+      <el-dialog :title="textMap['dataRole']" :visible.sync="dialogDataRoleVisible" :close-on-click-modal="false">
+        <el-form ref="dataRoleTemp" :rules="rules" label-position="left" :model="dataRoleTemp" label-width="100px" style="width: 800px; margin-left:50px;">
+          <el-form-item label="数据权限" prop="datarole">
+            <el-radio-group v-model="dataRoleTemp.datarole">
+              <el-radio :label="5">全部数据</el-radio>
+              <el-radio :label="4">区域数据</el-radio>
+              <el-radio :label="3">奶源部数据</el-radio>
+              <el-radio :label="2">牧场数据</el-radio>
+              <el-radio :label="1">部门数据</el-radio>
+              <el-radio :label="0">个人数据</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item v-if="dataRoleTemp.datarole == 1" label="部门" prop="deptNameList">
+            <el-select v-model="dataRoleTemp.deptNameList" style="width:500px;" multiple placeholder="部门">
+              <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.name" />
+            </el-select>
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="edit_dialog_saveRole()"> 确认 </el-button>
+          <el-button @click="dialogDataRoleVisible = false;get_table_data()"> 关闭 </el-button>
+        </div>
+      </el-dialog>
+      <el-dialog :title="textMap['menu']" :visible.sync="dialogMenuVisible" :close-on-click-modal="false">
+        <el-form :rules="rules" label-position="left" label-width="100px" style="width: 600px; margin-left:50px;">
+          <el-form-item label="菜单" prop="menuname">
+            <tree-select
+              :disabled="disabled"
+              :height="280"
+              :width="200"
+              size="small"
+              multiple
+              :data="parentMenu"
+              :default-props="defaultProps"
+              collapse-tags
+              check-strictly
+              :node-key="nodeKey"
+              :checked-keys="defaultCheckedKeys"
+              @popoverHide="popoverHide"
+            />
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button :disabled="isokDisable" type="primary" @click="updateMenu()"> 确认 </el-button>
+          <el-button @click="dialogMenuVisible = false;get_table_data()"> 关闭 </el-button>
+        </div>
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+import TreeSelect from '@/components/TreeSelect'
+import waves from '@/directive/waves' // waves directive
+import { isIntegerZero } from '@/utils/validate'
+import { PostDataByName, GetDataByName, UpdateDataRelation, ExecDataByConfig, getRecuData, failproccess } from '@/api/common'
+import Pagination from '@/components/Pagination' // secondary package based on el-pagination
+import { MessageBox } from 'element-ui'
+import Cookies from 'js-cookie'
+import { sortChange } from '@/utils/index.js'
+export default {
+  name: 'Role',
+  components: { Pagination, TreeSelect },
+  directives: { waves },
+  data() {
+    return {
+      myHeight: document.documentElement.clientHeight - 85 - 180,
+      disabled: false,
+      tableKey: 0,
+      list: [{ 'sqlname': '', 'id': 0, 'sqlstr': '' }],
+      parentMenu: [],
+      total: 0,
+      listLoading: true,
+      requestParam: {
+        name: 'createRole', offset: 0, pagecount: 0, params: []
+      },
+      UpdateDataRelationParam: {
+        name: '', dataname: '', datavalue: '', valuename: '', values: ''
+      },
+      dataform: {
+        id: '', name: '', selectMenus: [], sort: '', enable: '', easInformationReception: ''
+      },
+      getdataListParm: { name: 'getRoleall',
+        offset: 1, pagecount: 10, returntype: 'Map',
+        parammaps: { pastureId: Cookies.get('pastureid') }},
+      getMenuParm: { name: 'getMenuandButtonRecuRule', idname: 'id', params: [-1] },
+      rules: {
+        name: [{ type: 'string', required: true, message: '名称必填', trigger: 'change' }],
+        sort: [{ validator: isIntegerZero, trigger: 'blur' }],
+        datarole: [{ required: true, message: '必填', trigger: 'blur' }]
+      },
+      dialogFormVisible: false,
+      dialogMenuVisible: false,
+      dialogDataRoleVisible: false,
+      selectedMenu: '',
+      dialogStatus: '',
+      textMap: { update: '编辑', create: '新增', menu: '授权菜单', dataRole: '数据权限' },
+      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      defaultProps: { children: 'children', label: 'title' },
+      nodeKey: 'id',
+      defaultCheckedKeys: [],
+      getDataRoleListParm: {
+        name: 'getDataRole', offset: 1, pagecount: '', returntype: 'Map', parammaps: {}
+      },
+      getEchoDeptParm: {
+        name: 'getRoleDepartmentName', offset: 1, pagecount: '', returntype: 'Map', parammaps: {}
+      },
+      isokDisable: false,
+      dataRoleTemp: {},
+      dataRolelist: [],
+      deptList: [],
+      findAllDepart: [],
+      getDepartParam: { name: 'getDepatmentOnlyName', offset: 0, pagecount: 0 },
+      requestParam2: {},
+      requestParam3: {}
+    }
+  },
+  created() {
+    this.get_table_data()
+    this.getDepartDownList()
+  },
+  methods: {
+    tableSort(column) {
+      sortChange(column, this.list)
+    },
+    popoverHide(checkedIds, checkedData) {
+      this.dataform.selectMenus = checkedIds
+      this.selectedMenu = checkedIds
+      this.UpdateDataRelationParam.values = checkedIds
+    },
+    getMenuList() {
+      getRecuData(this.getMenuParm).then(response => {
+        this.parentMenu = response.data
+      })
+    },
+    getDepartDownList() {
+      GetDataByName(this.getDepartParam).then(response => {
+        this.findAllDepart = response.data.list
+      })
+    },
+    get_table_data() {
+      this.listLoading = true
+      GetDataByName(this.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (var i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].enable = parseInt(response.data.list[i].enable)
+          }
+          this.list = response.data.list
+        }
+        if (response.data.total) {
+          this.total = response.data.total
+        }
+        this.getMenuList()
+        // Just to simulate the time of the request
+        setTimeout(() => {
+          this.listLoading = false
+        }, 0.5 * 1000)
+      })
+    },
+    resetRequestParam() {
+      this.dataform.id = ''
+      this.dataform.name = ''
+      this.dataform.sort = '0'
+      this.dataform.enable = 1
+      this.dataform.easInformationReception = 0
+    },
+    form_add() {
+      this.resetRequestParam()
+      this.dialogStatus = 'create'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+        this.$refs.name.focus()
+      })
+    },
+    add_dialog_save() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.requestParam.name = 'createRole'
+          this.requestParam.params = []
+          this.requestParam.params[0] = this.dataform.name
+          this.requestParam.params[1] = this.dataform.sort
+          this.requestParam.params[2] = this.dataform.enable
+          this.requestParam.params[3] = this.dataform.easInformationReception
+          PostDataByName(this.requestParam).then(() => {
+            this.get_table_data()
+            this.dialogFormVisible = false
+            this.$notify({
+              title: '成功',
+              message: '新增成功',
+              type: 'success',
+              duration: 2000
+            })
+          })
+        }
+      })
+    },
+    add_dialog_save_again() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.requestParam.name = 'createRole'
+          this.requestParam.params = []
+          this.requestParam.params[0] = this.dataform.name
+          this.requestParam.params[1] = this.dataform.sort
+          this.requestParam.params[2] = this.dataform.enable
+          this.requestParam.params[3] = this.dataform.easInformationReception
+          PostDataByName(this.requestParam).then(() => {
+            this.$nextTick(() => {
+              this.$refs['name'].focus()
+            })
+            this.get_table_data()
+            this.resetRequestParam()
+            this.$notify({
+              title: '成功',
+              message: '新增成功',
+              type: 'success',
+              duration: 2000
+            })
+          })
+        }
+      })
+    },
+    handleMenu(row) {
+      this.requestParam.name = 'getMenuByRole'
+      this.requestParam.params = []
+      this.requestParam.params[0] = row.id
+      this.requestParam.pagecount = 0
+      this.requestParam.returntype = 'list'
+      this.dataform.id = row.id
+      this.dialogMenuVisible = true
+
+      console.log('this.requestParam', this.requestParam)
+      GetDataByName(this.requestParam).then(response => {
+        this.selectedMenu = response.data.lists.menu_id
+        this.defaultCheckedKeys = this.selectedMenu
+        this.UpdateDataRelationParam.values = this.defaultCheckedKeys
+      })
+    },
+    updateMenu() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.UpdateDataRelationParam.name = 'role_menu'
+      this.UpdateDataRelationParam.dataname = 'role_id'
+      this.UpdateDataRelationParam.datavalue = this.dataform.id
+      this.UpdateDataRelationParam.valuename = 'menu_id'
+      this.UpdateDataRelationParam.values = this.selectedMenu
+
+      UpdateDataRelation(this.UpdateDataRelationParam).then(() => {
+        this.dialogMenuVisible = false
+        this.$notify({
+          title: '成功',
+          message: '修改成功',
+          type: 'success',
+          duration: 2000
+        })
+      })
+    },
+    form_edit(row) {
+      console.log(row, '=====')
+      this.dataform.id = row.id
+      this.dataform.name = row.name
+      this.dataform.sort = row.sort
+      this.dataform.enable = row.enable
+      this.dataform.easInformationReception = row.easInformationReception
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+        this.$refs.name.focus()
+      })
+    },
+    edit_dialog_save() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.requestParam.name = 'updateRole'
+          this.requestParam.params = []
+          this.requestParam.params[0] = this.dataform.name
+          this.requestParam.params[1] = this.dataform.sort
+          this.requestParam.params[2] = this.dataform.enable
+          this.requestParam.params[3] = this.dataform.easInformationReception
+          this.requestParam.params[4] = this.dataform.id
+          PostDataByName(this.requestParam).then(() => {
+            this.get_table_data()
+            this.resetRequestParam()
+            this.dialogFormVisible = false
+            this.$notify({
+              title: '成功',
+              message: '修改成功',
+              type: 'success',
+              duration: 2000
+            })
+          })
+        }
+      })
+    },
+    handleEnableChange(index, row) {
+      this.requestParam.name = 'updateRole'
+      this.requestParam.params = []
+      this.requestParam.params[0] = row.name
+      this.requestParam.params[1] = row.sort
+      this.requestParam.params[2] = row.enable
+      this.requestParam.params[3] = row.id
+      PostDataByName(this.requestParam).then(() => {
+        this.$notify({
+          title: '成功',
+          message: '修改成功',
+          type: 'success',
+          duration: 2000
+        })
+      })
+    },
+    form_delete(row) {
+      MessageBox.confirm('名称:' + row.name, '确认删除?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.requestParam.name = 'deleteRole'
+        this.requestParam.params = []
+        this.requestParam.params[0] = row.id
+        PostDataByName(this.requestParam).then(() => {
+          this.get_table_data()
+          this.resetRequestParam()
+          this.dialogFormVisible = false
+          this.$notify({
+            title: '成功',
+            message: '删除成功',
+            type: 'success',
+            duration: 2000
+          })
+        })
+      })
+    },
+    handleDataRole(row) {
+      if (row.deptNameList == undefined) {
+        this.$set(row, 'deptNameList', [])
+      }
+      this.dataRoleTemp = Object.assign({}, row)
+      this.$set(this.dataRoleTemp, 'datarole', 0)
+      this.dialogDataRoleVisible = true
+      this.getDataRoleListParm.parammaps.id = row.id
+      GetDataByName(this.getDataRoleListParm).then(response => {
+        this.dataRolelist = response.data.list
+        this.$set(this.dataRoleTemp, 'datarole', response.data.list[0].datarole)
+        if (this.dataRoleTemp.datarole == 1) {
+          this.getEchoDeptParm.parammaps = {}
+          this.getEchoDeptParm.parammaps.role_id = row.id
+          GetDataByName(this.getEchoDeptParm).then(response => {
+            var deptNameArr = []
+            for (let i = 0; i < response.data.list.length; i++) {
+              deptNameArr.push(response.data.list[i].name)
+            }
+            this.$set(this.dataRoleTemp, 'deptNameList', deptNameArr)
+            this.$forceUpdate()
+            console.log(this.dataRoleTemp.deptNameList)
+          })
+        }
+      })
+    },
+
+    edit_dialog_saveRole() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['dataRoleTemp'].validate((valid) => {
+        if (valid) {
+          if (this.dataRoleTemp.datarole == 1) {
+            console.log('quanbu', this.dataRoleTemp.deptNameList)
+            if (this.dataRoleTemp.deptNameList == undefined || this.dataRoleTemp.deptNameList.length == 0) {
+              this.$message({ type: 'warning', message: '请选择部门' })
+              return false
+            }
+            this.requestParam2 = {}
+            this.requestParam2.common = { 'returnmap': '0' }
+            this.requestParam2.data = []
+            for (let i = 0; i < this.dataRoleTemp.deptNameList.length; i++) {
+              this.requestParam2.data.push({ 'name': 'getDepartmentId', 'type': 'sm', 'parammaps': { 'name': this.dataRoleTemp.deptNameList[i] }})
+            }
+            ExecDataByConfig(this.requestParam2).then(response => {
+              console.log('新增保存发送参数', this.requestParam2)
+              if (response.msg == 'fail') {
+                this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+              } else {
+                var arr = []
+                for (let i = 0; i < response.data.length; i++) {
+                  for (let j = 0; j < response.data[i].resultmaps.length; j++) {
+                    arr.push(response.data[i].resultmaps[j].id)
+                  }
+                }
+                this.requestParam3.name = 'role_department'
+                this.requestParam3.dataname = 'role_id'
+                this.requestParam3.datavalue = this.dataRoleTemp.id
+                this.requestParam3.valuename = 'department_id'
+                this.requestParam3.values = arr
+                UpdateDataRelation(this.requestParam3).then(response => {
+                  if (response.msg == 'fail') {
+                    this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+                  } else {
+                    this.requestParam.name = 'setDataRole'
+                    this.requestParam.parammaps = {}
+                    this.requestParam.parammaps.id = this.dataRoleTemp.id
+                    this.requestParam.parammaps.datarole = this.dataRoleTemp.datarole
+                    PostDataByName(this.requestParam).then(response => {
+                      console.log('设置数据权限保存发送参数', this.requestParam)
+                      if (response.msg !== 'fail') {
+                        this.get_table_data()
+                        this.dialogDataRoleVisible = false
+                        this.$notify({ title: '成功', message: '设置成功', type: 'success', duration: 2000 })
+                      } else {
+                        failproccess(response, this.$notify)
+                      }
+                    })
+                  }
+                })
+              }
+            })
+          } else {
+            this.requestParam.name = 'setDataRole'
+            this.requestParam.parammaps = {}
+            this.requestParam.parammaps.id = this.dataRoleTemp.id
+            this.requestParam.parammaps.datarole = this.dataRoleTemp.datarole
+            PostDataByName(this.requestParam).then(response => {
+              console.log('设置数据权限保存发送参数', this.requestParam)
+              if (response.msg !== 'fail') {
+                this.get_table_data()
+                this.dialogDataRoleVisible = false
+                this.$notify({ title: '成功', message: '设置成功', type: 'success', duration: 2000 })
+              } else {
+                failproccess(response, this.$notify)
+              }
+            })
+          }
+        }
+      })
+    }
+  }
+}
+</script>

+ 5 - 4
src/views/console/safetyStock/index.vue

@@ -49,9 +49,9 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
+      :max-height="myHeight"
       @selection-change="handleSelectionChange"
       @sort-change="tableSort"
-      :max-height="myHeight"
     >
       <el-table-column type="selection" width="55" />
       <el-table-column label="序号" align="center" type="index" width="50px">
@@ -156,7 +156,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       rules: {
         maxRepertory: [{ type: 'number', required: true, validator: (rule, value, callback) => {
           if (!value) {
@@ -191,7 +191,8 @@ export default {
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       findAllPasture: [],
-      requestParams: [{ name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}],
+      requestParams: [{ name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}],
       parentDept: [],
       defaultProps: {
         children: 'children',
@@ -291,7 +292,7 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
       })
     },
     getTypeList() {

+ 92 - 119
src/views/cost/biomassConsum/index.vue

@@ -40,19 +40,18 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
- 
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
           <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="牧场"  min-width="110px" align="center">
+      <el-table-column label="牧场" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.pastureName }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="部门"  min-width="110px" align="center">
+      <el-table-column label="部门" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.departmentName }}</span>
         </template>
@@ -62,31 +61,31 @@
           <span>{{ scope.row.dosage }}</span>
         </template>
       </el-table-column>
- 
-      <el-table-column label="单价"  min-width="110px" align="center">
+
+      <el-table-column label="单价" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.price }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="当天费用"  min-width="110px"align="center">
+      <el-table-column label="当天费用" min-width="110px"align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.expense  }}</span>
+          <span>{{ scope.row.expense }}</span>
         </template>
       </el-table-column>
       <el-table-column label="记录人" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.empname   }}</span>
+          <span>{{ scope.row.empname }}</span>
         </template>
       </el-table-column>
       <el-table-column label="日期" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.date  }}</span>
+          <span>{{ scope.row.date }}</span>
         </template>
       </el-table-column>
- 
+
       <el-table-column label="备注" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.remarks  }}</span>
+          <span>{{ scope.row.remarks }}</span>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
@@ -101,67 +100,64 @@
     <!-- 弹出层新增or修改 -->
     <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
       <el-form ref="temp" :rules="rules1" :model="temp" label-position="right" label-width="110px">
-        
+
         <el-row>
-           
+
           <el-col :span="8">
 
-            <el-form-item label="牧场:" prop="pastureId" v-show="dialogStatus==='create'">
-                <el-select v-model="temp.pastureId" placeholder="牧场"   class="filter-item" @change="change_pasture2" style="width:100%">
-                  <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
+            <el-form-item v-show="dialogStatus==='create'" label="牧场:" prop="pastureId">
+              <el-select v-model="temp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" @change="change_pasture2">
+                <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
 
-            <el-form-item label="牧场:" prop="pastureId" v-show="dialogStatus==='update'">
-                <el-input ref="pastureName" v-model="temp.pastureName"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="牧场:" prop="pastureId">
+              <el-input ref="pastureName" v-model="temp.pastureName" disabled />
             </el-form-item>
 
-
           </el-col>
           <el-col :span="8">
-            <el-form-item label="部门:"  prop="departmentId"  v-show="dialogStatus==='create'">
+            <el-form-item v-show="dialogStatus==='create'" label="部门:" prop="departmentId">
               <el-select v-model="temp.departmentId" clearable placeholder="部门" class="filter-item" style="width:100%">
                 <el-option v-for="item in departList2" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
-            <el-form-item label="部门:"  prop="departmentId"  v-show="dialogStatus==='update'">
-                <el-input ref="departmentName" v-model="temp.departmentName"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="部门:" prop="departmentId">
+              <el-input ref="departmentName" v-model="temp.departmentName" disabled />
             </el-form-item>
-    
+
           </el-col>
- 
 
-           
         </el-row>
         <el-row>
           <el-col :span="8">
             <el-form-item label="当前生物质颗粒用量:" prop="dosage">
-              <el-input ref="dosage" v-model="temp.dosage"    />
+              <el-input ref="dosage" v-model="temp.dosage" />
             </el-form-item>
           </el-col>
-         
+
           <el-col :span="8">
             <el-form-item label="单价(元):" prop="price">
-              <el-input ref="price" v-model="temp.price"   />
+              <el-input ref="price" v-model="temp.price" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="当前费用:" prop="expense">
-              <el-input ref="expense" v-model="temp.expense"   />
+              <el-input ref="expense" v-model="temp.expense" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="8">
-            <el-form-item label="记录人:" prop="inputid"   v-show="dialogStatus==='create'">
-              <el-select ref="inputid" v-model="temp.inputid " placeholder="记录人" class="filter-item" style="width:100%;"   @change="change_emp">
+            <el-form-item v-show="dialogStatus==='create'" label="记录人:" prop="inputid">
+              <el-select ref="inputid" v-model="temp.inputid " placeholder="记录人" class="filter-item" style="width:100%;" @change="change_emp">
                 <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
-            <el-form-item label="记录人:"  prop="empname"  v-show="dialogStatus==='update'" >
-              <el-input ref="empname" v-model="temp.empname"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="记录人:" prop="empname">
+              <el-input ref="empname" v-model="temp.empname" disabled />
             </el-form-item>
-           
+
           </el-col>
           <el-col :span="8">
             <el-form-item label="录入日期:" prop="date">
@@ -170,12 +166,12 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="备注:" prop="remarks">
-              <el-input ref="remarks" v-model="temp.remarks"  />
+              <el-input ref="remarks" v-model="temp.remarks" />
             </el-form-item>
           </el-col>
-          
+
         </el-row>
-         
+
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button v-if="dialogStatus==='create'" ref="createb" type="success" :disabled="isokDisable" @click="add_dialog_save_again()">保存并新增</el-button>
@@ -184,7 +180,7 @@
       </div>
     </el-dialog>
     <!-- 用量记录 -->
-    <el-dialog  title="用量记录" :visible.sync="dialogFormDosageRecord" :close-on-click-modal="false">
+    <el-dialog title="用量记录" :visible.sync="dialogFormDosageRecord" :close-on-click-modal="false">
       <div class="dosageRecord">
         <div style="position: absolute;top:20px;left:100px;font:18px/24px '' ;color:#303133;">
           <span style="margin:0 10px;">牧场:{{ dosageRecordTemp.pastureName }}</span>
@@ -209,18 +205,18 @@
               <span>{{ scope.$index + (pageNumDosageRecord-1) * pageSizeDosageRecord + 1 }}</span>
             </template>
           </el-table-column>
-  
-          <el-table-column label="用量"  prop="dosage" min-width="110px" align="center">
+
+          <el-table-column label="用量" prop="dosage" min-width="110px" align="center">
             <template slot-scope="scope">
               <span>{{ scope.row.dosage }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="单价"  prop="price" align="center" min-width="110px" >
+          <el-table-column label="单价" prop="price" align="center" min-width="110px">
             <template slot-scope="scope">
               <span>{{ scope.row.price }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="总价"   prop="expense" align="center" min-width="110px">
+          <el-table-column label="总价" prop="expense" align="center" min-width="110px">
             <template slot-scope="scope">
               <span>{{ scope.row.expense }}</span>
             </template>
@@ -235,7 +231,7 @@
               <span>{{ scope.row.date }}</span>
             </template>
           </el-table-column>
-        
+
         </el-table>
         <pagination v-show="totalDosageRecord>=0" :total="totalDosageRecord" :page.sync="getDosageRecordListParm.offset" :limit.sync="getDosageRecordListParm.pagecount" @pagination="get_record_list" />
         <div slot="footer" class="dialog-footer">
@@ -291,8 +287,7 @@ export default {
       list: null,
       total: 0,
       listLoading: true,
- 
-   
+
       requestParam: {
         name: 'insertElectricity',
         offset: 0,
@@ -310,7 +305,7 @@ export default {
         pagecount: 10,
         returntype: 'Map',
         parammaps: {
-          formName: '',  formNumber: '',   formType: '',    pastureName: Cookies.get('pasturename'),  departName: '', date: ''
+          formName: '', formNumber: '', formType: '', pastureName: Cookies.get('pasturename'), departName: '', date: ''
         }
       },
       downLoadObj: {
@@ -320,26 +315,27 @@ export default {
         pagecount: 0,
         returntype: 'Map',
         parammaps: {
-          formName: '',  formNumber: '',   formType: '',    pastureName: Cookies.get('pasturename'),  departName: '', date: ''
+          formName: '', formNumber: '', formType: '', pastureName: Cookies.get('pasturename'), departName: '', date: ''
         }
       },
-      downLoadList:[],
+      downLoadList: [],
       // 2-3:下拉框请求后数据加入[]
       useTypes: [{ id: 0, name: '1级表' }, { id: 1, name: '2级表' }, { id: 2, name: '3级表' }],
       getDictByName: [],
       findAllAssetType: [],
-     
- 
+
       pastureList: [],
-      departList1:[],
-      departList2:[],
+      departList1: [],
+      departList2: [],
       findAllEmploye: [],
       // 2-1.请求下拉框接口
       requestParams: [
         { name: 'getDictByName', offset: 0, pagecount: 0, params: ['电表类型'] },
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
+
       ],
       getDepartParam1: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -356,7 +352,7 @@ export default {
         parammaps: { }
       },
 
-      temp: { 
+      temp: {
         pastureName: '',
         departName: '',
         dosage: '',
@@ -387,7 +383,7 @@ export default {
         offset: 1,
         pagecount: 10,
         returntype: 'Map',
-        parammaps: { "departmentId": ""}
+        parammaps: { 'departmentId': '' }
       },
       dosageRecordTemp: {},
       // 校验规则
@@ -416,13 +412,12 @@ export default {
         dosage: [{ required: true, message: '必填', trigger: 'blur' }],
         price: [{ required: true, message: '必填', trigger: 'blur' }],
         departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
-        expense: [{ required: true, message: '必填', trigger: 'blur' }],
-       
-         
+        expense: [{ required: true, message: '必填', trigger: 'blur' }]
+
       },
 
       rules2: { },
-    
+
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       buttons: [],
@@ -506,7 +501,7 @@ export default {
         }
       }, 0)
     },
-   
+
     form_export() {
       this.downLoadObj.parammaps = this.tableObj.parammaps
       GetDataByName(this.downLoadObj).then(response => {
@@ -519,9 +514,9 @@ export default {
         var excelDatasTabChart1 = [
           {
             tHeader: [
-               '牧场', '部门', '当天生物质颗粒用量', '单价', '当天费用', '记录人', '日期', '备注'
+              '牧场', '部门', '当天生物质颗粒用量', '单价', '当天费用', '记录人', '日期', '备注'
             ],
-            filterVal: ['pastureName', 'departmentName','dosage','price','expense','empname','date','remarks'  ],
+            filterVal: ['pastureName', 'departmentName', 'dosage', 'price', 'expense', 'empname', 'date', 'remarks'],
             tableDatas: this.downLoadList,
             sheetName: '生物质颗粒用量'
           }
@@ -530,9 +525,6 @@ export default {
       })
     },
 
-
-    
-
     formatJson(filterVal, jsonData) {
       return jsonData.map(v =>
         filterVal.map(j => {
@@ -561,10 +553,10 @@ export default {
            import('@/vendor/Export2Excel').then(excel => {
              const list1 = res.data.result
              const tHeader = [
-             '牧场', '部门', '当天生物质颗粒用量', '单价', '当天费用', '记录人', '日期', '备注', '错误信息'
+               '牧场', '部门', '当天生物质颗粒用量', '单价', '当天费用', '记录人', '日期', '备注', '错误信息'
              ]
              const filterVal = [
-             '牧场', '部门', '当天生物质颗粒用量', '单价', '当天费用', '记录人', '日期', '备注', 'error_msg'
+               '牧场', '部门', '当天生物质颗粒用量', '单价', '当天费用', '记录人', '日期', '备注', 'error_msg'
              ]
              const data1 = this.formatJson(filterVal, list1)
              excel.export_json_to_excel({ header: tHeader, data: data1, filename: '导入报错信息', autoWidth: true, bookType: 'xlsx' })
@@ -574,20 +566,17 @@ export default {
         this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
       }
     },
-   
-  
-   
-  
+
     // 1-1: table&搜索
     get_table_data() {
-      if(this.tableObj.parammaps.pastureName == '现代牧业'){
-        this.tableObj.parammaps.pastureName =''
+      if (this.tableObj.parammaps.pastureName == '现代牧业') {
+        this.tableObj.parammaps.pastureName = ''
       }
       this.listLoading = true
       GetDataByName(this.tableObj).then(response => {
         if (response.data.list == null) {
           this.list = []
-           this.total = 0
+          this.total = 0
         } else {
           this.list = response.data.list
           this.pageNum = response.data.pageNum
@@ -606,13 +595,13 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.pastureList = response.data.findAllPasture.list
+        this.pastureList = response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.get_departList1()
         this.get_departList2()
       })
     },
-    
+
     change_pasture1(item) {
       this.getDepartParam1.parammaps.pastureId = this.pastureList.find(obj => obj.name == item).id
       this.tableObj.parammaps.departName = ''
@@ -624,7 +613,6 @@ export default {
       })
     },
 
-
     change_pasture2(item) {
       this.getDepartParam2.parammaps.pastureId = item
       this.temp.departmentId = ''
@@ -639,25 +627,20 @@ export default {
     form_search() {
       this.listLoading = true
       this.tableObj.offset = 1
-      if(this.tableObj.parammaps.date == null){
-        this.tableObj.parammaps.date =''
+      if (this.tableObj.parammaps.date == null) {
+        this.tableObj.parammaps.date = ''
       }
 
-    
       this.get_table_data()
     },
 
-
-    change_emp(item){
+    change_emp(item) {
       console.log('记录人', item)
       this.$set(this.temp, 'inputid', item)
       this.$forceUpdate()
     },
-   
-    form_reset() {
-
-    
 
+    form_reset() {
       this.temp.pastureName = ''
       this.temp.departName = ''
       this.temp.dosage = ''
@@ -669,40 +652,33 @@ export default {
       this.temp.inputid = this.$store.state.user.employeid
       this.temp.departmentId = ''
       this.temp.pastureId = ''
-
-
-      
     },
     form_add() {
       this.form_reset()
       this.dialogStatus = 'create'
       this.dialogFormVisible = true
-       
+
       this.$nextTick(() => {
         this.$refs['temp'].clearValidate()
       })
- 
     },
-   
-    
+
     add_dialog_save() {
-      console.log("this.temp=====>",this.temp)
+      console.log('this.temp=====>', this.temp)
       this.isokDisable = true
       setTimeout(() => {
         this.isokDisable = false
       }, 1000)
       this.$refs['temp'].validate(valid => {
         if (valid) {
-
           var send_data = {
-              "name": "insertBiomass",
-              "offset": 0,
-              "pagecount": 0,
-              "parammaps": this.temp
+            'name': 'insertBiomass',
+            'offset': 0,
+            'pagecount': 0,
+            'parammaps': this.temp
           }
-          
+
           PostDataByName(send_data).then(response => {
-  
             if (response.msg === 'fail') {
               this.$notify({
                 title: '保存失败',
@@ -733,12 +709,12 @@ export default {
       this.$refs['temp'].validate(valid => {
         if (valid) {
           var send_data = {
-              "name": "insertBiomass",
-              "offset": 0,
-              "pagecount": 0,
-              "parammaps": this.temp
+            'name': 'insertBiomass',
+            'offset': 0,
+            'pagecount': 0,
+            'parammaps': this.temp
           }
-          
+
           PostDataByName(send_data).then(response => {
             console.log('保存发送参数', this.postDataPramas)
             if (response.msg === 'fail') {
@@ -762,8 +738,7 @@ export default {
       })
     },
     form_edit(row) {
-
-      console.log("row=======",row)
+      console.log('row=======', row)
       this.temp = Object.assign({}, row) // copy obj
       this.dialogStatus = 'update'
       this.dialogFormVisible = true
@@ -774,14 +749,13 @@ export default {
     edit_dialog_save() {
       this.$refs['temp'].validate(valid => {
         if (valid) {
-           
           var send_data = {
-              "name": "updateBiomass",
-              "offset": 0,
-              "pagecount": 0,
-              "parammaps": this.temp
+            'name': 'updateBiomass',
+            'offset': 0,
+            'pagecount': 0,
+            'parammaps': this.temp
           }
-          
+
           PostDataByName(send_data).then(response => {
             if (response.msg === 'fail') {
               this.$notify({
@@ -812,10 +786,9 @@ export default {
     form_delete_sure() {
       this.$refs['deleteTemp'].validate(valid => {
         if (valid) {
-    
           var send_data = {
-            "name":"delBiomass","offset":0,"pagecount":0,
-            "parammaps":{"date":this.deleteTemp.startTime}
+            'name': 'delBiomass', 'offset': 0, 'pagecount': 0,
+            'parammaps': { 'date': this.deleteTemp.startTime }
           }
           PostDataByName(send_data).then(response => {
             if (response.msg == 'fail') {
@@ -833,7 +806,7 @@ export default {
       this.dialogStatus = 'DosageRecord'
       this.dialogFormDosageRecord = true
       this.dosageRecordTemp = Object(row, {})
-      console.log("row=========see_record",row)
+      console.log('row=========see_record', row)
       this.get_record_list()
     },
     get_record_list() {

+ 12 - 13
src/views/cost/budget/index.vue

@@ -36,8 +36,8 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
-      @sort-change="tableSort"
       :max-height="myHeight"
+      @sort-change="tableSort"
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
@@ -123,7 +123,7 @@
               <el-input ref="monthBudget" v-model="createTemp.monthBudget" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
-          <el-col :span="8" v-if="createTemp.feeType !== '饲养头数月预算'">
+          <el-col v-if="createTemp.feeType !== '饲养头数月预算'" :span="8">
             <el-form-item prop="monthLimit">
               <span slot="label">{{ createTemp.unit2 }}</span>
               <el-input ref="monthLimit" v-model="createTemp.monthLimit" :disabled="dialogStatus==='see'" />
@@ -163,7 +163,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       // 校验规则
       rules: {
         pastureId: [{ required: true, message: '必填', trigger: 'blur' }],
@@ -228,7 +228,8 @@ export default {
       createDepartList: [],
       requestParams: [
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['其它成本'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['其它成本'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
         // { name: 'findAllDepart', offset: 0, pagecount: 0, params: [Cookies.get('pastureid')] }
       ],
       getDepartParam: {
@@ -302,7 +303,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         // this.findAllDepart = response.data.findAllDepart.list
         this.getDepartDownList()
         this.get_table_data()
@@ -401,10 +402,10 @@ export default {
         if (valid) {
           this.requestParam.name = 'insertMonthbudget'
           this.createTemp.cowSumBudgetMonth = parseInt(this.createTemp.cowSumBudgetMonth)
-          if(this.createTemp.feeType == '饲养头数月预算'){
+          if (this.createTemp.feeType == '饲养头数月预算') {
             this.createTemp.monthLimit = 0
           }
-          if(this.createTemp.monthLimit == ''){
+          if (this.createTemp.monthLimit == '') {
             this.createTemp.monthLimit = 0
           }
           this.requestParam.parammaps = this.createTemp
@@ -441,10 +442,10 @@ export default {
         if (valid) {
           this.requestParam.name = 'insertMonthbudget'
           this.createTemp.cowSumBudgetMonth = parseInt(this.createTemp.cowSumBudgetMonth)
-          if(this.createTemp.feeType == '饲养头数月预算'){
+          if (this.createTemp.feeType == '饲养头数月预算') {
             this.createTemp.monthLimit = 0
           }
-          if(this.createTemp.monthLimit == ''){
+          if (this.createTemp.monthLimit == '') {
             this.createTemp.monthLimit = 0
           }
           this.requestParam.parammaps = this.createTemp
@@ -489,10 +490,10 @@ export default {
         if (valid) {
           this.requestParam.name = 'updateMonthbudget'
           this.createTemp.cowSumBudgetMonth = parseInt(this.createTemp.cowSumBudgetMonth)
-          if(this.createTemp.feeType == '饲养头数月预算'){
+          if (this.createTemp.feeType == '饲养头数月预算') {
             this.createTemp.monthLimit = 0
           }
-          if(this.createTemp.monthLimit == ''){
+          if (this.createTemp.monthLimit == '') {
             this.createTemp.monthLimit = 0
           }
           this.requestParam.parammaps = this.createTemp
@@ -638,12 +639,10 @@ export default {
               this.$set(response.data.list[i], 'monthBudget', response.data.list[i].monthBudget)
               this.$set(response.data.list[i], 'monthLimit', response.data.list[i].monthLimit)
             } else {
-
               if (this.getDictByName.find(obj => obj.label == response.data.list[i].feeType).value !== '万元') {
                 this.$set(response.data.list[i], 'monthBudget', response.data.list[i].monthBudget + '(' + this.getDictByName.find(obj => obj.label == response.data.list[i].feeType).value + ')')
               }
 
-
               this.$set(response.data.list[i], 'monthLimit', response.data.list[i].monthLimit + '(' + this.getDictByName.find(obj => obj.label == response.data.list[i].feeType).value + ')')
             }
           }

+ 92 - 120
src/views/cost/coalConsum/index.vue

@@ -40,19 +40,18 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
- 
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
           <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="牧场"  min-width="110px" align="center">
+      <el-table-column label="牧场" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.pastureName }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="部门"  min-width="110px" align="center">
+      <el-table-column label="部门" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.departmentName }}</span>
         </template>
@@ -62,31 +61,31 @@
           <span>{{ scope.row.dosage }}</span>
         </template>
       </el-table-column>
- 
-      <el-table-column label="单价"  min-width="110px" align="center">
+
+      <el-table-column label="单价" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.price }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="当天费用"  min-width="110px"align="center">
+      <el-table-column label="当天费用" min-width="110px"align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.expense  }}</span>
+          <span>{{ scope.row.expense }}</span>
         </template>
       </el-table-column>
       <el-table-column label="记录人" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.empname   }}</span>
+          <span>{{ scope.row.empname }}</span>
         </template>
       </el-table-column>
       <el-table-column label="日期" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.date  }}</span>
+          <span>{{ scope.row.date }}</span>
         </template>
       </el-table-column>
- 
+
       <el-table-column label="备注" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.remarks  }}</span>
+          <span>{{ scope.row.remarks }}</span>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
@@ -101,67 +100,64 @@
     <!-- 弹出层新增or修改 -->
     <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
       <el-form ref="temp" :rules="rules1" :model="temp" label-position="right" label-width="110px">
-        
+
         <el-row>
-           
+
           <el-col :span="8">
 
-            <el-form-item label="牧场:" prop="pastureId" v-show="dialogStatus==='create'">
-                <el-select v-model="temp.pastureId" placeholder="牧场"   class="filter-item" @change="change_pasture2" style="width:100%">
-                  <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
+            <el-form-item v-show="dialogStatus==='create'" label="牧场:" prop="pastureId">
+              <el-select v-model="temp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" @change="change_pasture2">
+                <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
 
-            <el-form-item label="牧场:" prop="pastureId" v-show="dialogStatus==='update'">
-                <el-input ref="pastureName" v-model="temp.pastureName"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="牧场:" prop="pastureId">
+              <el-input ref="pastureName" v-model="temp.pastureName" disabled />
             </el-form-item>
 
-
           </el-col>
           <el-col :span="8">
-            <el-form-item label="部门:"  prop="departmentId"  v-show="dialogStatus==='create'">
+            <el-form-item v-show="dialogStatus==='create'" label="部门:" prop="departmentId">
               <el-select v-model="temp.departmentId" clearable placeholder="部门" class="filter-item" style="width:100%">
                 <el-option v-for="item in departList2" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
-            <el-form-item label="部门:"  prop="departmentId"  v-show="dialogStatus==='update'">
-                <el-input ref="departmentName" v-model="temp.departmentName"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="部门:" prop="departmentId">
+              <el-input ref="departmentName" v-model="temp.departmentName" disabled />
             </el-form-item>
-    
+
           </el-col>
- 
 
-           
         </el-row>
         <el-row>
           <el-col :span="8">
             <el-form-item label="当前煤炭用量:" prop="dosage">
-              <el-input ref="dosage" v-model="temp.dosage"    />
+              <el-input ref="dosage" v-model="temp.dosage" />
             </el-form-item>
           </el-col>
-         
+
           <el-col :span="8">
             <el-form-item label="单价(元):" prop="price">
-              <el-input ref="price" v-model="temp.price"   />
+              <el-input ref="price" v-model="temp.price" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="当前费用:" prop="expense">
-              <el-input ref="expense" v-model="temp.expense"   />
+              <el-input ref="expense" v-model="temp.expense" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="8">
-            <el-form-item label="记录人:" prop="inputid"   v-show="dialogStatus==='create'">
-              <el-select ref="inputid" v-model="temp.inputid " placeholder="记录人" class="filter-item" style="width:100%;"   @change="change_emp">
+            <el-form-item v-show="dialogStatus==='create'" label="记录人:" prop="inputid">
+              <el-select ref="inputid" v-model="temp.inputid " placeholder="记录人" class="filter-item" style="width:100%;" @change="change_emp">
                 <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
-            <el-form-item label="记录人:"  prop="empname"  v-show="dialogStatus==='update'" >
-              <el-input ref="empname" v-model="temp.empname"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="记录人:" prop="empname">
+              <el-input ref="empname" v-model="temp.empname" disabled />
             </el-form-item>
-           
+
           </el-col>
           <el-col :span="8">
             <el-form-item label="录入日期:" prop="date">
@@ -170,12 +166,12 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="备注:" prop="remarks">
-              <el-input ref="remarks" v-model="temp.remarks"  />
+              <el-input ref="remarks" v-model="temp.remarks" />
             </el-form-item>
           </el-col>
-          
+
         </el-row>
-         
+
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button v-if="dialogStatus==='create'" ref="createb" type="success" :disabled="isokDisable" @click="add_dialog_save_again()">保存并新增</el-button>
@@ -184,7 +180,7 @@
       </div>
     </el-dialog>
     <!-- 用量记录 -->
-    <el-dialog  title="用量记录" :visible.sync="dialogFormDosageRecord" :close-on-click-modal="false">
+    <el-dialog title="用量记录" :visible.sync="dialogFormDosageRecord" :close-on-click-modal="false">
       <div class="dosageRecord">
         <div style="position: absolute;top:20px;left:100px;font:18px/24px '' ;color:#303133;">
           <span style="margin:0 10px;">牧场:{{ dosageRecordTemp.pastureName }}</span>
@@ -209,18 +205,18 @@
               <span>{{ scope.$index + (pageNumDosageRecord-1) * pageSizeDosageRecord + 1 }}</span>
             </template>
           </el-table-column>
-  
-          <el-table-column label="用量"  prop="dosage" min-width="110px" align="center">
+
+          <el-table-column label="用量" prop="dosage" min-width="110px" align="center">
             <template slot-scope="scope">
               <span>{{ scope.row.dosage }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="单价"  prop="price" align="center" min-width="110px" >
+          <el-table-column label="单价" prop="price" align="center" min-width="110px">
             <template slot-scope="scope">
               <span>{{ scope.row.price }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="总价"   prop="expense" align="center" min-width="110px">
+          <el-table-column label="总价" prop="expense" align="center" min-width="110px">
             <template slot-scope="scope">
               <span>{{ scope.row.expense }}</span>
             </template>
@@ -235,7 +231,7 @@
               <span>{{ scope.row.date }}</span>
             </template>
           </el-table-column>
-        
+
         </el-table>
         <pagination v-show="totalDosageRecord>=0" :total="totalDosageRecord" :page.sync="getDosageRecordListParm.offset" :limit.sync="getDosageRecordListParm.pagecount" @pagination="get_record_list" />
         <div slot="footer" class="dialog-footer">
@@ -291,8 +287,7 @@ export default {
       list: null,
       total: 0,
       listLoading: true,
- 
-   
+
       requestParam: {
         name: 'insertElectricity',
         offset: 0,
@@ -310,7 +305,7 @@ export default {
         pagecount: 10,
         returntype: 'Map',
         parammaps: {
-          formName: '',  formNumber: '',   formType: '',    pastureName: Cookies.get('pasturename'),  departName: '', date: ''
+          formName: '', formNumber: '', formType: '', pastureName: Cookies.get('pasturename'), departName: '', date: ''
         }
       },
       downLoadObj: {
@@ -320,26 +315,26 @@ export default {
         pagecount: 0,
         returntype: 'Map',
         parammaps: {
-          formName: '',  formNumber: '',   formType: '',    pastureName: Cookies.get('pasturename'),  departName: '', date: ''
+          formName: '', formNumber: '', formType: '', pastureName: Cookies.get('pasturename'), departName: '', date: ''
         }
       },
-      downLoadList:[],
+      downLoadList: [],
       // 2-3:下拉框请求后数据加入[]
       useTypes: [{ id: 0, name: '1级表' }, { id: 1, name: '2级表' }, { id: 2, name: '3级表' }],
       getDictByName: [],
       findAllAssetType: [],
-     
- 
+
       pastureList: [],
-      departList1:[],
-      departList2:[],
+      departList1: [],
+      departList2: [],
       findAllEmploye: [],
       // 2-1.请求下拉框接口
       requestParams: [
         { name: 'getDictByName', offset: 0, pagecount: 0, params: ['电表类型'] },
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam1: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -356,7 +351,7 @@ export default {
         parammaps: { }
       },
 
-      temp: { 
+      temp: {
         pastureName: '',
         departName: '',
         dosage: '',
@@ -387,7 +382,7 @@ export default {
         offset: 1,
         pagecount: 10,
         returntype: 'Map',
-        parammaps: { "departmentId": ""}
+        parammaps: { 'departmentId': '' }
       },
       dosageRecordTemp: {},
       // 校验规则
@@ -411,19 +406,18 @@ export default {
         //     }
         //   }, 0)
         // }, trigger: 'blur' }],
-      
+
         pastureId: [{ required: true, message: '必填', trigger: 'blur' }],
         departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
         dosage: [{ required: true, message: '必填', trigger: 'blur' }],
         price: [{ required: true, message: '必填', trigger: 'blur' }],
         departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
-        expense: [{ required: true, message: '必填', trigger: 'blur' }],
-       
-         
+        expense: [{ required: true, message: '必填', trigger: 'blur' }]
+
       },
 
       rules2: { },
-    
+
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       buttons: [],
@@ -507,7 +501,7 @@ export default {
         }
       }, 0)
     },
-   
+
     form_export() {
       this.downLoadObj.parammaps = this.tableObj.parammaps
       GetDataByName(this.downLoadObj).then(response => {
@@ -520,9 +514,9 @@ export default {
         var excelDatasTabChart1 = [
           {
             tHeader: [
-               '牧场', '部门', '当天煤炭用量', '单价', '当天费用', '记录人', '日期', '备注'
+              '牧场', '部门', '当天煤炭用量', '单价', '当天费用', '记录人', '日期', '备注'
             ],
-            filterVal: ['pastureName', 'departmentName','dosage','price','expense','empname','date','remarks'  ],
+            filterVal: ['pastureName', 'departmentName', 'dosage', 'price', 'expense', 'empname', 'date', 'remarks'],
             tableDatas: this.downLoadList,
             sheetName: '煤炭用量'
           }
@@ -531,9 +525,6 @@ export default {
       })
     },
 
-
-    
-
     formatJson(filterVal, jsonData) {
       return jsonData.map(v =>
         filterVal.map(j => {
@@ -562,10 +553,10 @@ export default {
            import('@/vendor/Export2Excel').then(excel => {
              const list1 = res.data.result
              const tHeader = [
-             '牧场', '部门', '当天煤炭用量', '单价', '当天费用', '记录人', '日期', '备注', '错误信息'
+               '牧场', '部门', '当天煤炭用量', '单价', '当天费用', '记录人', '日期', '备注', '错误信息'
              ]
              const filterVal = [
-             '牧场', '部门', '当天煤炭用量', '单价', '当天费用', '记录人', '日期', '备注', 'error_msg'
+               '牧场', '部门', '当天煤炭用量', '单价', '当天费用', '记录人', '日期', '备注', 'error_msg'
              ]
              const data1 = this.formatJson(filterVal, list1)
              excel.export_json_to_excel({ header: tHeader, data: data1, filename: '导入报错信息', autoWidth: true, bookType: 'xlsx' })
@@ -575,20 +566,17 @@ export default {
         this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
       }
     },
-   
-  
-   
-  
+
     // 1-1: table&搜索
     get_table_data() {
-      if(this.tableObj.parammaps.pastureName == '现代牧业'){
-        this.tableObj.parammaps.pastureName =''
+      if (this.tableObj.parammaps.pastureName == '现代牧业') {
+        this.tableObj.parammaps.pastureName = ''
       }
       this.listLoading = true
       GetDataByName(this.tableObj).then(response => {
         if (response.data.list == null) {
           this.list = []
-           this.total = 0
+          this.total = 0
         } else {
           this.list = response.data.list
           this.pageNum = response.data.pageNum
@@ -607,13 +595,13 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.pastureList = response.data.findAllPasture.list
+        this.pastureList = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.get_departList1()
         this.get_departList2()
       })
     },
-    
+
     change_pasture1(item) {
       this.getDepartParam1.parammaps.pastureId = this.pastureList.find(obj => obj.name == item).id
       this.tableObj.parammaps.departName = ''
@@ -625,7 +613,6 @@ export default {
       })
     },
 
-
     change_pasture2(item) {
       this.getDepartParam2.parammaps.pastureId = item
       this.temp.departmentId = ''
@@ -640,25 +627,20 @@ export default {
     form_search() {
       this.listLoading = true
       this.tableObj.offset = 1
-      if(this.tableObj.parammaps.date == null){
-        this.tableObj.parammaps.date =''
+      if (this.tableObj.parammaps.date == null) {
+        this.tableObj.parammaps.date = ''
       }
 
-    
       this.get_table_data()
     },
 
-
-    change_emp(item){
+    change_emp(item) {
       console.log('记录人', item)
       this.$set(this.temp, 'inputid', item)
       this.$forceUpdate()
     },
-   
-    form_reset() {
-
-    
 
+    form_reset() {
       this.temp.pastureName = ''
       this.temp.departName = ''
       this.temp.dosage = ''
@@ -670,40 +652,33 @@ export default {
       this.temp.inputid = this.$store.state.user.employeid
       this.temp.departmentId = ''
       this.temp.pastureId = ''
-
-
-      
     },
     form_add() {
       this.form_reset()
       this.dialogStatus = 'create'
       this.dialogFormVisible = true
-       
+
       this.$nextTick(() => {
         this.$refs['temp'].clearValidate()
       })
- 
     },
-   
-    
+
     add_dialog_save() {
-      console.log("this.temp=====>",this.temp)
+      console.log('this.temp=====>', this.temp)
       this.isokDisable = true
       setTimeout(() => {
         this.isokDisable = false
       }, 1000)
       this.$refs['temp'].validate(valid => {
         if (valid) {
-
           var send_data = {
-              "name": "insertCoal",
-              "offset": 0,
-              "pagecount": 0,
-              "parammaps": this.temp
+            'name': 'insertCoal',
+            'offset': 0,
+            'pagecount': 0,
+            'parammaps': this.temp
           }
-          
+
           PostDataByName(send_data).then(response => {
-  
             if (response.msg === 'fail') {
               this.$notify({
                 title: '保存失败',
@@ -734,12 +709,12 @@ export default {
       this.$refs['temp'].validate(valid => {
         if (valid) {
           var send_data = {
-              "name": "insertCoal",
-              "offset": 0,
-              "pagecount": 0,
-              "parammaps": this.temp
+            'name': 'insertCoal',
+            'offset': 0,
+            'pagecount': 0,
+            'parammaps': this.temp
           }
-          
+
           PostDataByName(send_data).then(response => {
             console.log('保存发送参数', this.postDataPramas)
             if (response.msg === 'fail') {
@@ -763,8 +738,7 @@ export default {
       })
     },
     form_edit(row) {
-
-      console.log("row=======",row)
+      console.log('row=======', row)
       this.temp = Object.assign({}, row) // copy obj
       this.dialogStatus = 'update'
       this.dialogFormVisible = true
@@ -775,14 +749,13 @@ export default {
     edit_dialog_save() {
       this.$refs['temp'].validate(valid => {
         if (valid) {
-           
           var send_data = {
-              "name": "updateCoal",
-              "offset": 0,
-              "pagecount": 0,
-              "parammaps": this.temp
+            'name': 'updateCoal',
+            'offset': 0,
+            'pagecount': 0,
+            'parammaps': this.temp
           }
-          
+
           PostDataByName(send_data).then(response => {
             if (response.msg === 'fail') {
               this.$notify({
@@ -813,10 +786,9 @@ export default {
     form_delete_sure() {
       this.$refs['deleteTemp'].validate(valid => {
         if (valid) {
-    
           var send_data = {
-            "name":"delCoal","offset":0,"pagecount":0,
-            "parammaps":{"date":this.deleteTemp.startTime}
+            'name': 'delCoal', 'offset': 0, 'pagecount': 0,
+            'parammaps': { 'date': this.deleteTemp.startTime }
           }
           PostDataByName(send_data).then(response => {
             if (response.msg == 'fail') {
@@ -834,7 +806,7 @@ export default {
       this.dialogStatus = 'DosageRecord'
       this.dialogFormDosageRecord = true
       this.dosageRecordTemp = Object(row, {})
-      console.log("row=========see_record",row)
+      console.log('row=========see_record', row)
       this.get_record_list()
     },
     get_record_list() {

+ 91 - 118
src/views/cost/coalConsum/index1.vue

@@ -40,19 +40,18 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
- 
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
           <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="牧场"  min-width="110px" align="center">
+      <el-table-column label="牧场" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.pastureName }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="部门"  min-width="110px" align="center">
+      <el-table-column label="部门" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.departmentName }}</span>
         </template>
@@ -62,31 +61,31 @@
           <span>{{ scope.row.dosage }}</span>
         </template>
       </el-table-column>
- 
-      <el-table-column label="单价"  min-width="110px" align="center">
+
+      <el-table-column label="单价" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.price }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="当天费用"  min-width="110px"align="center">
+      <el-table-column label="当天费用" min-width="110px"align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.expense  }}</span>
+          <span>{{ scope.row.expense }}</span>
         </template>
       </el-table-column>
       <el-table-column label="记录人" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.empname   }}</span>
+          <span>{{ scope.row.empname }}</span>
         </template>
       </el-table-column>
       <el-table-column label="日期" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.date  }}</span>
+          <span>{{ scope.row.date }}</span>
         </template>
       </el-table-column>
- 
+
       <el-table-column label="备注" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.remarks  }}</span>
+          <span>{{ scope.row.remarks }}</span>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
@@ -101,67 +100,64 @@
     <!-- 弹出层新增or修改 -->
     <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
       <el-form ref="temp" :rules="rules" :model="temp" label-position="right" label-width="110px">
-        
+
         <el-row>
-           
+
           <el-col :span="8">
 
-            <el-form-item label="牧场:" prop="pastureId" v-show="dialogStatus==='create'">
-                <el-select v-model="temp.pastureId" placeholder="牧场"   class="filter-item" @change="change_pasture2" style="width:100%">
-                  <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
+            <el-form-item v-show="dialogStatus==='create'" label="牧场:" prop="pastureId">
+              <el-select v-model="temp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" @change="change_pasture2">
+                <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
 
-            <el-form-item label="牧场:" prop="pastureId" v-show="dialogStatus==='update'">
-                <el-input ref="pastureName" v-model="temp.pastureName"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="牧场:" prop="pastureId">
+              <el-input ref="pastureName" v-model="temp.pastureName" disabled />
             </el-form-item>
 
-
           </el-col>
           <el-col :span="8">
-            <el-form-item label="部门:"  prop="departmentId"  v-show="dialogStatus==='create'">
+            <el-form-item v-show="dialogStatus==='create'" label="部门:" prop="departmentId">
               <el-select v-model="temp.departmentId" clearable placeholder="部门" class="filter-item" style="width:100%">
                 <el-option v-for="item in departList2" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
-            <el-form-item label="部门:"  prop="departmentId"  v-show="dialogStatus==='update'">
-                <el-input ref="departmentName" v-model="temp.departmentName"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="部门:" prop="departmentId">
+              <el-input ref="departmentName" v-model="temp.departmentName" disabled />
             </el-form-item>
-    
+
           </el-col>
- 
 
-           
         </el-row>
         <el-row>
           <el-col :span="8">
             <el-form-item label="当前煤炭用量:" prop="dosage">
-              <el-input ref="dosage" v-model="temp.dosage"    />
+              <el-input ref="dosage" v-model="temp.dosage" />
             </el-form-item>
           </el-col>
-         
+
           <el-col :span="8">
             <el-form-item label="单价(元):" prop="price">
-              <el-input ref="price" v-model="temp.price"   />
+              <el-input ref="price" v-model="temp.price" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="当前费用:" prop="expense">
-              <el-input ref="expense" v-model="temp.expense"   />
+              <el-input ref="expense" v-model="temp.expense" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="8">
-            <el-form-item label="记录人:" prop="inputid"   v-show="dialogStatus==='create'">
-              <el-select ref="inputid" v-model="temp.inputid " placeholder="记录人" class="filter-item" style="width:100%;"   @change="change_emp">
+            <el-form-item v-show="dialogStatus==='create'" label="记录人:" prop="inputid">
+              <el-select ref="inputid" v-model="temp.inputid " placeholder="记录人" class="filter-item" style="width:100%;" @change="change_emp">
                 <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
-            <el-form-item label="记录人:"  prop="empname"  v-show="dialogStatus==='update'" >
-              <el-input ref="empname" v-model="temp.empname"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="记录人:" prop="empname">
+              <el-input ref="empname" v-model="temp.empname" disabled />
             </el-form-item>
-           
+
           </el-col>
           <el-col :span="8">
             <el-form-item label="录入日期:" prop="date">
@@ -170,12 +166,12 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="备注:" prop="remarks">
-              <el-input ref="remarks" v-model="temp.remarks"  />
+              <el-input ref="remarks" v-model="temp.remarks" />
             </el-form-item>
           </el-col>
-          
+
         </el-row>
-         
+
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button v-if="dialogStatus==='create'" ref="createb" type="success" :disabled="isokDisable" @click="add_dialog_save_again()">保存并新增</el-button>
@@ -184,9 +180,9 @@
       </div>
     </el-dialog>
     <!-- 用量记录 -->
-    <el-dialog  title="用量记录" :visible.sync="dialogFormDosageRecord" :close-on-click-modal="false">
+    <el-dialog title="用量记录" :visible.sync="dialogFormDosageRecord" :close-on-click-modal="false">
       <div class="dosageRecord">
-        
+
         <el-table
           :key="tableKey"
           v-loading="listLoadingDosageRecord"
@@ -206,18 +202,18 @@
               <span>{{ scope.$index + (pageNumDosageRecord-1) * pageSizeDosageRecord + 1 }}</span>
             </template>
           </el-table-column>
-  
-          <el-table-column label="用量"  prop="dosage" min-width="110px" align="center">
+
+          <el-table-column label="用量" prop="dosage" min-width="110px" align="center">
             <template slot-scope="scope">
               <span>{{ scope.row.dosage }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="单价"  prop="price" align="center" min-width="110px" >
+          <el-table-column label="单价" prop="price" align="center" min-width="110px">
             <template slot-scope="scope">
               <span>{{ scope.row.price }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="总价"   prop="expense" align="center" min-width="110px">
+          <el-table-column label="总价" prop="expense" align="center" min-width="110px">
             <template slot-scope="scope">
               <span>{{ scope.row.expense }}</span>
             </template>
@@ -232,7 +228,7 @@
               <span>{{ scope.row.date }}</span>
             </template>
           </el-table-column>
-        
+
         </el-table>
         <pagination v-show="totalDosageRecord>=0" :total="totalDosageRecord" :page.sync="getDosageRecordListParm.offset" :limit.sync="getDosageRecordListParm.pagecount" @pagination="get_record_list" />
         <div slot="footer" class="dialog-footer">
@@ -288,8 +284,7 @@ export default {
       list: null,
       total: 0,
       listLoading: true,
- 
-   
+
       requestParam: {
         name: 'insertElectricity',
         offset: 0,
@@ -307,7 +302,7 @@ export default {
         pagecount: 10,
         returntype: 'Map',
         parammaps: {
-          formName: '',  formNumber: '',   formType: '',    pastureName: Cookies.get('pasturename'),  departName: '', date: ''
+          formName: '', formNumber: '', formType: '', pastureName: Cookies.get('pasturename'), departName: '', date: ''
         }
       },
       downLoadObj: {
@@ -317,26 +312,26 @@ export default {
         pagecount: 0,
         returntype: 'Map',
         parammaps: {
-          formName: '',  formNumber: '',   formType: '',    pastureName: Cookies.get('pasturename'),  departName: '', date: ''
+          formName: '', formNumber: '', formType: '', pastureName: Cookies.get('pasturename'), departName: '', date: ''
         }
       },
-      downLoadList:[],
+      downLoadList: [],
       // 2-3:下拉框请求后数据加入[]
       useTypes: [{ id: 0, name: '1级表' }, { id: 1, name: '2级表' }, { id: 2, name: '3级表' }],
       getDictByName: [],
       findAllAssetType: [],
-     
- 
+
       pastureList: [],
-      departList1:[],
-      departList2:[],
+      departList1: [],
+      departList2: [],
       findAllEmploye: [],
       // 2-1.请求下拉框接口
       requestParams: [
         { name: 'getDictByName', offset: 0, pagecount: 0, params: ['电表类型'] },
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam1: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -353,7 +348,7 @@ export default {
         parammaps: { }
       },
 
-      temp: { 
+      temp: {
         pastureName: '',
         departName: '',
         dosage: '',
@@ -384,7 +379,7 @@ export default {
         offset: 1,
         pagecount: 10,
         returntype: 'Map',
-        parammaps: { "departmentId": ""}
+        parammaps: { 'departmentId': '' }
       },
       dosageRecordTemp: {},
       // 校验规则
@@ -408,10 +403,10 @@ export default {
         //     }
         //   }, 0)
         // }, trigger: 'blur' }],
-      
+
         // startTime: [{ required: true, message: '必填', trigger: 'blur' }]
       },
-    
+
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       buttons: [],
@@ -495,7 +490,7 @@ export default {
         }
       }, 0)
     },
-   
+
     form_export() {
       this.downLoadObj.parammaps = this.tableObj.parammaps
       GetDataByName(this.downLoadObj).then(response => {
@@ -508,9 +503,9 @@ export default {
         var excelDatasTabChart1 = [
           {
             tHeader: [
-               '牧场', '部门', '当天煤炭用量', '单价', '当天费用', '记录人', '日期', '备注'
+              '牧场', '部门', '当天煤炭用量', '单价', '当天费用', '记录人', '日期', '备注'
             ],
-            filterVal: ['pastureName', 'departmentName','dosage','price','expense','empname','date','remarks'  ],
+            filterVal: ['pastureName', 'departmentName', 'dosage', 'price', 'expense', 'empname', 'date', 'remarks'],
             tableDatas: this.downLoadList,
             sheetName: '煤炭用量'
           }
@@ -519,9 +514,6 @@ export default {
       })
     },
 
-
-    
-
     formatJson(filterVal, jsonData) {
       return jsonData.map(v =>
         filterVal.map(j => {
@@ -550,10 +542,10 @@ export default {
            import('@/vendor/Export2Excel').then(excel => {
              const list1 = res.data.result
              const tHeader = [
-             '牧场', '部门', '当天煤炭用量', '单价', '当天费用', '记录人', '日期', '备注', '错误信息'
+               '牧场', '部门', '当天煤炭用量', '单价', '当天费用', '记录人', '日期', '备注', '错误信息'
              ]
              const filterVal = [
-             '牧场', '部门', '当天煤炭用量', '单价', '当天费用', '记录人', '日期', '备注', 'error_msg'
+               '牧场', '部门', '当天煤炭用量', '单价', '当天费用', '记录人', '日期', '备注', 'error_msg'
              ]
              const data1 = this.formatJson(filterVal, list1)
              excel.export_json_to_excel({ header: tHeader, data: data1, filename: '导入报错信息', autoWidth: true, bookType: 'xlsx' })
@@ -563,20 +555,17 @@ export default {
         this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
       }
     },
-   
-  
-   
-  
+
     // 1-1: table&搜索
     get_table_data() {
-      if(this.tableObj.parammaps.pastureName == '现代牧业'){
-        this.tableObj.parammaps.pastureName =''
+      if (this.tableObj.parammaps.pastureName == '现代牧业') {
+        this.tableObj.parammaps.pastureName = ''
       }
       this.listLoading = true
       GetDataByName(this.tableObj).then(response => {
         if (response.data.list == null) {
           this.list = []
-           this.total = 0
+          this.total = 0
         } else {
           this.list = response.data.list
           this.pageNum = response.data.pageNum
@@ -595,13 +584,13 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.pastureList = response.data.findAllPasture.list
+        this.pastureList = response.data.getPastureRoleList.list //  response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.get_departList1()
         this.get_departList2()
       })
     },
-    
+
     change_pasture1(item) {
       this.getDepartParam1.parammaps.pastureId = this.pastureList.find(obj => obj.name == item).id
       this.tableObj.parammaps.departName = ''
@@ -613,7 +602,6 @@ export default {
       })
     },
 
-
     change_pasture2(item) {
       this.getDepartParam2.parammaps.pastureId = item
       this.temp.departmentId = ''
@@ -628,25 +616,20 @@ export default {
     form_search() {
       this.listLoading = true
       this.tableObj.offset = 1
-      if(this.tableObj.parammaps.date == null){
-        this.tableObj.parammaps.date =''
+      if (this.tableObj.parammaps.date == null) {
+        this.tableObj.parammaps.date = ''
       }
 
-    
       this.get_table_data()
     },
 
-
-    change_emp(item){
+    change_emp(item) {
       console.log('记录人', item)
       this.$set(this.temp, 'inputid', item)
       this.$forceUpdate()
     },
-   
-    form_reset() {
-
-    
 
+    form_reset() {
       this.temp.pastureName = ''
       this.temp.departName = ''
       this.temp.dosage = ''
@@ -658,40 +641,33 @@ export default {
       this.temp.inputid = this.$store.state.user.employeid
       this.temp.departmentId = ''
       this.temp.pastureId = ''
-
-
-      
     },
     form_add() {
       this.form_reset()
       this.dialogStatus = 'create'
       this.dialogFormVisible = true
-       
+
       this.$nextTick(() => {
         this.$refs['temp'].clearValidate()
       })
- 
     },
-   
-    
+
     add_dialog_save() {
-      console.log("this.temp=====>",this.temp)
+      console.log('this.temp=====>', this.temp)
       this.isokDisable = true
       setTimeout(() => {
         this.isokDisable = false
       }, 1000)
       this.$refs['temp'].validate(valid => {
         if (valid) {
-
           var send_data = {
-              "name": "insertCoal",
-              "offset": 0,
-              "pagecount": 0,
-              "parammaps": this.temp
+            'name': 'insertCoal',
+            'offset': 0,
+            'pagecount': 0,
+            'parammaps': this.temp
           }
-          
+
           PostDataByName(send_data).then(response => {
-  
             if (response.msg === 'fail') {
               this.$notify({
                 title: '保存失败',
@@ -722,12 +698,12 @@ export default {
       this.$refs['temp'].validate(valid => {
         if (valid) {
           var send_data = {
-              "name": "insertCoal",
-              "offset": 0,
-              "pagecount": 0,
-              "parammaps": this.temp
+            'name': 'insertCoal',
+            'offset': 0,
+            'pagecount': 0,
+            'parammaps': this.temp
           }
-          
+
           PostDataByName(send_data).then(response => {
             console.log('保存发送参数', this.postDataPramas)
             if (response.msg === 'fail') {
@@ -751,8 +727,7 @@ export default {
       })
     },
     form_edit(row) {
-
-      console.log("row=======",row)
+      console.log('row=======', row)
       this.temp = Object.assign({}, row) // copy obj
       this.dialogStatus = 'update'
       this.dialogFormVisible = true
@@ -763,14 +738,13 @@ export default {
     edit_dialog_save() {
       this.$refs['temp'].validate(valid => {
         if (valid) {
-           
           var send_data = {
-              "name": "updateCoal",
-              "offset": 0,
-              "pagecount": 0,
-              "parammaps": this.temp
+            'name': 'updateCoal',
+            'offset': 0,
+            'pagecount': 0,
+            'parammaps': this.temp
           }
-          
+
           PostDataByName(send_data).then(response => {
             if (response.msg === 'fail') {
               this.$notify({
@@ -801,10 +775,9 @@ export default {
     form_delete_sure() {
       this.$refs['deleteTemp'].validate(valid => {
         if (valid) {
-    
           var send_data = {
-            "name":"delCoal","offset":0,"pagecount":0,
-            "parammaps":{"date":this.deleteTemp.startTime}
+            'name': 'delCoal', 'offset': 0, 'pagecount': 0,
+            'parammaps': { 'date': this.deleteTemp.startTime }
           }
           PostDataByName(send_data).then(response => {
             if (response.msg == 'fail') {
@@ -822,7 +795,7 @@ export default {
       this.dialogStatus = 'DosageRecord'
       this.dialogFormDosageRecord = true
       this.dosageRecordTemp = Object(row, {})
-      console.log("row=========see_record",row)
+      console.log('row=========see_record', row)
       this.get_record_list()
     },
     get_record_list() {

+ 55 - 54
src/views/cost/diesel/index.vue

@@ -127,9 +127,9 @@
                 :fetch-suggestions="formCardSearch"
                 placeholder="请输入内容"
                 :disabled="dialogStatus==='update'"
+                style="width: 100%;"
                 @select="handleformNameSelect"
                 @blur="blurformNameSelect"
-                style="width: 100%;"
               >
                 <template slot-scope="{ item }">
                   <div class="name" style="display: inline;">{{ item.cardCode }}</div>
@@ -138,7 +138,7 @@
 
             </el-form-item>
           </el-col>
-         <el-col :span="8">
+          <el-col :span="8">
             <el-form-item label="单价:" prop="price">
               <el-input ref="price" v-model="temp.price" />
             </el-form-item>
@@ -152,13 +152,13 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="设备名称:" prop="assetName">
-              <el-autocomplete ref="assetName" style="width: 100%;" v-model="temp.assetName" value-key="assetName" class="inline-input" :fetch-suggestions="formNameSearch" placeholder="" disabled @select="handleformNameSelect" />
+              <el-autocomplete ref="assetName" v-model="temp.assetName" style="width: 100%;" value-key="assetName" class="inline-input" :fetch-suggestions="formNameSearch" placeholder="" disabled @select="handleformNameSelect" />
             </el-form-item>
           </el-col>
 
           <el-col :span="8">
             <el-form-item label="牧场设备编号:" prop="eqCode">
-              <el-autocomplete ref="eqCode" style="width: 100%;" v-model="temp.eqCode" value-key="eqCode" class="inline-input" :fetch-suggestions="formNumberSearch" placeholder="" disabled @select="handleformNameSelect">
+              <el-autocomplete ref="eqCode" v-model="temp.eqCode" style="width: 100%;" value-key="eqCode" class="inline-input" :fetch-suggestions="formNumberSearch" placeholder="" disabled @select="handleformNameSelect">
                 <template slot-scope="{ item }">
                   <div class="name" style="display: inline;">{{ item.assetNumber }}</div>
                 </template>
@@ -167,7 +167,7 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="柴油类型:" prop="oilType">
-              <el-select style="width: 100%;" v-model="temp.oilType" placeholder="柴油类型" class="filter-item">
+              <el-select v-model="temp.oilType" style="width: 100%;" placeholder="柴油类型" class="filter-item">
                 <el-option v-for="item in dieselTypeList" :key="item.value" :label="item.label" :value="item.value" />
               </el-select>
             </el-form-item>
@@ -317,7 +317,7 @@
 <script>
 // 引入
 require('script-loader!file-saver')
-import { GetDataByName, GetDataByNames, PostDataByName,postJson, checkButtons, ExecDataByConfig, failproccess, GetAccount,getJson } from '@/api/common'
+import { GetDataByName, GetDataByNames, PostDataByName, postJson, checkButtons, ExecDataByConfig, failproccess, GetAccount, getJson } from '@/api/common'
 // import {  DownloadExcel, GetDataByNameXlsx } from '@/api/common'
 import waves from '@/directive/waves'
 import { parseTime, sortChange } from '@/utils/index.js'
@@ -365,7 +365,7 @@ export default {
           selTime: '',
           pastureName: Cookies.get('pasturename'),
           departName: '',
-          inputDatetime:''
+          inputDatetime: ''
         }
       },
       // 2-3:下拉框请求后数据加入[]
@@ -380,7 +380,8 @@ export default {
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -408,7 +409,7 @@ export default {
         eqId: '',
         eqCode: '',
         oilcardId: '',
-        oilType:''
+        oilType: ''
       },
       dialogFormVisible: false,
       dialogStatus: '',
@@ -468,7 +469,7 @@ export default {
       percentage: 1,
       dialogFormDelete: false,
       deleteTemp: {},
-      dieselTypeList:[]
+      dieselTypeList: []
     }
   },
 
@@ -485,7 +486,7 @@ export default {
         name: 'importDiesel',
         importParams: '牧场,油卡编号,设备名称,设备编号,加油日期,加油量(升),单价,录入人,加油人,加油工班,备注,柴油类型',
         sheetname: 'SheetJS',
-        pastureId:Cookies.get('pastureid')
+        pastureId: Cookies.get('pastureid')
       }
     },
     // 设置上传地址
@@ -506,9 +507,9 @@ export default {
   },
 
   methods: {
-    getDieselTypeList(){
-      let url = 'authdata/diesel/type/list'
-      let data = ''
+    getDieselTypeList() {
+      const url = 'authdata/diesel/type/list'
+      const data = ''
       getJson(url, data).then(response => {
         if (response.code == 200) {
           this.dieselTypeList = response.data.diesel_type
@@ -709,20 +710,20 @@ export default {
         }
         this.$nextTick(() => {
           import('@/vendor/Export2Excel').then(excel => {
-            let day = parseTime(new Date(), '{y}-{m}-{d}')
-            for(let i=0;i<response.data.list.length;i++){
-              this.$set(response.data.list[i], 'i', i+1)
+            const day = parseTime(new Date(), '{y}-{m}-{d}')
+            for (let i = 0; i < response.data.list.length; i++) {
+              this.$set(response.data.list[i], 'i', i + 1)
               this.$set(response.data.list[i], 'day', day)
               this.$set(response.data.list[i], 'day', day)
               this.$set(response.data.list[i], 'name', Cookies.get('employename'))
             }
             const list1 = response.data.list
-            console.log(list1,'list1')
+            console.log(list1, 'list1')
             const tHeader = [
-              '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(升)', '单价', '录入人', '加油人', '加油工班', '备注','柴油类型'
+              '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(升)', '单价', '录入人', '加油人', '加油工班', '备注', '柴油类型'
             ]
             const filterVal = [
-              'i', 'pastureName', 'cardNumber', 'assetName', 'assetNumber', 'day', '加油量(L)', '单价', 'name', '加油人', '加油工班', '备注','柴油类型'
+              'i', 'pastureName', 'cardNumber', 'assetName', 'assetNumber', 'day', '加油量(L)', '单价', 'name', '加油人', '加油工班', '备注', '柴油类型'
             ]
             const data1 = this.formatJson(filterVal, list1)
             excel.export_json_to_excel({
@@ -782,10 +783,10 @@ export default {
            import('@/vendor/Export2Excel').then(excel => {
              const list1 = res.data.result
              const tHeader = [
-               '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(L)', '单价', '录入人', '加油人', '加油工班','柴油类型', '备注', '错误信息'
+               '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(L)', '单价', '录入人', '加油人', '加油工班', '柴油类型', '备注', '错误信息'
              ]
              const filterVal = [
-               '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(L)', '单价', '录入人', '加油人', '加油工班','柴油类型', '备注', 'error_msg'
+               '编号', '牧场', '油卡编号', '设备名称', '设备编号', '加油日期', '加油量(L)', '单价', '录入人', '加油人', '加油工班', '柴油类型', '备注', 'error_msg'
              ]
              const data1 = this.formatJson(filterVal, list1)
              excel.export_json_to_excel({
@@ -796,7 +797,7 @@ export default {
                bookType: 'xlsx'
              })
            })
-        }else{
+        } else {
           this.$message({
             title: '成功',
             message: '导入成功',
@@ -844,7 +845,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDepartDownList()
       })
@@ -918,20 +919,20 @@ export default {
       }, 10000)
       this.$refs['temp'].validate(valid => {
         if (valid) {
-          if(this.temp.oilType){
+          if (this.temp.oilType) {
             var oilName = this.dieselTypeList.find(obj => obj.value == this.temp.oilType).label
           }
-          this.$set(this.temp,'oilName',oilName)
-          if(this.temp.eqId == '' || this.temp.eqId == null || this.temp.eqId == undefined){
+          this.$set(this.temp, 'oilName', oilName)
+          if (this.temp.eqId == '' || this.temp.eqId == null || this.temp.eqId == undefined) {
             this.temp.eqId = 0
-          }else{
+          } else {
             this.temp.eqId = parseFloat(this.temp.eqId)
           }
-          let url = 'authdata/diese/add'
-          let data = {
-            pastureId:this.temp.pastureId,
+          const url = 'authdata/diese/add'
+          const data = {
+            pastureId: this.temp.pastureId,
             selTime: this.temp.selTime,
-            oilClass:this.temp.oilClass,
+            oilClass: this.temp.oilClass,
             oilAmount: this.temp.oilAmount,
             eqId: this.temp.eqId,
             eqCode: this.temp.eqCode,
@@ -943,10 +944,10 @@ export default {
             price: this.temp.price,
             empId: this.temp.empId,
             inputId: this.temp.inputId,
-            oilType:this.temp.oilType,
-            oilName:this.temp.oilName,
+            oilType: this.temp.oilType,
+            oilName: this.temp.oilName
           }
-          postJson(url,data).then(response => {
+          postJson(url, data).then(response => {
           // ExecDataByConfig(this.postDataPramas).then(response => {
             if (response.msg === 'fail') {
               this.$notify({
@@ -979,20 +980,20 @@ export default {
 
       this.$refs['temp'].validate(valid => {
         if (valid) {
-          if(this.temp.oilType){
+          if (this.temp.oilType) {
             var oilName = this.dieselTypeList.find(obj => obj.value == this.temp.oilType).label
           }
-          this.$set(this.temp,'oilName',oilName)
-          if(this.temp.eqId == '' || this.temp.eqId == null || this.temp.eqId == undefined){
+          this.$set(this.temp, 'oilName', oilName)
+          if (this.temp.eqId == '' || this.temp.eqId == null || this.temp.eqId == undefined) {
             this.temp.eqId = 0
-          }else{
+          } else {
             this.temp.eqId = parseFloat(this.temp.eqId)
           }
-          let url = 'authdata/diese/add'
-          let data = {
-            pastureId:this.temp.pastureId,
+          const url = 'authdata/diese/add'
+          const data = {
+            pastureId: this.temp.pastureId,
             selTime: this.temp.selTime,
-            oilClass:this.temp.oilClass,
+            oilClass: this.temp.oilClass,
             oilAmount: this.temp.oilAmount,
             eqId: this.temp.eqId,
             eqCode: this.temp.eqCode,
@@ -1004,10 +1005,10 @@ export default {
             price: this.temp.price,
             empId: this.temp.empId,
             inputId: this.temp.inputId,
-            oilType:this.temp.oilType,
-            oilName:this.temp.oilName,
+            oilType: this.temp.oilType,
+            oilName: this.temp.oilName
           }
-          postJson(url,data).then(response => {
+          postJson(url, data).then(response => {
             if (response.msg !== 'fail') {
               this.form_reset()
               this.$nextTick(() => {
@@ -1050,10 +1051,10 @@ export default {
       }, 10000)
       this.$refs['temp'].validate(valid => {
         if (valid) {
-          if(this.temp.oilType){
+          if (this.temp.oilType) {
             var oilName = this.dieselTypeList.find(obj => obj.value == this.temp.oilType).label
           }
-          this.$set(this.temp,'oilName',oilName)
+          this.$set(this.temp, 'oilName', oilName)
           this.postDataPramas.common = { 'returnmap': '0' }
           this.postDataPramas.data = []
           this.postDataPramas.data[0] = { 'name': 'updateDieselExecData', 'type': 'e', 'parammaps': {
@@ -1062,8 +1063,8 @@ export default {
             'note': this.temp.note,
             'nowPrice': this.temp.price * this.temp.oilAmount,
             'price': this.temp.price,
-            'oilType':this.temp.oilType,
-            'oilName':this.temp.oilName,
+            'oilType': this.temp.oilType,
+            'oilName': this.temp.oilName
           }}
 
           this.postDataPramas.data[1] = { 'name': 'updateOilCardLAExecData', 'type': 'e',
@@ -1116,11 +1117,11 @@ export default {
           this.requestParam.name = 'deleteDiesel'
           this.requestParam.parammaps = {}
           this.requestParam.parammaps['id'] = row.id
-          let url = 'authdata/diese/off'
-          let data = {
-            id:parseInt(row.id),
+          const url = 'authdata/diese/off'
+          const data = {
+            id: parseInt(row.id)
           }
-          postJson(url,data).then(response => {
+          postJson(url, data).then(response => {
             this.get_table_data()
             this.dialogFormVisible = false
             this.$notify({

+ 1 - 1
src/views/cost/elec/index.vue

@@ -818,7 +818,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture =response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDepartDownList()
       })

+ 5 - 4
src/views/cost/gas/index.vue

@@ -39,8 +39,8 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
-      @sort-change="tableSort1"
       :max-height="myHeight"
+      @sort-change="tableSort1"
     >
       <!-- table表格 -->
       <el-table-column label="序号" align="center" type="index" width="50px">
@@ -239,7 +239,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       isokDisable: false,
       isGasAdd: [], isGasExport: [], isGasImport: [], isGasModify: [], formNumberSearchList: [], formNameSearchList: [],
       requestParam: { name: 'insertGas', offset: 0, pagecount: 0, parammaps: {}},
@@ -259,7 +259,8 @@ export default {
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -582,7 +583,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list //  response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDepartDownList()
       })

+ 91 - 119
src/views/cost/gasolineConsum/index.vue

@@ -40,19 +40,18 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
- 
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
           <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="牧场"  min-width="110px" align="center">
+      <el-table-column label="牧场" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.pastureName }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="部门"  min-width="110px" align="center">
+      <el-table-column label="部门" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.departmentName }}</span>
         </template>
@@ -62,31 +61,31 @@
           <span>{{ scope.row.dosage }}</span>
         </template>
       </el-table-column>
- 
-      <el-table-column label="单价"  min-width="110px" align="center">
+
+      <el-table-column label="单价" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.price }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="当天费用"  min-width="110px"align="center">
+      <el-table-column label="当天费用" min-width="110px"align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.expense  }}</span>
+          <span>{{ scope.row.expense }}</span>
         </template>
       </el-table-column>
       <el-table-column label="记录人" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.empname   }}</span>
+          <span>{{ scope.row.empname }}</span>
         </template>
       </el-table-column>
       <el-table-column label="日期" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.date  }}</span>
+          <span>{{ scope.row.date }}</span>
         </template>
       </el-table-column>
- 
+
       <el-table-column label="备注" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.remarks  }}</span>
+          <span>{{ scope.row.remarks }}</span>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
@@ -101,67 +100,64 @@
     <!-- 弹出层新增or修改 -->
     <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
       <el-form ref="temp" :rules="rules1" :model="temp" label-position="right" label-width="110px">
-        
+
         <el-row>
-           
+
           <el-col :span="8">
 
-            <el-form-item label="牧场:" prop="pastureId" v-show="dialogStatus==='create'">
-                <el-select v-model="temp.pastureId" placeholder="牧场"   class="filter-item" @change="change_pasture2" style="width:100%">
-                  <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
+            <el-form-item v-show="dialogStatus==='create'" label="牧场:" prop="pastureId">
+              <el-select v-model="temp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" @change="change_pasture2">
+                <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
 
-            <el-form-item label="牧场:" prop="pastureId" v-show="dialogStatus==='update'">
-                <el-input ref="pastureName" v-model="temp.pastureName"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="牧场:" prop="pastureId">
+              <el-input ref="pastureName" v-model="temp.pastureName" disabled />
             </el-form-item>
 
-
           </el-col>
           <el-col :span="8">
-            <el-form-item label="部门:"  prop="departmentId"  v-show="dialogStatus==='create'">
+            <el-form-item v-show="dialogStatus==='create'" label="部门:" prop="departmentId">
               <el-select v-model="temp.departmentId" clearable placeholder="部门" class="filter-item" style="width:100%">
                 <el-option v-for="item in departList2" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
-            <el-form-item label="部门:"  prop="departmentId"  v-show="dialogStatus==='update'">
-                <el-input ref="departmentName" v-model="temp.departmentName"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="部门:" prop="departmentId">
+              <el-input ref="departmentName" v-model="temp.departmentName" disabled />
             </el-form-item>
-    
+
           </el-col>
- 
 
-           
         </el-row>
         <el-row>
           <el-col :span="8">
             <el-form-item label="当前汽油用量:" prop="dosage">
-              <el-input ref="dosage" v-model="temp.dosage"    />
+              <el-input ref="dosage" v-model="temp.dosage" />
             </el-form-item>
           </el-col>
-         
+
           <el-col :span="8">
             <el-form-item label="单价(元):" prop="price">
-              <el-input ref="price" v-model="temp.price"   />
+              <el-input ref="price" v-model="temp.price" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="当前费用:" prop="expense">
-              <el-input ref="expense" v-model="temp.expense"   />
+              <el-input ref="expense" v-model="temp.expense" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="8">
-            <el-form-item label="记录人:" prop="inputid"   v-show="dialogStatus==='create'">
-              <el-select ref="inputid" v-model="temp.inputid " placeholder="记录人" class="filter-item" style="width:100%;"   @change="change_emp">
+            <el-form-item v-show="dialogStatus==='create'" label="记录人:" prop="inputid">
+              <el-select ref="inputid" v-model="temp.inputid " placeholder="记录人" class="filter-item" style="width:100%;" @change="change_emp">
                 <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
-            <el-form-item label="记录人:"  prop="empname"  v-show="dialogStatus==='update'" >
-              <el-input ref="empname" v-model="temp.empname"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="记录人:" prop="empname">
+              <el-input ref="empname" v-model="temp.empname" disabled />
             </el-form-item>
-           
+
           </el-col>
           <el-col :span="8">
             <el-form-item label="录入日期:" prop="date">
@@ -170,12 +166,12 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="备注:" prop="remarks">
-              <el-input ref="remarks" v-model="temp.remarks"  />
+              <el-input ref="remarks" v-model="temp.remarks" />
             </el-form-item>
           </el-col>
-          
+
         </el-row>
-         
+
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button v-if="dialogStatus==='create'" ref="createb" type="success" :disabled="isokDisable" @click="add_dialog_save_again()">保存并新增</el-button>
@@ -184,7 +180,7 @@
       </div>
     </el-dialog>
     <!-- 用量记录 -->
-    <el-dialog  title="用量记录" :visible.sync="dialogFormDosageRecord" :close-on-click-modal="false">
+    <el-dialog title="用量记录" :visible.sync="dialogFormDosageRecord" :close-on-click-modal="false">
       <div class="dosageRecord">
         <div style="position: absolute;top:20px;left:100px;font:18px/24px '' ;color:#303133;">
           <span style="margin:0 10px;">牧场:{{ dosageRecordTemp.pastureName }}</span>
@@ -209,18 +205,18 @@
               <span>{{ scope.$index + (pageNumDosageRecord-1) * pageSizeDosageRecord + 1 }}</span>
             </template>
           </el-table-column>
-  
-          <el-table-column label="用量"  prop="dosage" min-width="110px" align="center">
+
+          <el-table-column label="用量" prop="dosage" min-width="110px" align="center">
             <template slot-scope="scope">
               <span>{{ scope.row.dosage }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="单价"  prop="price" align="center" min-width="110px" >
+          <el-table-column label="单价" prop="price" align="center" min-width="110px">
             <template slot-scope="scope">
               <span>{{ scope.row.price }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="总价"   prop="expense" align="center" min-width="110px">
+          <el-table-column label="总价" prop="expense" align="center" min-width="110px">
             <template slot-scope="scope">
               <span>{{ scope.row.expense }}</span>
             </template>
@@ -235,7 +231,7 @@
               <span>{{ scope.row.date }}</span>
             </template>
           </el-table-column>
-        
+
         </el-table>
         <pagination v-show="totalDosageRecord>=0" :total="totalDosageRecord" :page.sync="getDosageRecordListParm.offset" :limit.sync="getDosageRecordListParm.pagecount" @pagination="get_record_list" />
         <div slot="footer" class="dialog-footer">
@@ -291,8 +287,7 @@ export default {
       list: null,
       total: 0,
       listLoading: true,
- 
-   
+
       requestParam: {
         name: 'insertElectricity',
         offset: 0,
@@ -310,7 +305,7 @@ export default {
         pagecount: 10,
         returntype: 'Map',
         parammaps: {
-          formName: '',  formNumber: '',   formType: '',    pastureName: Cookies.get('pasturename'),  departName: '', date: ''
+          formName: '', formNumber: '', formType: '', pastureName: Cookies.get('pasturename'), departName: '', date: ''
         }
       },
       downLoadObj: {
@@ -320,26 +315,26 @@ export default {
         pagecount: 0,
         returntype: 'Map',
         parammaps: {
-          formName: '',  formNumber: '',   formType: '',    pastureName: Cookies.get('pasturename'),  departName: '', date: ''
+          formName: '', formNumber: '', formType: '', pastureName: Cookies.get('pasturename'), departName: '', date: ''
         }
       },
-      downLoadList:[],
+      downLoadList: [],
       // 2-3:下拉框请求后数据加入[]
       useTypes: [{ id: 0, name: '1级表' }, { id: 1, name: '2级表' }, { id: 2, name: '3级表' }],
       getDictByName: [],
       findAllAssetType: [],
-     
- 
+
       pastureList: [],
-      departList1:[],
-      departList2:[],
+      departList1: [],
+      departList2: [],
       findAllEmploye: [],
       // 2-1.请求下拉框接口
       requestParams: [
         { name: 'getDictByName', offset: 0, pagecount: 0, params: ['电表类型'] },
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam1: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -356,7 +351,7 @@ export default {
         parammaps: { }
       },
 
-      temp: { 
+      temp: {
         pastureName: '',
         departName: '',
         dosage: '',
@@ -387,7 +382,7 @@ export default {
         offset: 1,
         pagecount: 10,
         returntype: 'Map',
-        parammaps: { "departmentId": ""}
+        parammaps: { 'departmentId': '' }
       },
       dosageRecordTemp: {},
       // 校验规则
@@ -416,13 +411,12 @@ export default {
         dosage: [{ required: true, message: '必填', trigger: 'blur' }],
         price: [{ required: true, message: '必填', trigger: 'blur' }],
         departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
-        expense: [{ required: true, message: '必填', trigger: 'blur' }],
-       
-         
+        expense: [{ required: true, message: '必填', trigger: 'blur' }]
+
       },
 
       rules2: { },
-    
+
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       buttons: [],
@@ -506,7 +500,7 @@ export default {
         }
       }, 0)
     },
-   
+
     form_export() {
       this.downLoadObj.parammaps = this.tableObj.parammaps
       GetDataByName(this.downLoadObj).then(response => {
@@ -519,9 +513,9 @@ export default {
         var excelDatasTabChart1 = [
           {
             tHeader: [
-               '牧场', '部门', '当天汽油用量', '单价', '当天费用', '记录人', '日期', '备注'
+              '牧场', '部门', '当天汽油用量', '单价', '当天费用', '记录人', '日期', '备注'
             ],
-            filterVal: ['pastureName', 'departmentName','dosage','price','expense','empname','date','remarks'  ],
+            filterVal: ['pastureName', 'departmentName', 'dosage', 'price', 'expense', 'empname', 'date', 'remarks'],
             tableDatas: this.downLoadList,
             sheetName: '汽油用量'
           }
@@ -530,9 +524,6 @@ export default {
       })
     },
 
-
-    
-
     formatJson(filterVal, jsonData) {
       return jsonData.map(v =>
         filterVal.map(j => {
@@ -561,10 +552,10 @@ export default {
            import('@/vendor/Export2Excel').then(excel => {
              const list1 = res.data.result
              const tHeader = [
-             '牧场', '部门', '当天汽油用量', '单价', '当天费用', '记录人', '日期', '备注', '错误信息'
+               '牧场', '部门', '当天汽油用量', '单价', '当天费用', '记录人', '日期', '备注', '错误信息'
              ]
              const filterVal = [
-             '牧场', '部门', '当天汽油用量', '单价', '当天费用', '记录人', '日期', '备注', 'error_msg'
+               '牧场', '部门', '当天汽油用量', '单价', '当天费用', '记录人', '日期', '备注', 'error_msg'
              ]
              const data1 = this.formatJson(filterVal, list1)
              excel.export_json_to_excel({ header: tHeader, data: data1, filename: '导入报错信息', autoWidth: true, bookType: 'xlsx' })
@@ -574,20 +565,17 @@ export default {
         this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
       }
     },
-   
-  
-   
-  
+
     // 1-1: table&搜索
     get_table_data() {
-      if(this.tableObj.parammaps.pastureName == '现代牧业'){
-        this.tableObj.parammaps.pastureName =''
+      if (this.tableObj.parammaps.pastureName == '现代牧业') {
+        this.tableObj.parammaps.pastureName = ''
       }
       this.listLoading = true
       GetDataByName(this.tableObj).then(response => {
         if (response.data.list == null) {
           this.list = []
-           this.total = 0
+          this.total = 0
         } else {
           this.list = response.data.list
           this.pageNum = response.data.pageNum
@@ -606,13 +594,13 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.pastureList = response.data.findAllPasture.list
+        this.pastureList =response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.get_departList1()
         this.get_departList2()
       })
     },
-    
+
     change_pasture1(item) {
       this.getDepartParam1.parammaps.pastureId = this.pastureList.find(obj => obj.name == item).id
       this.tableObj.parammaps.departName = ''
@@ -624,7 +612,6 @@ export default {
       })
     },
 
-
     change_pasture2(item) {
       this.getDepartParam2.parammaps.pastureId = item
       this.temp.departmentId = ''
@@ -639,25 +626,20 @@ export default {
     form_search() {
       this.listLoading = true
       this.tableObj.offset = 1
-      if(this.tableObj.parammaps.date == null){
-        this.tableObj.parammaps.date =''
+      if (this.tableObj.parammaps.date == null) {
+        this.tableObj.parammaps.date = ''
       }
 
-    
       this.get_table_data()
     },
 
-
-    change_emp(item){
+    change_emp(item) {
       console.log('记录人', item)
       this.$set(this.temp, 'inputid', item)
       this.$forceUpdate()
     },
-   
-    form_reset() {
-
-    
 
+    form_reset() {
       this.temp.pastureName = ''
       this.temp.departName = ''
       this.temp.dosage = ''
@@ -669,40 +651,33 @@ export default {
       this.temp.inputid = this.$store.state.user.employeid
       this.temp.departmentId = ''
       this.temp.pastureId = ''
-
-
-      
     },
     form_add() {
       this.form_reset()
       this.dialogStatus = 'create'
       this.dialogFormVisible = true
-       
+
       this.$nextTick(() => {
         this.$refs['temp'].clearValidate()
       })
- 
     },
-   
-    
+
     add_dialog_save() {
-      console.log("this.temp=====>",this.temp)
+      console.log('this.temp=====>', this.temp)
       this.isokDisable = true
       setTimeout(() => {
         this.isokDisable = false
       }, 1000)
       this.$refs['temp'].validate(valid => {
         if (valid) {
-
           var send_data = {
-              "name": "insertGasoline",
-              "offset": 0,
-              "pagecount": 0,
-              "parammaps": this.temp
+            'name': 'insertGasoline',
+            'offset': 0,
+            'pagecount': 0,
+            'parammaps': this.temp
           }
-          
+
           PostDataByName(send_data).then(response => {
-  
             if (response.msg === 'fail') {
               this.$notify({
                 title: '保存失败',
@@ -733,12 +708,12 @@ export default {
       this.$refs['temp'].validate(valid => {
         if (valid) {
           var send_data = {
-              "name": "insertGasoline",
-              "offset": 0,
-              "pagecount": 0,
-              "parammaps": this.temp
+            'name': 'insertGasoline',
+            'offset': 0,
+            'pagecount': 0,
+            'parammaps': this.temp
           }
-          
+
           PostDataByName(send_data).then(response => {
             console.log('保存发送参数', this.postDataPramas)
             if (response.msg === 'fail') {
@@ -762,8 +737,7 @@ export default {
       })
     },
     form_edit(row) {
-
-      console.log("row=======",row)
+      console.log('row=======', row)
       this.temp = Object.assign({}, row) // copy obj
       this.dialogStatus = 'update'
       this.dialogFormVisible = true
@@ -774,14 +748,13 @@ export default {
     edit_dialog_save() {
       this.$refs['temp'].validate(valid => {
         if (valid) {
-           
           var send_data = {
-              "name": "updateGasoline",
-              "offset": 0,
-              "pagecount": 0,
-              "parammaps": this.temp
+            'name': 'updateGasoline',
+            'offset': 0,
+            'pagecount': 0,
+            'parammaps': this.temp
           }
-          
+
           PostDataByName(send_data).then(response => {
             if (response.msg === 'fail') {
               this.$notify({
@@ -812,10 +785,9 @@ export default {
     form_delete_sure() {
       this.$refs['deleteTemp'].validate(valid => {
         if (valid) {
-    
           var send_data = {
-            "name":"delGasoline","offset":0,"pagecount":0,
-            "parammaps":{"date":this.deleteTemp.startTime}
+            'name': 'delGasoline', 'offset': 0, 'pagecount': 0,
+            'parammaps': { 'date': this.deleteTemp.startTime }
           }
           PostDataByName(send_data).then(response => {
             if (response.msg == 'fail') {
@@ -833,7 +805,7 @@ export default {
       this.dialogStatus = 'DosageRecord'
       this.dialogFormDosageRecord = true
       this.dosageRecordTemp = Object(row, {})
-      console.log("row=========see_record",row)
+      console.log('row=========see_record', row)
       this.get_record_list()
     },
     get_record_list() {

+ 3 - 2
src/views/cost/generation/index.vue

@@ -156,7 +156,8 @@ export default {
       energyTypeList: [], findAllPasture: [], findAllDepart: [], findAllEmploye: [], createDepartList: [],
       requestParams: [
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -247,7 +248,7 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture =response.data.getPastureRoleList.list //   response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDepartDownList()
       })

+ 3 - 2
src/views/cost/methane/index.vue

@@ -415,7 +415,8 @@ export default {
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       requestFilterParams: {
         name: 'getMethaneList',
@@ -798,7 +799,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list //  response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
       })

+ 3 - 2
src/views/cost/other/index.vue

@@ -281,7 +281,8 @@ export default {
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       requestFilterParams: {
         name: 'getWaterList',
@@ -355,7 +356,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
       })

+ 5 - 4
src/views/cost/steam/index.vue

@@ -40,8 +40,8 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
-      @sort-change="tableSort1"
       :max-height="myHeight"
+      @sort-change="tableSort1"
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
@@ -319,7 +319,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       isokDisable: false,
       isSteamAdd: [],
       isSteamExport: [],
@@ -368,7 +368,8 @@ export default {
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -788,7 +789,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDepartDownList()
       })

+ 16 - 15
src/views/cost/water/index.vue

@@ -14,7 +14,7 @@
       </el-select>
       <el-input v-model="getdataListParm.parammaps.formNumber" placeholder="编号" clearable class="filter-item" style="width: 130px" />
       <el-input v-model="getdataListParm.parammaps.formName" placeholder="表名称" style="width: 140px;" class="filter-item" />
-      <el-select v-model="getdataListParm.parammaps.formType" clearable  style="width: 140px;" placeholder="表结构" class="filter-item">
+      <el-select v-model="getdataListParm.parammaps.formType" clearable style="width: 140px;" placeholder="表结构" class="filter-item">
         <el-option v-for="item in useTypes" :key="item.id" :label="item.name" :value="item.name" />
       </el-select>
       <el-date-picker v-model="getdataListParm.parammaps.inputDatetime" clearable class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;margin-right: 10px;" />
@@ -42,8 +42,8 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
-      @sort-change="tableSort1"
       :max-height="myHeight"
+      @sort-change="tableSort1"
     >
       <!-- <el-table-column type="selection" width="55" /> -->
       <el-table-column label="序号" align="center" type="index" width="50px">
@@ -309,7 +309,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       isokDisable: false,
       isWaterAdd: [],
       isWaterExport: [],
@@ -344,9 +344,9 @@ export default {
           formType: '',
           pastureName: Cookies.get('pasturename'),
           departName: '',
-          inputDatetime:[],
-          startTime:'',
-          stopTime:''
+          inputDatetime: [],
+          startTime: '',
+          stopTime: ''
         }
       },
       // 2-3:下拉框请求后数据加入[]
@@ -362,7 +362,8 @@ export default {
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -530,7 +531,7 @@ export default {
         }
       }, 0)
     },
-    handleDownloadTemp(){
+    handleDownloadTemp() {
       this.$alert('水表模板正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
       this.isPercentage = true
       this.percentage = 1
@@ -554,9 +555,9 @@ export default {
       GetDataByName(this.requestParam).then(response => {
         this.$nextTick(() => {
           import('@/vendor/Export2Excel').then(excel => {
-            let day = parseTime(new Date(), '{y}-{m}-{d}')
-            for(let i=0;i<response.data.list.length;i++){
-              this.$set(response.data.list[i], 'i', i+1)
+            const day = parseTime(new Date(), '{y}-{m}-{d}')
+            for (let i = 0; i < response.data.list.length; i++) {
+              this.$set(response.data.list[i], 'i', i + 1)
               this.$set(response.data.list[i], 'day', day)
               this.$set(response.data.list[i], 'name', Cookies.get('employename'))
             }
@@ -805,10 +806,10 @@ export default {
     get_table_data() {
       this.listLoading = true
 
-      if(this.getdataListParm.parammaps.inputDatetime !== null && this.getdataListParm.parammaps.inputDatetime.length > 0){
+      if (this.getdataListParm.parammaps.inputDatetime !== null && this.getdataListParm.parammaps.inputDatetime.length > 0) {
         this.getdataListParm.parammaps.startTime = parseTime(this.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
         this.getdataListParm.parammaps.stopTime = parseTime(this.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-      }else{
+      } else {
         this.getdataListParm.parammaps.inputDatetime = []
         this.getdataListParm.parammaps.startTime = ''
         this.getdataListParm.parammaps.stopTime = ''
@@ -832,7 +833,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture =response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDepartDownList()
       })
@@ -1140,7 +1141,7 @@ export default {
           this.listLoadingDosageRecord = false
         }, 100)
       })
-    },
+    }
 
   }
 }

+ 58 - 71
src/views/custom/allot/index.vue

@@ -18,7 +18,7 @@
         <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
         <el-button v-waves class="filter-item" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
 
-        <el-button    class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
+        <el-button class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
       </div>
     </div>
 
@@ -34,11 +34,11 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
+      :max-height="myHeight"
       @selection-change="change_table_selection"
       @current-change="handleCurrentChange"
-      :max-height="myHeight"
     >
-    <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
+      <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
           <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
@@ -67,13 +67,13 @@
       <el-table-column label="调拨日期" sortable prop="creatTime" min-width="80px" align="center" />
       <el-table-column label="调拨状态" min-width="80px" align="center" :formatter="statue" />
 
-      <el-table-column   prop="sapStatus" label="sap上传状态" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span v-show ="scope.row.sapStatus == 2">上传失败</span>
-                <span v-show = "scope.row.sapStatus == 1">上传成功</span>
-                <span v-show = "scope.row.sapStatus == 0 || typeof(scope.row.sapStatus)== 'undefined'">未上传</span>
-              </template>
-            </el-table-column>
+      <el-table-column prop="sapStatus" label="sap上传状态" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span v-show="scope.row.sapStatus == 2">上传失败</span>
+          <span v-show="scope.row.sapStatus == 1">上传成功</span>
+          <span v-show="scope.row.sapStatus == 0 || typeof(scope.row.sapStatus)== 'undefined'">未上传</span>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
         <template slot-scope="{row}">
           <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
@@ -438,12 +438,12 @@ export default {
   },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
-      isSap:1,
-      isSrm:1,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
+      isSap: 1,
+      isSrm: 1,
       selectList: [],
       isAllotsap: [],
-      currentRow:{},
+      currentRow: {},
       loginPastureid: Cookies.get('pastureid'),
       isokDisable: false,
       findAllProvider: [],
@@ -457,7 +457,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'getPastureList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: {}},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       pickerOptions: {
         disabledDate(time) {
@@ -511,7 +512,7 @@ export default {
         empId: this.$store.state.user.employeid,
         employeId: this.$store.state.user.employeid,
         applyDate: parseTime(new Date(), '{y}-{m}-{d}'),
-        groupName:''
+        groupName: ''
       },
       requestSparePart: {
         name: 'getPartsListLY',
@@ -555,91 +556,80 @@ export default {
     }
   },
 
-  created() {
-    this.get_select_list()
-    this.get_table_data()
-  },
-
   watch: {
 
     listAdd: {
       deep: true,
-      handler: function (item) {
-          this.listAdd.forEach(function(i){
-            if(parseInt(i.amount) > (parseInt(i.reportery) )){
-              i.amount = parseInt(i.reportery)
-            }
-
-          })
+      handler: function(item) {
+        this.listAdd.forEach(function(i) {
+          if (parseInt(i.amount) > (parseInt(i.reportery))) {
+            i.amount = parseInt(i.reportery)
+          }
+        })
       }
-    },
+    }
+  },
+
+  created() {
+    this.get_select_list()
+    this.get_table_data()
   },
 
   methods: {
 
     handleCurrentChange(val) {
-        this.currentRow = val;
-        console.log("currentRow",this.currentRow)
+      this.currentRow = val
+      console.log('currentRow', this.currentRow)
     },
 
-    checkboxInit(row,index){
+    checkboxInit(row, index) {
       // console.log(row)
 
-
-        var data1 = new Date(row.creatTime)
-        var data2 = new Date('2022-10-25')
-        if(data1 > data2){ return 1 } else {return 0}
-
+      var data1 = new Date(row.creatTime)
+      var data2 = new Date('2022-10-25')
+      if (data1 > data2) { return 1 } else { return 0 }
     },
 
-    //监听 - 表格 - 勾选
+    // 监听 - 表格 - 勾选
     change_table_selection(val) {
       this.selectList = val
       console.log('勾选数据selectList', this.selectList)
     },
-    sapUpload(){
+    sapUpload() {
       const that = this
-      console.log("currentRow ProofCode",this.currentRow.ProofCode)
+      console.log('currentRow ProofCode', this.currentRow.ProofCode)
       var send_data = this.selectList
 
-      if(send_data.length == 0){
-        that.$notify({ title: '失败', message: '请勾选数据!'  , type: 'error', duration: 2000 })
+      if (send_data.length == 0) {
+        that.$notify({ title: '失败', message: '请勾选数据!', type: 'error', duration: 2000 })
         return false
       }
 
-
       console.log(that.isSap)
 
-      if(that.isSap == 1){
-
-         that.isSap = 0
-         SapTrans(send_data).then(response => {
-              console.log('response', response)
-
-              if (response.msg !== 'fail') {
-                that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
-                that.selectList = []
-                that.get_table_data()
-                } else {
-                  that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
-                }
-            })
-
+      if (that.isSap == 1) {
+        that.isSap = 0
+        SapTrans(send_data).then(response => {
+          console.log('response', response)
 
+          if (response.msg !== 'fail') {
+            that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
+            that.selectList = []
+            that.get_table_data()
+          } else {
+            that.$notify({ title: '失败', message: '上传失败', type: 'error', duration: 2000 })
+          }
+        })
       } else {
-
-        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击'  , type: 'error', duration: 2000 })
+        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击', type: 'error', duration: 2000 })
       }
 
       setTimeout(() => {
-              that.isSap = 1
-            }, 3000)
-
-
-
+        that.isSap = 1
+      }, 3000)
 
       //  if(true){
-      //sapStatus 0 或没有 未同步,1 同步成功,2同步失败
+      // sapStatus 0 或没有 未同步,1 同步成功,2同步失败
       // if(this.currentRow.sapStatus){
       //    console.log("currentRow sapStatus 这个值说明已经上传了 传")
 
@@ -666,8 +656,6 @@ export default {
       // } else {
       //   console.log("currentRow sapStatus没有这个值")
 
-
-
       //     console.log("applyCode",applyCode)
       //       var send_data = {
       //             "code":applyCode,
@@ -686,7 +674,6 @@ export default {
       //       })
 
       // }
-
     },
 
     tableSort(column) {
@@ -894,7 +881,7 @@ export default {
           empId: this.createTemp.empId,
           emp: this.createTemp.emp,
           applyDate: this.createTemp.applyDate,
-          groupName:this.createTemp.groupName
+          groupName: this.createTemp.groupName
         }}
         // eslint-disable-next-line no-irregular-whitespace
         this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
@@ -1009,7 +996,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture =response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllPasture2 = response.data.getPastureList.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list

+ 5 - 4
src/views/custom/allot/index1.vue

@@ -437,7 +437,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'getPastureList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: {}},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       pickerOptions: {
         disabledDate(time) {
@@ -491,7 +492,7 @@ export default {
         empId: this.$store.state.user.employeid,
         employeId: this.$store.state.user.employeid,
         applyDate: parseTime(new Date(), '{y}-{m}-{d}'),
-        groupName:''
+        groupName: ''
       },
       requestSparePart: {
         name: 'getPartsListLY',
@@ -746,7 +747,7 @@ export default {
           empId: this.createTemp.empId,
           emp: this.createTemp.emp,
           applyDate: this.createTemp.applyDate,
-          groupName:this.createTemp.groupName
+          groupName: this.createTemp.groupName
         }}
         // eslint-disable-next-line no-irregular-whitespace
         this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
@@ -861,7 +862,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture =response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllPasture2 = response.data.getPastureList.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list

+ 32 - 35
src/views/custom/basic/index.vue

@@ -41,8 +41,8 @@
           <div>
             <el-button v-if="isBasicAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
             <el-button v-if="isBasicTemplate" v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
-            <el-button v-if="isDisable" v-waves class="filter-item" type="danger" icon="el-icon-remove-outline"  @click="handleBatchDisable">批量禁用</el-button>
-            <el-button v-if="isEnable" v-waves class="filter-item" type="danger" icon="el-icon-success"  @click="handleBatchEnable">批量启用</el-button>
+            <el-button v-if="isDisable" v-waves class="filter-item" type="danger" icon="el-icon-remove-outline" @click="handleBatchDisable">批量禁用</el-button>
+            <el-button v-if="isEnable" v-waves class="filter-item" type="danger" icon="el-icon-success" @click="handleBatchEnable">批量启用</el-button>
             <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
               <el-button v-if="isBasicImport" v-waves class="filter-item" type="warning" icon="el-icon-download" @click="form_search">导入</el-button>
             </el-upload>
@@ -62,10 +62,10 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"
-          @selection-change="handleSelectionChange2"
           :max-height="myHeight"
+          @selection-change="handleSelectionChange2"
         >
-          <el-table-column type="selection"  width="55"></el-table-column>
+          <el-table-column type="selection" width="55" />
           <el-table-column label="序号" align="center" type="index" width="50px">
             <template slot-scope="scope">
               <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
@@ -184,8 +184,8 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"
-          @selection-change="handleSelectionChange"
           :max-height="myHeight"
+          @selection-change="handleSelectionChange"
         >
           <el-table-column type="selection" width="55" />
           <el-table-column label="序号" align="center" type="index" width="50px">
@@ -491,12 +491,10 @@
         <el-tab-pane v-if="isDisplayPasture" label="牧场信息" name="second">
           <div class="pasture-title">
             <b>备件类别:<span>{{ seeTemp.eqClassName1 }}/{{ seeTemp.eqClassName3 }}/{{ seeTemp.eqClassName3 }}</span></b>
-            <b>备件编号:<span> {{seeTemp.partCode}}</span></b>
-            <b>备件编名称:<span>{{seeTemp.partName}}</span></b>
+            <b>备件编号:<span> {{ seeTemp.partCode }}</span></b>
+            <b>备件编名称:<span>{{ seeTemp.partName }}</span></b>
           </div>
 
-
-
           <el-table
             :key="tableKey"
             v-loading="listLoadingSee"
@@ -663,7 +661,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      isStyle:'display:none',
+      isStyle: 'display:none',
       isBasicAdd: [],
       isBasicTemplate: [],
       isBasicExport: [],
@@ -681,7 +679,7 @@ export default {
       isEasSynchronization: [],
       isManualSynchronization: [],
       isIgnoreSynchronization: [],
-      multipleSelection:[],
+      multipleSelection: [],
       rules: {
         temptypeCode: [{ required: true, message: '必填', trigger: 'blur' }],
         partClass: [{ required: true, message: '必填', trigger: 'blur' }],
@@ -750,7 +748,8 @@ export default {
         { name: 'findAllDepart', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] },
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['计量单位'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['计量单位'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       isokDisable: false,
       disabled: false,
@@ -876,7 +875,7 @@ export default {
           parammaps: {}
         }
       },
-      myHeight:document.documentElement.clientHeight - 85- 250
+      myHeight: document.documentElement.clientHeight - 85 - 250
       // fileList: [],
       // headers1: {
       //   optname: 'insertcustompic',
@@ -1013,19 +1012,17 @@ export default {
       this.isIgnoreSynchronization = isIgnoreSynchronization
     },
     handleSelectionChange2(val) {
-        this.multipleSelection = val;
-      },
-    handleBatchDisable(){
-      if(this.multipleSelection.length > 0){
-
-
-      this.$confirm('是否确定批量禁用?', '提示', {
+      this.multipleSelection = val
+    },
+    handleBatchDisable() {
+      if (this.multipleSelection.length > 0) {
+        this.$confirm('是否确定批量禁用?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
           this.multipleSelection.forEach(row => {
-            console.log("批量禁用",row)
+            console.log('批量禁用', row)
             this.requestParam = {}
             this.requestParam.name = 'updatepartsEnable'
             this.requestParam.parammaps = {}
@@ -1034,28 +1031,28 @@ export default {
             PostDataByName(this.requestParam).then(() => {
               this.$notify({ title: '成功', message: '禁用成功', type: 'success', duration: 2000 })
             })
-          });
+          })
           this.get_table_data()
           this.get_table_dataSH()
         }).catch(() => {
           this.$message({
             type: 'info',
             message: '已取消批量禁用'
-          });
-        });
-      }else{
+          })
+        })
+      } else {
         this.$notify({ title: '提示', message: '请勾选禁用备件', type: 'error', duration: 2000 })
       }
     },
-    handleBatchEnable(){
-      if(this.multipleSelection.length > 0){
-      this.$confirm('是否确定批量启用?', '提示', {
+    handleBatchEnable() {
+      if (this.multipleSelection.length > 0) {
+        this.$confirm('是否确定批量启用?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
           this.multipleSelection.forEach(row => {
-            console.log("批量启用",row)
+            console.log('批量启用', row)
             this.requestParam = {}
             this.requestParam.name = 'updatepartsEnable'
             this.requestParam.parammaps = {}
@@ -1064,16 +1061,16 @@ export default {
             PostDataByName(this.requestParam).then(() => {
               this.$notify({ title: '成功', message: '启用成功', type: 'success', duration: 2000 })
             })
-          });
+          })
           this.get_table_data()
           this.get_table_dataSH()
         }).catch(() => {
           this.$message({
             type: 'info',
             message: '已取消批量启用'
-          });
-        });
-      }else{
+          })
+        })
+      } else {
         this.$notify({ title: '提示', message: '请勾选启用备件', type: 'error', duration: 2000 })
       }
     },
@@ -1082,7 +1079,7 @@ export default {
         this.units = response.data.getDictByName.list
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.findAllCategory = response.data.findAllCategory.list
@@ -1132,7 +1129,7 @@ export default {
         this.listType = response.data
         if (response.data.list !== null) {
           this.listType = transData(response.data.list, 'id', 'pid', 'children')
-          console.log(this.listType,'11111')
+          console.log(this.listType, '11111')
         }
         this.parentDept = this.listType
       })

+ 3 - 2
src/views/custom/contract/index.vue

@@ -1050,7 +1050,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] }
+        { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       isokDisable: false,
       disabled: true,
@@ -1316,7 +1317,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list //  response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.findAllCategory = response.data.findAllCategory.list

+ 2964 - 2971
src/views/custom/contractManagement/index.vue

@@ -1,2971 +1,2964 @@
-<template>
-  <div class="app-container">
-    <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
-      <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
-      <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
-    </div>
-    <el-tabs v-model="activeName" @tab-click="handleClick">
-      <el-tab-pane label="合同管理" name="first">
-        <div v-if="isContractManagement" class="contractManagement">
-          <div class="filter-container">
-            <el-select v-model="tab1.contractManagement.getdataListParm.parammaps.pastureName" placeholder="牧场" style="width:120px" class="filter-item">
-              <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
-            </el-select>
-            <el-input v-model="tab1.contractManagement.getdataListParm.parammaps.contractCode" placeholder="合同编号" style="width: 140px;" class="filter-item" />
-            <el-select v-model="tab1.contractManagement.getdataListParm.parammaps.statue" clearable placeholder="合同状态" class="filter-item" style="width: 120px;">
-              <el-option v-for="item in contractStatusList" :key="item.id" :label="item.name" :value="item.name" />
-            </el-select>
-            <el-select v-model="tab1.contractManagement.getdataListParm.parammaps.providerName" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
-              <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.name" />
-            </el-select>
-            <el-select v-model="tab1.contractManagement.getdataListParm.parammaps.isZeroStock" clearable placeholder="是否零库存" class="filter-item" style="width: 120px;">
-              <el-option v-for="item in isZeroInventoryList" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>
-            <el-date-picker ref="tab1InputDatetime1" v-model="tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
-            <el-date-picker ref="tab1InputDatetime2" v-model="tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="审批日期" end-placeholder="审批日期" />
-            <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleTab1Filter">搜索</el-button>
-            <div>
-              <el-button v-if="tab1.contractManagement.isContractAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="handleTab1Create">新增</el-button>
-              <el-radio-group v-model="tab1.contractManagement.radioAll" style="margin-top:-9px" @change="changeContractManagementAll()">
-                <el-radio-button label="全部" />
-                <el-badge :value="pending.total" class="item">
-                  <el-radio-button label="待处理" />
-                </el-badge>
-                <el-radio-button label="已处理" />
-              </el-radio-group>
-            </div>
-          </div>
-          <el-table
-            :key="tab1.contractManagement.tableKey"
-            v-loading="tab1.contractManagement.listLoading"
-            element-loading-text="给我一点时间"
-            :data="tab1.contractManagement.list"
-            border
-            fit
-            highlight-current-row
-            style="width: 100%;"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable table-fixed"
-            :max-height="myHeight"
-          >
-            <el-table-column label="序号" align="center" type="index" width="50px">
-              <template slot-scope="scope">
-                <span>{{ scope.$index + (tab1.contractManagement.pageNum-1) * tab1.contractManagement.pageSize + 1 }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="牧场" min-width="120px" align="center" prop="pastureName" />
-            <el-table-column label="合同编号" min-width="120px" align="center" prop="contractCode" />
-            <el-table-column label="合同状态" min-width="110px" align="center" prop="statued" />
-            <el-table-column label="供应商" min-width="120px" align="center" prop="providerName" />
-            <el-table-column label="合同开始日期" sortable min-width="120px" align="center" prop="startTime" />
-            <el-table-column label="合同截止日期" sortable min-width="120px" align="center" prop="stopTime" />
-            <el-table-column label="零库存" min-width="110px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.isZeroStock == 0">否</span>
-                <span v-if="scope.row.isZeroStock == 1">是</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="录入人" min-width="120px" align="center" prop="creatorMan" />
-            <el-table-column label="录入时间" sortable min-width="120px" align="center" prop="creatorTime" />
-            <el-table-column label="审批时间" sortable min-width="120px" align="center" prop="SHdateTime" />
-            <el-table-column label="操作" align="center" width="350px" class-name="small-padding fixed-width" fixed="right">
-              <template slot-scope="{row}">
-                <el-button v-if="tab1.contractManagement.isContractSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
-                <el-button v-if="tab1.contractManagement.isContractSee" type="primary" style="width:70px;" size="mini" @click="handleTab1DetailsSpareParts(row)">备件明细</el-button>
-                <el-button v-if="tab1.contractManagement.isContractSee" type="primary" style="width:70px;" size="mini" @click="handleTab1ChangeRecord(row)">变更记录</el-button>
-                <el-button v-if="tab1.contractManagement.isContractChange && (row.statued == '正常' || row.statued == '已过期')" :disabled="parseInt(row.pastureId) == 18 && parseInt(isGroupAdministrator) !== 18" type="warning" size="mini" @click="handleTab1Change(row)">变更</el-button>
-              </template>
-              <!-- //parseInt(row.pastureId) == 18 && parseInt(isGroupAdministrator) == 18 -->
-            </el-table-column>
-          </el-table>
-          <pagination v-show="tab1.contractManagement.total>0" :total="tab1.contractManagement.total" :page.sync="tab1.contractManagement.getdataListParm.offset" :limit.sync="tab1.contractManagement.getdataListParm.pagecount" @pagination="getTab1List" />
-        </div>
-        <div v-if="isDetailsSpareParts" class="DetailsSpareParts">
-          <div class="title" style="height: 30px;">
-            <b style="font-size: 20px;float: left;">备件明细</b>
-            <a style="float: right;font-weight: 600;font-size: 20px;" @click="handleTab1goBack()">&lt;返回</a>
-          </div>
-          <div class="filter-container">
-            <el-input v-model="tab1.detailsSpareParts.getdataListParm.parammaps.partCode" placeholder="备件编号" style="width: 140px;" class="filter-item" />
-            <el-input v-model="tab1.detailsSpareParts.getdataListParm.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
-            <el-input v-model="tab1.detailsSpareParts.getdataListParm.parammaps.specification" placeholder="备件规格" style="width: 140px;" class="filter-item" />
-            <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleTab1Filter2">搜索</el-button>
-            <!-- <el-button v-waves class="filter-item" type="success" icon="el-icon-edit" @click="change_enabled">启用</el-button> -->
-            <el-button v-if="isContractJinyong"  v-waves class="filter-item" type="danger" icon="el-icon-edit" @click="change_no">禁用</el-button>
-          </div>
-          <div class="filter-container">
-            <el-button v-if="tab1.contractManagement.isContractAdd && parseInt(tab1.detailsSpareParts.detailsList.pastureId) == parseInt(isGroupAdministrator) || parseInt(isEmployeid) == 0" class="filter-item" type="primary" icon="el-icon-edit" :disabled="tab1.detailsSpareParts.detailsList.statued=='终止' || tab1.detailsSpareParts.detailsList.statued=='已过期' || tab1.detailsSpareParts.detailsList.statued=='新增未通过'" @click="handleTab1Create2">新增</el-button>
-            <el-button v-if="tab1.contractManagement.isContractChange && parseInt(tab1.detailsSpareParts.detailsList.pastureId) == parseInt(isGroupAdministrator) || parseInt(isEmployeid) == 0" class="filter-item" type="primary" icon="el-icon-edit" :disabled="tab1.detailsSpareParts.detailsList.statued=='终止' || tab1.detailsSpareParts.detailsList.statued=='已过期' || tab1.detailsSpareParts.detailsList.statued=='新增未通过'" @click="handleTab1Change2">变更</el-button>
-            <el-button v-if="tab1.contractManagement.isContractExport" class="filter-item" type="primary" icon="el-icon-edit" @click="handleTab1Export2">导出</el-button>
-            <el-button v-if="tab1.contractManagement.isContractUplaod" class="filter-item" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
-          </div>
-          <el-table
-            :key="tab1.detailsSpareParts.tableKey"
-            v-loading="tab1.detailsSpareParts.listLoading"
-            element-loading-text="给我一点时间"
-            :data="tab1.detailsSpareParts.list"
-            border
-            fit
-            highlight-current-row
-            style="width: 100%;"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable table-fixed"
-            @sort-change="tableSort1"
-            @selection-change="handleSelectionChange"
-            :max-height="myHeight"
-          >
-            <el-table-column type="selection"  width="55" />
-            <el-table-column label="序号" align="center" type="index" width="50px">
-              <template slot-scope="scope">
-                <span>{{ scope.$index + (tab1.detailsSpareParts.pageNum-1) * tab1.detailsSpareParts.pageSize + 1 }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="备件编号" min-width="120px" align="center" prop="partCode" />
-            <el-table-column label="备件名称" min-width="120px" align="center" prop="partName" />
-            <el-table-column label="备件规格" min-width="120px" align="center" prop="specification" />
-            <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
-              <template slot-scope="scope">
-                <el-popover placement="right" title="" trigger="hover">
-                  <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
-                  <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
-                </el-popover>
-              </template>
-            </el-table-column>
-            <el-table-column label="备件品牌" min-width="120px" align="center" prop="brand" />
-            <el-table-column label="计量单位" min-width="120px" align="center" prop="unit" />
-            <el-table-column label="计划量" sortable min-width="120px" align="center" prop="planAmount" />
-            <el-table-column label="单价" sortable min-width="120px" align="center" prop="price" />
-            <el-table-column label="使用周期" min-width="120px" align="center" prop="lifeCycle" />
-            <el-table-column label="合同差异项" min-width="120px" align="center" prop="contractVarianceItem" />
-            <el-table-column label="备注" sortable min-width="120px" align="center" prop="remark" />
-          </el-table>
-          <pagination v-show="tab1.detailsSpareParts.total>0" :total="tab1.detailsSpareParts.total" :page.sync="tab1.detailsSpareParts.getdataListParm.offset" :limit.sync="tab1.detailsSpareParts.getdataListParm.pagecount" @pagination="getTab1List2" />
-        </div>
-
-        <div v-if="isChangeRecord" class="ChangeRecord">
-          <div class="title" style="height: 30px;">
-            <b style="font-size: 20px;float: left;">变更记录</b>
-            <a style="float: right;font-weight: 600;font-size: 20px;" @click="handleTab1goBack2()">&lt;返回</a>
-          </div>
-          <div class="filter-container">
-            <el-input v-model="tab1.changeRecord.getdataListParm.parammaps.contractCode" placeholder="流水编号" style="width: 140px;" class="filter-item" />
-            <el-select v-model="tab1.changeRecord.getdataListParm.parammaps.SHtype" clearable placeholder="变更类型" class="filter-item" style="width: 120px;">
-              <el-option v-for="item in changeTypeList" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>
-            <el-select v-model="tab1.changeRecord.getdataListParm.parammaps.stuteSH" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
-              <el-option v-for="item in auditStatusList" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>
-            <el-date-picker ref="tab1InputDatetime3" v-model="tab1.changeRecord.getdataListParm.parammaps.tab1InputDatetime3" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
-            <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleTab1Filter3">搜索</el-button>
-          </div>
-          <div class="filter-container">
-            <el-radio-group v-model="tab1.changeRecord.radioAll" style="margin-top:-9px" @change="changeChangeRecordAll()">
-              <el-radio-button label="全部" />
-              <el-radio-button label="待处理" />
-              <el-radio-button label="已处理" />
-            </el-radio-group>
-          </div>
-          <el-table
-            :key="tab1.changeRecord.tableKey"
-            v-loading="tab1.changeRecord.listLoading"
-            element-loading-text="给我一点时间"
-            :data="tab1.changeRecord.list"
-            border
-            fit
-            highlight-current-row
-            style="width: 100%;"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable table-fixed"
-            :max-height="myHeight"
-          >
-            <el-table-column label="序号" align="center" type="index" width="50px">
-              <template slot-scope="scope">
-                <span>{{ scope.$index + (tab1.changeRecord.pageNum-1) * tab1.changeRecord.pageSize + 1 }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="流水编号" min-width="120px" align="center" prop="contractCode" />
-            <el-table-column label="变更类型" min-width="110px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.SHtype == 0">新增合同</span>
-                <span v-if="scope.row.SHtype == 1">新增备件</span>
-                <span v-if="scope.row.SHtype == 2">变更备件</span>
-                <span v-if="scope.row.SHtype == 3">合同变更</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="录入人" min-width="120px" align="center" prop="creatorMan" />
-            <el-table-column label="录入时间" sortable min-width="120px" align="center" prop="creatorTime" />
-            <el-table-column label="审核状态" min-width="110px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.SHStatus == 2 || scope.row.SHStatus == 3 || scope.row.SHStatus == 5">审核中</span>
-                <span v-if="scope.row.SHStatus == 4 || scope.row.SHStatus == 6 || scope.row.SHStatus == 8">未通过</span>
-                <span v-if="scope.row.SHStatus == 7">通过</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="操作" align="center" width="350px" class-name="small-padding fixed-width" fixed="right">
-              <template slot-scope="{row}">
-                <el-button type="primary" size="mini" @click="handleTab1See3(row)">查看</el-button>
-                <el-button v-if="tab1.changeRecord.isContractDelete && (row.SHStatus == 4 || row.SHStatus == 6 || row.SHStatus == 8)" type="success" size="mini" @click="handleTab1Update3(row)">编辑</el-button>
-                <el-button v-if="tab1.changeRecord.isContractExamineZG && row.SHStatus == 2" type="success" style="display:inline-block" size="mini" @click="handleTab1Examine(row)">审核1</el-button>
-                <el-button v-else type="success" style="display:none" size="mini" @click="handleTab1Examine(row)">审核1</el-button>
-                <!-- 设备助理审核 -->
-                <!-- <el-button v-if="tab1.changeRecord.isContractExamineZL && row.SHStatus == 3" type="success" style="display:inline-block" size="mini" @click="handleExamine2(row)">审核2</el-button>
-                <el-button v-else type="success" style="display:none" size="mini" @click="handleExamine2(row)">审核2</el-button> -->
-                <!-- 设备中心审核 -->
-                <el-button v-if="tab1.changeRecord.isContractExamineZX && row.SHStatus == 5" type="success" style="display:inline-block" size="mini" @click="handleTab1Examine3(row)">审核2</el-button>
-                <el-button v-else type="success" style="display:none" size="mini" @click="handleTab1Examine3(row)">审核2</el-button>
-                <el-button v-if="tab1.changeRecord.isContractDelete && (row.SHStatus == 4 || row.SHStatus == 6 || row.SHStatus == 8) " type="danger" size="mini" @click="handleTab1Delete3(row)">删除</el-button>
-                <el-button v-else style="display:none" type="danger" size="mini" @click="handleTab1Delete3(row)">删除</el-button>
-              </template>
-            </el-table-column>
-          </el-table>
-          <pagination v-show="tab1.changeRecord.total>0" :total="tab1.changeRecord.total" :page.sync="tab1.changeRecord.getdataListParm.offset" :limit.sync="tab1.changeRecord.getdataListParm.pagecount" @pagination="getTab1List3" />
-        </div>
-      </el-tab-pane>
-      <el-tab-pane label="合同明细" name="second">
-        <div class="filter-container">
-          <el-select v-model="tab2.getdataListParm.parammaps.pastureName" placeholder="牧场" style="width:120px" class="filter-item">
-            <el-option v-for="item in findAllPastureList2" :key="item.id" :label="item.name" :value="item.name" />
-          </el-select>
-          <el-input v-model="tab2.getdataListParm.parammaps.contractCode" placeholder="合同编号" style="width: 140px;" class="filter-item" />
-          <el-select v-model="tab2.getdataListParm.parammaps.statue" clearable placeholder="合同状态" class="filter-item" style="width: 120px;">
-            <el-option v-for="item in contractStatusList" :key="item.id" :label="item.name" :value="item.name" />
-          </el-select>
-          <el-select v-model="tab2.getdataListParm.parammaps.isZeroStock" clearable placeholder="是否零库存" class="filter-item" style="width: 120px;">
-              <el-option v-for="item in isZeroInventoryList" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>
-          <el-input v-model="tab2.getdataListParm.parammaps.partCode" placeholder="备件编号" style="width: 140px;" class="filter-item" />
-          <el-input v-model="tab2.getdataListParm.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
-          <el-select v-model="tab2.getdataListParm.parammaps.providerName" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
-            <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.name" />
-          </el-select>
-          <el-date-picker ref="inputDatetime" v-model="tab2.getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
-          <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleTab2Filter">搜索</el-button>
-          <el-button v-if="tab1.contractManagement.isContractExport" class="filter-item" type="primary" icon="el-icon-edit" @click="handleTab2Export">导出</el-button>
-        </div>
-        <el-table
-          :key="tab2.tableKey"
-          v-loading="tab2.listLoading"
-          element-loading-text="给我一点时间"
-          :data="tab2.list"
-          border
-          fit
-          highlight-current-row
-          style="width: 100%;"
-          :row-style="rowStyle"
-          :cell-style="cellStyle"
-          class="elTable table-fixed"
-          @sort-change="tableSort2"
-          :max-height="myHeight"
-        >
-          <el-table-column label="序号" align="center" type="index" width="50px">
-            <template slot-scope="scope">
-              <span>{{ scope.$index + (tab2.pageNum-1) * tab2.pageSize + 1 }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="牧场" min-width="110px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.pastureName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="合同编号" min-width="130px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.contractCode }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="合同状态" min-width="100px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.statue }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="供应商" min-width="120px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.providerName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="合同开始日期" sortable prop="startTime" min-width="110px" align="center" />
-          <el-table-column label="合同截止日期" sortable prop="stopTime" min-width="110px" align="center" />
-          <el-table-column label="零库存" min-width="110px" align="center">
-            <template slot-scope="scope">
-              <span v-if="scope.row.isZeroStock == 0">否</span>
-              <span v-if="scope.row.isZeroStock == 1">是</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="备件编号" min-width="110px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.partCode }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="备件名称" min-width="110px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.partName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="备件规格" min-width="110px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.specification }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="备件品牌" min-width="110px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.brand }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="计量单位" min-width="110px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.unit }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="计划量" sortable prop="planAmount" min-width="110px" align="center" />
-          <el-table-column label="单价" sortable prop="price" min-width="110px" align="center" />
-          <el-table-column label="备注" min-width="110px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.remark }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="录入人" min-width="110px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.creatorMan }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="录入日期" sortable prop="creatorTime" min-width="110px" align="center" />
-        </el-table>
-        <pagination v-show="tab2.total>0" :total="tab2.total" :page.sync="tab2.getdataListParm.offset" :limit.sync="tab2.getdataListParm.pagecount" @pagination="getTab2List" />
-      </el-tab-pane>
-    </el-tabs>
-    <!-- 合同管理新增/查看/变更 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="tab1.contractManagement.create.dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <div class="app-add">
-        <el-form ref="createTemp" :rules="rules" :model="tab1.contractManagement.create.temp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="合同编号:" prop="contractCode">
-                <el-input ref="contractCode" v-model="tab1.contractManagement.create.temp.contractCode" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="牧场:" prop="pastureId">
-                <el-select v-model="tab1.contractManagement.create.temp.pastureId" placeholder="牧场" class="filter-item" style="width:100%;" :disabled="disabled">
-                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="供应商:" prop="providerName">
-                <el-autocomplete v-model="tab1.contractManagement.create.temp.providerName" :disabled="dialogStatus==='see' || tab1.contractManagement.isDisabled || dialogStatus==='change'" value-key="name" class="inline-input" :fetch-suggestions="providerSearch" placeholder="请输入供应商名称或供应商编号" style="width:100%;" @focus="handleFocusProvider" @blur="handleBlurProvider" @select="handleSelectProvider" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="开始日期:" prop="startTime">
-                <el-date-picker v-model="tab1.contractManagement.create.temp.startTime" :disabled="dialogStatus==='see' || tab1.contractManagement.isDisabled || dialogStatus==='change'" type="date" placeholder="开始日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTime" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="截止日期:" prop="stopTime">
-                <el-date-picker v-model="tab1.contractManagement.create.temp.stopTime" style="width:100%;" :disabled="dialogStatus==='see' || tab1.contractManagement.isDisabled" type="date" :clearable="false" placeholder="截止日期" :picker-options="pickerOptions2" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTime" />
-              </el-form-item>
-            </el-col>
-            <el-col v-if="dialogStatus=='create'" :span="8">
-              <el-form-item label="合同状态:" prop="statue">
-                <el-select v-model="tab1.contractManagement.create.temp.statue" clearable placeholder="合同状态" class="filter-item" style="width: 100%;" disabled>
-                  <el-option v-for="item in contractStatus2List" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col v-if="dialogStatus=='change' || dialogStatus=='see'" :span="8">
-              <el-form-item label="合同状态:" prop="statued">
-                <el-input ref="contractCode" v-model="tab1.contractManagement.create.temp.statued" placeholder="合同状态" disabled />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="零库存:" prop="isZeroStock">
-                <el-radio-group v-model="tab1.contractManagement.create.temp.isZeroStock" :disabled="dialogStatus==='see' || tab1.contractManagement.isDisabled || dialogStatus==='change'" @change="changeIsZero">
-                  <el-radio v-model="tab1.contractManagement.create.temp.isZeroStock" :label="1">是</el-radio>
-                  <el-radio v-model="tab1.contractManagement.create.temp.isZeroStock" :label="0">否</el-radio>
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="录入人:" prop="creatorId">
-                <el-select ref="creatorId" v-model="tab1.contractManagement.create.temp.creatorId" :disabled="tab1.contractManagement.isDisabled || dialogStatus==='see' || dialogStatus==='change'" placeholder="录入人" class="filter-item" style="width:100%;" @change="changeCreatorMan">
-                  <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="录入日期:" prop="creatorTime">
-                <el-date-picker v-model="tab1.contractManagement.create.temp.creatorTime" :disabled="disabled" type="date" :picker-options="pickerOptions3" placeholder="录入日期" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="备注:" prop="remark">
-                <el-input ref="remark" v-model="tab1.contractManagement.create.temp.remark" placeholder="备注" :disabled="tab1.contractManagement.isDisabled || dialogStatus==='see' || dialogStatus==='change'" />
-              </el-form-item>
-            </el-col>
-            <el-col v-if="dialogStatus !== 'see'" :span="8">
-              <el-form-item label="同步牧场:" prop="synchronousPasture">
-                <el-select v-model="tab1.contractManagement.create.temp.synchronousPasture" multiple collapse-tags placeholder="同步牧场" :disabled="isGroupAdministrator !== '18'">
-                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col v-else :span="16">
-              <el-form-item label="同步牧场:" prop="pastureName2">
-                <el-input v-model="tab1.contractManagement.create.temp.pastureName2" type="textarea" :rows="2" placeholder="同步牧场" :disabled="dialogStatus=='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <!-- <el-row v-if="dialogStatus == 'see'">
-            <el-col>
-              <el-form-item label="流程进度1" />
-              <el-steps :active="tab1.contractManagement.create.temp.active" align-center finish-status="success">
-                <el-step
-                  v-for="(item,index) in tab1.contractManagement.create.temp.activeList"
-                  :key="index"
-                  :title="item.title"
-                  :status="item.status"
-                >
-                  <template slot="description">
-                    <div class="step-row">
-                      <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
-                      <div>{{ item.reason }}</div>
-                    </div>
-                  </template>
-                </el-step>
-              </el-steps>
-            </el-col>
-          </el-row> -->
-        </el-form>
-        <div slot="footer" class="dialog-footer" style="bottom:5px">
-          <el-button v-if="dialogStatus =='change'" type="primary" @click="terminationData()">终止合同</el-button>
-          <el-button v-if="dialogStatus !=='see'" type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():changeData()">保存并关闭</el-button>
-          <el-button @click="tab1.contractManagement.create.dialogFormVisible = false;getTab1List();tab1.contractManagement.create.temp.providerName=''">取消并关闭</el-button>
-        </div>
-      </div>
-    </el-dialog>
-
-    <!-- 备件明细新增/变更 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="tab1.detailsSpareParts.create.dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <div v-if="tab1.detailsSpareParts.updateList.SHtype !== 0 && tab1.detailsSpareParts.updateList.SHtype !== 3" class="app-add">
-        <el-form ref="createTemp2" :rules="rules" :model="tab1.detailsSpareParts.create.temp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
-          <el-row>
-            <el-col :span="10">
-              <el-form-item label="备件:" prop="partCode">
-                <el-autocomplete v-model="tab1.detailsSpareParts.partCode" value-key="name1" class="inline-input" :fetch-suggestions="sparePartSearch" placeholder="请输入备件编号或备件名称或备件规格" style="width:550px" @select="handleSelectSparePart">
-                  <template slot-scope="{ item }">
-                    <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
-                    |  &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
-                    |  &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
-                  </template>
-                </el-autocomplete>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <div v-if="dialogStatus=='tab1create2'" class="filter-container" style="float: right;">
-          <el-button v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleTab1DownloadTemp2">模板</el-button>
-          <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
-            <el-button v-waves :disabled="tab1.detailsSpareParts.isDisabledImport" class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
-          </el-upload>
-        </div>
-        <el-table
-          :key="tab1.detailsSpareParts.tableKeyAdd"
-          v-loading="tab1.detailsSpareParts.listLoadingAdd"
-          element-loading-text="给我一点时间"
-          :data="tab1.detailsSpareParts.listAdd"
-          border
-          fit
-          highlight-current-row
-          style="width: 100%;"
-          :row-style="rowStyle"
-          :cell-style="cellStyle"
-          class="elTable table-fixed"
-        >
-          <el-table-column label="序号" align="center" type="index" width="50px" />
-          <el-table-column label="备件编号" min-width="90px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.partCode }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="备件名称" min-width="80px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.partName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="备件规格" min-width="80px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.specification }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
-            <template slot-scope="scope">
-              <el-popover placement="right" title="" trigger="hover">
-                <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
-                <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
-              </el-popover>
-            </template>
-          </el-table-column>
-          <el-table-column label="备件品牌" min-width="120px" align="center">
-            <template slot-scope="scope">
-              <el-autocomplete v-model="scope.row.brand" value-key="brandName" class="inline-input" :fetch-suggestions="brandSearch" placeholder="请输入品牌" style="width:100%;" @focus="handleFocusBrand( scope.row)" @blur="handleBlurBrand(scope.row)" @select="(value)=> {handleSelectBrand(value, scope.row)}" />
-            </template>
-          </el-table-column>
-          <el-table-column label="计量单位" min-width="60px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.unit }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="计划量" min-width="70px" align="center" valign="middle">
-            <template slot-scope="scope">
-              <el-form :model="scope.row" :rules="rules">
-                <el-form-item prop="planAmount">
-                  <el-input ref="planAmount" v-model="scope.row.planAmount" style="margin-top:15px" />
-                </el-form-item>
-              </el-form>
-            </template>
-          </el-table-column>
-          <el-table-column label="单价" min-width="80px" align="center" valign="middle">
-            <template slot-scope="scope">
-              <el-input v-model="scope.row.price" />
-            </template>
-          </el-table-column>
-          <el-table-column label="使用周期" min-width="110px" align="center" valign="middle">
-              <template slot-scope="scope">
-                <el-input v-model="scope.row.lifeCycle" />
-              </template>
-            </el-table-column>
-            <el-table-column label="合同差异项" min-width="110px" align="center" valign="middle">
-              <template slot-scope="scope">
-                <el-input v-model="scope.row.contractVarianceItem" />
-              </template>
-            </el-table-column>
-          <el-table-column label="备注" min-width="110px" align="center">
-            <template slot-scope="scope">
-              <el-input v-model="scope.row.remark" type="textarea" placeholder="备注" autosize maxlength="100" show-word-limit />
-            </template>
-          </el-table-column>
-          <el-table-column label="操作" align="center" width="100px" class-name="small-padding fixed-width" fixed="right">
-            <template slot-scope="{row}">
-              <a class="del" :disabled="isokDisable" @click="partDelete(row)">删除</a>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <div v-if="tab1.detailsSpareParts.updateList.SHtype == 0 || tab1.detailsSpareParts.updateList.SHtype == 3" class="app-add">
-        <el-form ref="createTemp2" :rules="rules" :model="tab1.detailsSpareParts.create.temp" label-position="right" label-width="130px" style="width: 90%;margin:0 auto;">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="牧场:" prop="pastureName">
-                <el-input ref="pastureName" v-model="tab1.detailsSpareParts.create.temp.pastureName" placeholder="牧场" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="合同编号:" prop="contractCode">
-                <el-input ref="contractCode" v-model="tab1.detailsSpareParts.create.temp.contractCode" placeholder="合同编号" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="供应商:" prop="providerName">
-                <el-input ref="providerName" v-model="tab1.detailsSpareParts.create.temp.providerName" placeholder="合同编号" disabled />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="开始日期:" prop="startTime">
-                <el-date-picker v-model="tab1.detailsSpareParts.create.temp.startTime" :disabled="tab1.detailsSpareParts.create.temp.SHtype == 3" type="date" placeholder="开始日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
-              </el-form-item>
-            </el-col>
-            <el-col v-if="dialogStatus == 'tab1Update2' && tab1.detailsSpareParts.updateList.SHtype == 0" :span="8">
-              <el-form-item label="截止日期:" prop="stopTime">
-                <el-date-picker v-model="tab1.detailsSpareParts.create.temp.stopTime" type="date" placeholder="截止日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
-              </el-form-item>
-            </el-col>
-            <el-col v-if="dialogStatus == 'tab1Update2' && tab1.detailsSpareParts.updateList.SHtype !== 0" :span="8">
-              <el-form-item label="截止日期后:" prop="stopTimeHis">
-                <el-date-picker v-model="tab1.detailsSpareParts.create.temp.stopTimeHis" type="date" placeholder="截止日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :picker-options="pickerOptions2" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="合同状态:" prop="statued">
-                <span>{{ tab1.detailsSpareParts.create.temp.statued }}</span>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="零库存:" prop="isZeroStock">
-                <el-radio-group v-model="tab1.detailsSpareParts.create.temp.isZeroStock" :disabled="tab1.detailsSpareParts.create.temp.SHtype == 3">
-                  <el-radio v-model="tab1.detailsSpareParts.create.temp.isZeroStock" :label="1">是</el-radio>
-                  <el-radio v-model="tab1.detailsSpareParts.create.temp.isZeroStock" :label="0">否</el-radio>
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="录入人:" prop="creatorMan">
-                <el-input ref="creatorMan" v-model="tab1.detailsSpareParts.create.temp.creatorMan" placeholder="录入人" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="录入日期:" prop="creatorTime">
-                <el-date-picker v-model="tab1.detailsSpareParts.create.temp.creatorTime" :disabled="tab1.detailsSpareParts.create.temp.SHtype == 3 || dialogStatus=='tab1Update2' " type="date" placeholder="截止日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="备注:" prop="remark">
-                <el-input ref="remark" v-model="tab1.detailsSpareParts.create.temp.remark" placeholder="备注" />
-              </el-form-item>
-            </el-col>
-            <el-col v-if="tab1.detailsSpareParts.create.temp.SHtype !== 0 && dialogStatus !=='tab1Update2'" :span="8">
-              <el-form-item label="变更后截止日期:" prop="stopTimeHis">
-                <el-date-picker v-model="tab1.detailsSpareParts.create.temp.stopTimeHis" :disabled="tab1.detailsSpareParts.create.temp.SHtype !== 3" type="date" placeholder="截止日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :picker-options="pickerOptions2" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-      </div>
-      <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
-        <el-button v-if="dialogStatus=='tab1create2'" type="primary" :disabled="isokDisable" @click="add_dialog_save2()">保存并关闭</el-button>
-        <el-button v-if="dialogStatus=='tab1change2'" type="primary" :disabled="isokDisable" @click="changeData2()">保存并关闭</el-button>
-        <el-button v-if="dialogStatus=='tab1Update2'" type="primary" :disabled="isokDisable" @click="edit_dialog_save2()">保存并关闭</el-button>
-        <el-button @click="tab1.detailsSpareParts.create.dialogFormVisible = false;">关闭</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 变更记录查看 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="tab1.changeRecord.see.dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <div class="app-see">
-        <div class="app-contentcard">
-          <el-form ref="seeTemp" :rules="rules" :model="tab1.changeRecord.see.temp" label-position="right" label-width="128px" style="width: 90%;margin:0 auto;">
-            <div v-if="tab1.changeRecord.see.temp.SHtype == 0 || tab1.changeRecord.see.temp.SHtype == 3">
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="牧场:" prop="pastureName">
-                    <span> {{ tab1.changeRecord.see.temp.pastureName }} </span>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item label="合同编号:" prop="contractCode">
-                    <span> {{ tab1.changeRecord.see.temp.contractCode }} </span>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item label="供应商:" prop="providerName">
-                    <span> {{ tab1.changeRecord.see.temp.providerName }} </span>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="开始日期:" prop="startTime">
-                    <span> {{ tab1.changeRecord.see.temp.startTime }} </span>
-                  </el-form-item>
-                </el-col>
-                <el-col v-if="dialogStatus !== 'tab1See2'" :span="8">
-                  <el-form-item label="截止日期:" prop="stopTime">
-                    <span> {{ tab1.changeRecord.see.temp.stopTime }} </span>
-                  </el-form-item>
-                </el-col>
-                <el-col v-if="dialogStatus == 'tab1See2' && tab1.changeRecord.see.temp.SHtype !== 3 && tab1.changeRecord.see.temp.SHtype !== 0" :span="8">
-                  <el-form-item label="截止日期:" prop="stopTimeHis">
-                    <span> {{ tab1.changeRecord.see.temp.stopTimeHis }} </span>
-                  </el-form-item>
-                </el-col>
-                <el-col v-if="dialogStatus == 'tab1See2' && tab1.changeRecord.see.temp.SHtype == 3" :span="8">
-                  <el-form-item label="截止日期:" prop="stopTime">
-                    <span> {{ tab1.changeRecord.see.temp.stopTime }} </span>
-                  </el-form-item>
-                </el-col>
-                <el-col v-if="dialogStatus == 'tab1See2' && tab1.changeRecord.see.temp.SHtype == 0" :span="8">
-                  <el-form-item label="截止日期:" prop="stopTime">
-                    <span> {{ tab1.changeRecord.see.temp.stopTime }} </span>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item label="合同状态:" prop="statued">
-                    <span>{{ tab1.changeRecord.see.temp.statued }}</span>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="零库存:" prop="isZeroStock">
-                    <el-radio-group v-model="tab1.changeRecord.see.temp.isZeroStock" disabled>
-                      <el-radio v-model="tab1.changeRecord.see.temp.isZeroStock" :label="1">是</el-radio>
-                      <el-radio v-model="tab1.changeRecord.see.temp.isZeroStock" :label="0">否</el-radio>
-                    </el-radio-group>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item label="录入人:" prop="creatorMan">
-                    <span> {{ tab1.changeRecord.see.temp.creatorMan }} </span>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item label="录入日期:" prop="creatorTime">
-                    <span> {{ tab1.changeRecord.see.temp.creatorTime }} </span>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="备注:" prop="remark">
-                    <span> {{ tab1.changeRecord.see.temp.remark }} </span>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item label="共享牧场:" prop="pastureNamesOld">
-                    <span> {{ tab1.changeRecord.see.temp.pastureNamesOld }} </span>
-                  </el-form-item>
-                </el-col>
-                <el-col v-if="tab1.changeRecord.see.temp.SHtype == 3" :span="8">
-                  <el-form-item label="变更后截止日期:" prop="stopTimeHis">
-                    <span> {{ tab1.changeRecord.see.temp.stopTimeHis }} </span>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="变更后共享牧场:" prop="pastureNamesNow">
-                    <span> {{ tab1.changeRecord.see.temp.pastureNamesNow }} </span>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </div>
-            <div v-if="tab1.changeRecord.see.temp.SHtype == 1 || tab1.changeRecord.see.temp.SHtype == 2">
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="流水编号:" prop="contractCode">
-                    <span> {{ tab1.changeRecord.see.temp.contractCode }} </span>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item label="录入人:" prop="creatorMan">
-                    <span> {{ tab1.changeRecord.see.temp.creatorMan }} </span>
-                  </el-form-item>
-                </el-col>
-                <el-col :span="8">
-                  <el-form-item label="录入日期:" prop="creatorTime">
-                    <span> {{ tab1.changeRecord.see.temp.creatorTime }} </span>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </div>
-          </el-form>
-          <div v-if="tab1.changeRecord.see.temp.SHtype == 1">
-            <el-table
-              :key="tab1.changeRecord.see.tableKey"
-              element-loading-text="给我一点时间"
-              :data="tab1.changeRecord.see.list"
-              border
-              fit
-              highlight-current-row
-              style="width: 100%;"
-              :row-style="rowStyle"
-              :cell-style="cellStyle"
-              class="elTable table-fixed"
-            >
-              <el-table-column label="序号" align="center" type="index" width="50px">
-                <template slot-scope="scope">
-                  <span>{{ scope.$index + (tab1.changeRecord.see.pageNum-1) * tab1.changeRecord.see.pageSize + 1 }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备件编号" min-width="110px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.partCode }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备件名称" min-width="130px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.partName }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备件规格" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.specification }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
-                <template slot-scope="scope">
-                  <el-popover placement="right" title="" trigger="hover">
-                    <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
-                    <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
-                  </el-popover>
-                </template>
-              </el-table-column>
-              <el-table-column label="备件品牌" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.brand }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="计量单位" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.unit }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="计划量" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.planAmount }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="单价" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.price }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备注" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.remark }}</span>
-                </template>
-              </el-table-column>
-            </el-table>
-            <pagination v-show="tab1.changeRecord.see.total>0" :total="tab1.changeRecord.see.total" :page.sync="tab1.changeRecord.see.getdataListParm.offset" :limit.sync="tab1.changeRecord.see.getdataListParm.pagecount" @pagination="getTab1List3See" />
-          </div>
-          <div v-if="tab1.changeRecord.see.temp.SHtype == 2">
-            <el-table
-              :key="tab1.changeRecord.see.tableKey"
-              element-loading-text="给我一点时间"
-              :data="tab1.changeRecord.see.list"
-              border
-              fit
-              highlight-current-row
-              style="width: 100%;"
-              :row-style="rowStyle"
-              :cell-style="cellStyle"
-              class="elTable table-fixed"
-            >
-              <el-table-column label="序号" align="center" type="index" width="50px">
-                <template slot-scope="scope">
-                  <span>{{ scope.$index + (tab1.changeRecord.see.pageNum-1) * tab1.changeRecord.see.pageSize + 1 }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备件编号" min-width="110px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.partCode }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备件名称" min-width="130px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.partName }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备件规格" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.specification }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
-                <template slot-scope="scope">
-                  <el-popover placement="right" title="" trigger="hover">
-                    <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
-                    <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
-                  </el-popover>
-                </template>
-              </el-table-column>
-              <el-table-column label="备件品牌" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.brandhis }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="变更后品牌" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.brand }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="计量单位" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.unit }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="计划量" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.planAmounthis }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="变更后计划量" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.planAmount }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="单价" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.pricehis }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="变更后单价" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.price }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备注" min-width="80px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.remark }}</span>
-                </template>
-              </el-table-column>
-            </el-table>
-            <pagination v-show="tab1.changeRecord.see.total>0" :total="tab1.changeRecord.see.total" :page.sync="tab1.changeRecord.see.getdataListParm.offset" :limit.sync="tab1.changeRecord.see.getdataListParm.pagecount" @pagination="getTab1List3See" />
-          </div>
-          <el-form ref="seeTemp" :rules="rules" :model="tab1.changeRecord.see.temp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
-            <el-row>
-              <el-col>
-                <el-form-item label="流程进度" />
-                <el-steps :active="tab1.changeRecord.see.active" align-center finish-status="success">
-                  <el-step
-                    v-for="(item,index) in tab1.changeRecord.see.activeList"
-                    :key="index"
-                    :title="item.title"
-                    :status="item.status"
-                  >
-                    <template slot="description">
-                      <div class="step-row">
-                        <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
-                        <div>{{ item.reason }}</div>
-                      </div>
-                    </template>
-                  </el-step>
-                </el-steps>
-              </el-col>
-            </el-row>
-            <el-row>
-              <el-col>
-                <el-form-item label="操作:">
-                  <!-- 设备主管审核 -->
-                  <el-button v-if="tab1.changeRecord.isContractExamineZG &&tab1.changeRecord.see.temp.SHStatus == 2" type="success" style="display:inline-block" @click="handleTab1Examine()">审核1</el-button>
-                  <el-button v-else type="success" style="display:none" @click="handleTab1Examine()">审核1</el-button>
-                  <!-- 设备助理审核 -->
-                  <!-- <el-button v-if="isContractExamineZL && seeTemp.SHStatus == 3" type="success" style="display:inline-block" @click="handleExamine2()">审核2</el-button>
-                  <el-button v-else type="success" style="display:none" @click="handleExamine2()">审核2</el-button> -->
-
-                  <!-- 设备中心审核 -->
-                  <el-button v-if="tab1.changeRecord.isContractExamineZX && tab1.changeRecord.see.temp.SHStatus == 5" type="success" style="display:inline-block" @click="handleTab1Examine3()">审核2</el-button>
-                  <el-button v-else type="success" style="display:none" @click="handleTab1Examine3()">审核2</el-button>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </div>
-        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
-          <el-button @click="tab1.changeRecord.see.dialogFormVisible = false">关闭</el-button>
-        </div>
-      </div>
-    </el-dialog>
-    <!-- 变更记录审核 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="tab1.changeRecord.examine.dialogFormVisible" :close-on-click-modal="false" width="30%">
-      <div class="app-examine">
-        <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
-        <el-form ref="examineTemp" :rules="rules" :model="tab1.changeRecord.examine.temp" label-position="right" style="width: 50%;margin:0 auto;">
-          <el-row style="width:88%;height:150px;margin:0 auto;">
-            <el-col :span="20">
-              <el-form-item>
-                <el-radio-group v-model="tab1.changeRecord.examine.temp.statueSH" @change="changeExamineStatue">
-                  <el-radio :label="1" checked>通过</el-radio>
-                  <el-radio :label="2">不通过</el-radio>
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-            <el-col v-if="tab1.changeRecord.examine.isReason" :span="20">
-              <el-input v-model="tab1.changeRecord.examine.temp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
-            </el-col>
-          </el-row>
-        </el-form>
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button v-if="dialogStatus==='tab1examine'" type="primary" :disabled="isokDisable" @keyup.enter.native="createExamineData()" @click="createExamineData()">确认</el-button>
-        <!-- <el-button v-if="dialogStatus==='tab1examine2'" type="primary" :disabled="isokDisable" @click="createExamineData2()">确认</el-button> -->
-        <el-button v-if="dialogStatus==='tab1examine3'" type="primary" :disabled="isokDisable" @keyup.enter.native="createExamineData3()" @click="createExamineData3()">确认</el-button>
-        <el-button @click="tab1.changeRecord.examine.dialogFormVisible = false;">关闭</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-// 引入
-import { GetDataByName, GetDataByNames, checkButtons, ExecDataByConfig, UpdateDataRelation, PostDataByName, failproccess,postJson } from '@/api/common'
-import waves from '@/directive/waves'
-import { parseTime, json2excel, sortChange } from '@/utils/index.js'
-import Pagination from '@/components/Pagination'
-import Cookies from 'js-cookie'
-import { getToken } from '@/utils/auth'
-import { MessageBox } from 'element-ui'
-export default {
-  inject: ['reload'],
-  name: 'ContractManagement',
-  components: { Pagination },
-  directives: { waves },
-  data() {
-    return {
-      selectList:[],
-      contractCodese:'',
-      isGroupAdministrator: Cookies.get('pastureid'),
-      isEmployeid: Cookies.get('employeid'),
-      isPercentage: false,
-      percentage: 1,
-      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      buttons: [],
-      activeName: 'first',
-      contractStatusList: [{ id: '0', name: '正常' }, { id: '1', name: '已过期' }, { id: '2', name: '终止' }, { id: '3', name: '新增未通过' }],
-      contractStatus2List: [{ id: '1', name: '正常' }, { id: '0', name: '终止' }],
-      auditStatusList: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }], // 审核状态
-      changeTypeList: [{ id: '0', name: '新增合同' }, { id: '1', name: '新增备件' }, { id: '2', name: '变更备件' }, { id: '3', name: '合同变更' }],
-      isZeroInventoryList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 是否零库存
-      findAllProvider: [], findAllAssetType: [], findAllPasture: [], findAllPastureList2: [], findAllDepart: [], findAllEmploye: [], findAllCategory: [],
-      requestParams: [
-        { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
-        { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllPastureForContract', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': 18 }},
-        { name: 'findAllDepart', offset: 0, pagecount: 0, params: [] },
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': 18 }},
-        { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] }
-      ],
-      isokDisable: false,
-      disabled: true,
-      rules: {},
-      textMap: {
-        create: '新增合同',
-        see: '查看详情',
-        change: '变更合同',
-        tab1create2: '新增备件',
-        tab1change2: '变更备件',
-        tab1examine: '审核',
-        tab1examine2: '审核2',
-        tab1examine3: '审核2',
-        tab1See2: '查看',
-        tab1Update2: '编辑'
-      },
-      dialogStatus: '',
-      isContractManagement: true, // 备件合同
-      isDetailsSpareParts: false, // 备件明细
-      isChangeRecord: false, // 变更记录
-      tab1: {
-        // 合同管理1
-        contractManagement: {
-          radioAll: '全部',
-          isContractAdd: [],
-          isContractExport: [],
-          isContractUplaod: [],
-          isContractSee: [],
-          isContractChange: [],
-          isDisabled: false,
-          tableKey: 0,
-          listLoading: false,
-          total: 0,
-          list: [],
-          getdataListParm: {
-            name: 'providerPactListV2',
-            page: 1,
-            offset: 1,
-            pagecount: 10,
-            returntype: 'Map',
-            parammaps: {
-              loginid: Cookies.get('employeid'),
-              pastureName: Cookies.get('pasturename'),
-              contractCode: '',
-              statue: '',
-              stuteSH: '',
-              providerName: '',
-              tab1InputDatetime1: '',
-              startTime: '',
-              stopTime: '',
-              tab1InputDatetime2: '',
-              SHdateTimeF: '',
-              SHdateTimeE: '',
-              SHnums: 2
-            }
-          },
-          getParmCreateNumber: {
-            name: 'autoCreatCode',
-            page: 0,
-            offset: 0,
-            pagecount: 0,
-            returntype: 'Map',
-            parammaps: {
-              pastureId: Cookies.get('pastureid'),
-              codeType: 'HT'
-            }
-          },
-          create: {
-            dialogFormVisible: false,
-            temp: { contractCode: '', pastureId: Cookies.get('pastureid'), providerName: '', startTime: '', stopTime: '', statue: '', isZeroStock: 0, creatorId: Cookies.get('employeid'), creatorMan: Cookies.get('employename'), creatorTime: parseTime(new Date(), '{y}-{m}-{d}'), activeList: [], active: 3, workflowNote: '', synchronousPasture: [], synchronousPastureList: [] },
-            changeEchoParm: { name: 'getBigcontractPId', page: 0, offset: 0, pagecount: 0, returntype: 'Map', parammaps: {}}
-          }
-        },
-        // 合同管理-备件明细
-        detailsSpareParts: {
-          tableKey: 1,
-          listLoading: false,
-          total: 0,
-          list: [],
-          getdataListParm: {
-            name: 'getcontratListBybigV2',
-            page: 1,
-            offset: 1,
-            pagecount: 10,
-            returntype: 'Map',
-            parammaps: {
-              specification: '',
-              partName: '',
-              partCode: '',
-              pastureId: '',
-              providerId: '',
-              stopTime: '',
-              flag: '',
-              isZeroStock: '',
-              statue: ''
-            }
-          },
-          partCode: '',
-          requestSparePart: {
-            name: '',
-            page: 1,
-            offset: 1,
-            pagecount: 20,
-            returntype: 'Map',
-            parammaps: {}
-          },
-          detailsList: [],
-          updateList: [],
-          tableKeyAdd: 0,
-          listLoadingAdd: false,
-          listAdd: [],
-          requestBrand: {
-            name: 'getBrandByPartCode',
-            page: 0,
-            offset: 0,
-            pagecount: 10,
-            returntype: 'Map',
-            parammaps: {}
-          },
-          BrandList: [],
-          create: {
-            dialogFormVisible: false,
-            temp: { contractCode: '', pastureId: Cookies.get('pastureid'), providerName: '', startTime: '', stopTime: '', statue: '', isZeroStock: 0, creatorId: Cookies.get('employeid'), creatorMan: Cookies.get('employename'), creatorTime: parseTime(new Date(), '{y}-{m}-{d}'), activeList: [], active: 3, workflowNote: '' }
-          },
-          isDisabledImport: true,
-          clearImportExcelParm: {
-            name: 'deletecontract_upload',
-            page: 0,
-            offset: 0,
-            pagecount: '',
-            returntype: 'Map',
-            parammaps: {
-              user: Cookies.get('name')
-            }
-          },
-          importExcelParm: {
-            name: 'getcontract_uploadlist',
-            page: 0,
-            offset: 0,
-            pagecount: '',
-            returntype: 'Map',
-            parammaps: {
-              user: Cookies.get('name')
-            }
-          }
-        },
-        // 变更记录
-        changeRecord: {
-          isContractExamineZG: [],
-          //  isContractExamineZL: [],
-          isContractExamineZX: [],
-          isContractDelete: [],
-          isStatueReason: false,
-          isReason: false,
-          radioAll: '全部',
-          tableKey: 2,
-          listLoading: false,
-          total: 0,
-          list: [],
-          getdataListParm: {
-            name: 'providerPactListSH',
-            page: 1,
-            offset: 1,
-            pagecount: 10,
-            returntype: 'Map',
-            parammaps: {
-              loginid: Cookies.get('employeid'),
-              contractCode: '',
-              tab1InputDatetime3: '',
-              startTime: '',
-              stopTime: '',
-              SHStatus: '',
-              SHtype: '',
-              pastureId: '',
-              providerId: '',
-              stopTime1: '',
-              flag: '',
-              isZeroStock: '',
-              statue: '',
-              SHnums: 2,
-              stuteSH: ''
-            }
-          },
-          see: {
-            dialogFormVisible: false,
-            activeList: [], active: 3,
-            temp: {},
-            tableKey: 0,
-            listLoading: false,
-            total: 0,
-            list: [],
-            getdataListParm: {
-              name: 'getcontratListBybigSH',
-              returntype: 'Map',
-              page: 0,
-              offset: 0,
-              pagecount: 10,
-              parammaps: {}
-            }
-          },
-          examine: {
-            dialogFormVisible: false,
-            temp: {
-              statueSH: 1
-            },
-            isReason: false
-          }
-        }
-      },
-      postDataPramas: {},
-      // 开始日期
-      // pickerOptions1: {
-      //   disabledDate: (time) => {
-      //     if (this.tab1.contractManagement.create.temp.stopTime !== '') {
-      //       return parseTime(time.getTime(), '{y}-{m}-{d}') > parseTime(Date.now(), '{y}-{m}-{d}') || parseTime(time.getTime(), '{y}-{m}-{d}') >= this.tab1.contractManagement.create.temp.stopTime
-      //     } else {
-      //       return time.getTime() > Date.now()
-      //     }
-      //   }
-      // },
-      // 截止日期
-      pickerOptions2: {
-        disabledDate: (time) => {
-          return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.tab1.contractManagement.create.temp.startTime || parseTime(time.getTime(), '{y}-{m}-{d}') < parseTime(Date.now(), '{y}-{m}-{d}')
-        }
-      },
-      pickerOptions3: {
-        disabledDate(time) {
-          return time.getTime() > Date.now()// 当天之前的时间可选
-        }
-      },
-      // 合同明细
-      tab2: {
-        tableKey: 0,
-        listLoading: false,
-        total: 0,
-        getdataListParm: {
-          name: 'contractDetailV2',
-          page: 1,
-          offset: 1,
-          pagecount: 10,
-          returntype: 'Map',
-          parammaps: {
-            inputDatetime: '',
-            providerName: '',
-            contractCode: '',
-            stopTime: '',
-            startTime: '',
-            statue: '',
-            partCode: '',
-            partName: '',
-            isZeroStock: '',
-            // pastureName: Cookies.get('pasturename')
-            pastureName: ''
-          }
-        },
-        list: []
-      },
-      UpdateDataParam: {},
-      UpdateDataParam2: {},
-      pending: {
-        total: 0,
-        getdataListParm: {
-          name: 'providerPactListV2', page: 1, offset: 1, getTotal: 'total3', pagecount: 10, returntype: 'Map',
-          parammaps: {}
-        }
-      },
-      myHeight:document.documentElement.clientHeight - 85- 250
-    }
-  },
-  computed: {
-    // 设置请求头
-    headers() {
-      return {
-        token: getToken()
-      }
-    },
-    uploadData() {
-      return {
-        name: 'insertcontract_upload',
-        importParams: '备件编号,备件名称,规格型号,计量单位,品牌,计划量,单价,备注',
-        sheetname: 'SheetJS'
-      }
-    },
-    // 设置上传地址
-    uploadExcelUrl() {
-      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
-    }
-  },
-  created() {
-    // this.keyupSubmit()
-    console.log(this.$route.query.contractCode)
-    this.get_select_list()
-    const that = this
-    GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
-      that.buttons = response.data.list
-      that.get_auto_buttons()
-    })
-
-    this.getTab1List()
-    this.getPendingList()
-    if (this.$route.query.contractCode == undefined) {
-      this.tab1.contractManagement.getdataListParm.parammaps.contractCode = ''
-    } else {
-      this.tab1.contractManagement.getdataListParm.parammaps.contractCode = this.$route.query.contractCode
-    }
-  },
-
-  methods: {
-    tableSort1(column) {
-      sortChange(column, this.tab1.detailsSpareParts.list)
-    },
-    tableSort2(column) {
-      sortChange(column, this.tab2.list)
-    },
-    get_auto_buttons() {
-
-      // 新增
-      const ContractJinyong = 'customs:contract:jinyong'
-      const isContractJinyong = checkButtons(this.$store.state.user.buttons, ContractJinyong)
-      this.isContractJinyong = isContractJinyong
-
-      // 新增
-      const ContractAdd = 'customs:contract:add'
-      const isContractAdd = checkButtons(this.$store.state.user.buttons, ContractAdd)
-      this.tab1.contractManagement.isContractAdd = isContractAdd
-
-      // 查看
-      const ContractSee = 'customs:contract:see'
-      const isContractSee = checkButtons(this.$store.state.user.buttons, ContractSee)
-      this.tab1.contractManagement.isContractSee = isContractSee
-
-      // 办公室主任
-      const ContractExamineZG = 'customs:contract:examineZG'
-      const isContractExamineZG = checkButtons(this.$store.state.user.buttons, ContractExamineZG)
-      this.tab1.changeRecord.isContractExamineZG = isContractExamineZG
-      // 设备中心审核
-      const ContractExamineZX = 'customs:contract:examineZX'
-      const isContractExamineZX = checkButtons(this.$store.state.user.buttons, ContractExamineZX)
-      this.tab1.changeRecord.isContractExamineZX = isContractExamineZX
-      // 审核删除
-      const ContractDelete = 'customs:contract:delete'
-      const isContractDelete = checkButtons(this.$store.state.user.buttons, ContractDelete)
-      this.tab1.changeRecord.isContractDelete = isContractDelete
-      // 导出
-      const ContractExport = 'customs:contract:export'
-      const isContractExport = checkButtons(this.$store.state.user.buttons, ContractExport)
-      this.tab1.contractManagement.isContractExport = isContractExport
-      // SAP上传
-      const ContractUplaod = 'customs:contract:sapupload'
-      const isContractUplaod = checkButtons(this.$store.state.user.buttons, ContractUplaod)
-      this.tab1.contractManagement.isContractUplaod = isContractUplaod
-      // 变更
-      const ContractChange = 'customs:contract:change'
-      const isContractChange = checkButtons(this.$store.state.user.buttons, ContractChange)
-      this.tab1.contractManagement.isContractChange = isContractChange
-    },
-    get_select_list() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.findAllProvider = response.data.findAllProvider.list
-        this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
-        this.findAllPastureList2 = response.data.findAllPastureForContract.list
-        this.findAllDepart = response.data.findAllDepart.list
-        this.findAllEmploye = response.data.findAllEmploye.list
-        this.findAllCategory = response.data.findAllCategory.list
-      })
-    },
-    handleClick() {
-      if (this.tab1.contractManagement.create.temp.activeName == 'first') {
-        console.log('点击了合同管理')
-        this.getTab1List()
-      } else {
-        console.log('点击了合同明细')
-        this.getTab2List()
-      }
-    },
-    getPendingList() {
-      this.pending.getdataListParm.parammaps.loginid = this.tab1.contractManagement.getdataListParm.parammaps.loginid
-      this.pending.getdataListParm.parammaps.pastureName = this.tab1.contractManagement.getdataListParm.parammaps.pastureName
-      this.pending.getdataListParm.parammaps.contractCode = this.tab1.contractManagement.getdataListParm.parammaps.contractCode
-      this.pending.getdataListParm.parammaps.statue = this.tab1.contractManagement.getdataListParm.parammaps.statue
-      this.pending.getdataListParm.parammaps.stuteSH = this.tab1.contractManagement.getdataListParm.parammaps.stuteSH
-      this.pending.getdataListParm.parammaps.providerName = this.tab1.contractManagement.getdataListParm.parammaps.providerName
-      this.pending.getdataListParm.parammaps.tab1InputDatetime1 = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1
-      this.pending.getdataListParm.parammaps.startTime = this.tab1.contractManagement.getdataListParm.parammaps.startTime
-      this.pending.getdataListParm.parammaps.stopTime = this.tab1.contractManagement.getdataListParm.parammaps.stopTime
-      this.pending.getdataListParm.parammaps.tab1InputDatetime2 = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2
-      this.pending.getdataListParm.parammaps.SHdateTimeF = this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeF
-      this.pending.getdataListParm.parammaps.SHdateTimeE = this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeE
-      this.pending.getdataListParm.parammaps.SHnums = 0
-      GetDataByName(this.pending.getdataListParm).then(response => {
-        this.pending.total = response.data.total3
-      })
-    },
-    getTab1List() {
-      this.tab1.contractManagement.listLoading = true
-      if (this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 !== '' && this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 !== null) {
-        this.tab1.contractManagement.getdataListParm.parammaps.startTime = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1[0]
-        this.tab1.contractManagement.getdataListParm.parammaps.stopTime = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1[1]
-      } else {
-        this.tab1.contractManagement.getdataListParm.parammaps.startTime = ''
-        this.tab1.contractManagement.getdataListParm.parammaps.stopTime = ''
-      }
-      if (this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2 !== '' && this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2 !== null) {
-        this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeF = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2[0]
-        this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeE = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2[1]
-      } else {
-        this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeF = ''
-        this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeE = ''
-      }
-      GetDataByName(this.tab1.contractManagement.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          this.tab1.contractManagement.list = response.data.list
-          this.tab1.contractManagement.pageNum = response.data.pageNum
-          this.tab1.contractManagement.pageSize = response.data.pageSize
-        } else {
-          this.tab1.contractManagement.list = []
-        }
-        this.tab1.contractManagement.total = response.data.total
-        setTimeout(() => {
-          this.tab1.contractManagement.listLoading = false
-        }, 300)
-      })
-    },
-    handleTab1Filter() {
-      this.tab1.contractManagement.listLoading = true
-      if (this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 == null) {
-        this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 = ''
-      }
-      if (this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2 == null) {
-        this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2 = ''
-      }
-      this.tab1.contractManagement.getdataListParm.offset = 1
-      this.getTab1List()
-      this.getPendingList()
-      if (this.tab1.contractManagement.radioAll == '全部') {
-        this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 2
-        this.getTab1List()
-      } else if (this.tab1.contractManagement.radioAll == '待处理') {
-        this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 0
-        this.getTab1List()
-      } else if (this.tab1.contractManagement.radioAll == '已处理') {
-        this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 1
-        this.getTab1List()
-      }
-    },
-    changeContractManagementAll() {
-      if (this.tab1.contractManagement.radioAll == '全部') {
-        this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 2
-      } else if (this.tab1.contractManagement.radioAll == '待处理') {
-        this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 0
-      } else if (this.tab1.contractManagement.radioAll == '已处理') {
-        this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 1
-      }
-      this.tab1.contractManagement.getdataListParm.offset = 1
-      this.getTab1List()
-    },
-    changeTime(val) {
-      if (this.tab1.contractManagement.create.temp.stopTime !== '') {
-        if (this.tab1.contractManagement.create.temp.stopTime <= this.tab1.contractManagement.create.temp.startTime) {
-          this.tab1.contractManagement.create.temp.stopTime = ''
-          this.tab1.contractManagement.create.temp.statue = ''
-          this.tab1.contractManagement.create.temp.statueId = ''
-        } else {
-          if (parseTime(new Date(), '{y}-{m}-{d}') <= this.tab1.contractManagement.create.temp.stopTime) {
-            this.tab1.contractManagement.create.temp.statue = '1'
-            // this.tab1.contractManagement.create.temp.statueId = 1
-          } else {
-            this.tab1.contractManagement.create.temp.statue = '0'
-            // this.tab1.contractManagement.create.temp.statueId = 2
-          }
-        }
-      } else {
-        this.tab1.contractManagement.create.temp.statue = ''
-        this.tab1.contractManagement.create.temp.statueId = ''
-      }
-    },
-    changeIsZero(val) {
-      console.log(val)
-    },
-    providerSearch(queryString, cb) {
-      var returnList = this.findAllProvider
-      var results = queryString ? returnList.filter(this.createFilter(queryString)) : returnList
-      // 调用 callback 返回建议列表的数据
-      cb(results)
-    },
-    createFilter(queryString) {
-      return returnValue => {
-        return (
-          returnValue.name.toLowerCase().indexOf(queryString.toLowerCase()) >= 0
-        )
-      }
-    },
-    handleSelectProvider(item) {
-      this.$set(this.tab1.contractManagement.create.temp, 'providerId', item.id)
-      this.$set(this.tab1.contractManagement.create.temp, 'providerName', item.name)
-    },
-    handleFocusProvider() {
-      this.tab1.contractManagement.create.temp.providerId = ''
-      this.tab1.contractManagement.create.temp.providerName = ''
-    },
-    handleBlurProvider() {
-      if (this.tab1.contractManagement.create.temp.providerId == '') {
-        this.tab1.contractManagement.create.temp.providerId = ''
-        this.tab1.contractManagement.create.temp.providerName = ''
-      }
-    },
-    changeCreatorMan(val) {
-      this.tab1.contractManagement.create.temp.creatorMan = this.findAllEmploye.find(obj => obj.id == val).name
-    },
-    resetCreateTemp() {
-      this.tab1.contractManagement.create.temp.synchronousPastureList = []
-      if (Cookies.get('pastureid') == 18) {
-        for (let i = 0; i < this.findAllPasture.length; i++) {
-          this.tab1.contractManagement.create.temp.synchronousPastureList.push(this.findAllPasture[i].id)
-        }
-      } else {
-        this.tab1.contractManagement.create.temp.synchronousPastureList.push(parseInt(Cookies.get('pastureid')))
-      }
-      this.tab1.contractManagement.create.temp = { contractCode: '', pastureId: parseFloat(Cookies.get('pastureid')), providerName: '', startTime: '', stopTime: '', statue: '', isZeroStock: 0, creatorId: parseFloat(Cookies.get('employeid')), creatorMan: Cookies.get('employename'), creatorTime: parseTime(new Date(), '{y}-{m}-{d}'), synchronousPasture: this.tab1.contractManagement.create.temp.synchronousPastureList, synchronousPasture2: [] }
-    },
-    handleTab1Create() {
-      this.resetCreateTemp()
-      this.dialogStatus = 'create'
-      this.tab1.contractManagement.create.dialogFormVisible = true
-      this.getCreateNumber()
-    },
-    getCreateNumber() {
-      GetDataByName(this.tab1.contractManagement.getParmCreateNumber).then(response => {
-        this.$nextTick(() => {
-          console.log('合同编号', response.data.list[0].orderCode)
-          this.tab1.contractManagement.create.temp.contractCode = response.data.list[0].orderCode
-          this.$forceUpdate()
-        })
-      })
-    },
-    add_dialog_save() {
-      console.log('点击了新增保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          if (this.tab1.contractManagement.create.temp.contractCode == '') {
-            GetDataByName(this.getParmCreateNumber).then(response => {
-              this.$nextTick(() => {
-                this.tab1.contractManagement.create.temp.contractCode = response.data.list[0].orderCode
-                this.$forceUpdate()
-                this.saveCreateData()
-              })
-            })
-          } else {
-            this.saveCreateData()
-          }
-        }
-      })
-    },
-    saveCreateData() {
-      this.postDataPramas = {}
-      if (Cookies.get('pastureid') == 18) {
-        if (this.tab1.contractManagement.create.temp.synchronousPasture.indexOf(18) == -1) {
-          this.$message({ type: 'error', message: '当前合同归属于现代牧业,未选中,共享牧场请选中现代牧业!', duration: 2000 })
-          return false
-        }
-      }
-      this.postDataPramas.common = { 'returnmap': '0' }
-      this.postDataPramas.data = []
-      this.postDataPramas.data[0] = { 'name': 'checkbigcontract', 'type': 'v', 'parammaps': {
-        pastureId: this.tab1.contractManagement.create.temp.pastureId,
-        providerId: this.tab1.contractManagement.create.temp.providerId
-      }}
-      this.postDataPramas.data[1] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
-        pastureId: this.tab1.contractManagement.create.temp.pastureId,
-        providerId: this.tab1.contractManagement.create.temp.providerId,
-        providerName: this.tab1.contractManagement.create.temp.providerName,
-        startTime: this.tab1.contractManagement.create.temp.startTime,
-        stopTime: this.tab1.contractManagement.create.temp.stopTime,
-        contractCode: this.tab1.contractManagement.create.temp.contractCode,
-        creatorId: this.tab1.contractManagement.create.temp.creatorId,
-        creatorMan: this.tab1.contractManagement.create.temp.creatorMan,
-        creatorTime: this.tab1.contractManagement.create.temp.creatorTime,
-        isZeroStock: this.tab1.contractManagement.create.temp.isZeroStock,
-        statue: 1,
-        remark: this.tab1.contractManagement.create.temp.remark,
-        SHtype: 0
-      }}
-      var groupRanchList = []
-      for (let i = 0; i < this.tab1.contractManagement.create.temp.synchronousPasture.length; i++) {
-        var obj = {}
-        obj.pastureId = this.tab1.contractManagement.create.temp.synchronousPasture[i]
-        groupRanchList.push(obj)
-      }
-      if (Cookies.get('pastureid') == 18) {
-        this.postDataPramas.data[2] = { 'name': 'insertSpotList', 'resultmaps': { 'list': groupRanchList }}
-        this.postDataPramas.data[2].children = []
-        this.postDataPramas.data[2].children[0] = { 'name': 'insertPastureBigcontract', 'type': 'e', 'parammaps': {
-          bigcontractId: '@insertBigContractV2.LastInsertId',
-          pastureId: '@insertSpotList.pastureId'
-        }}
-      }
-      ExecDataByConfig(this.postDataPramas).then(response => {
-        console.log('新增保存发送参数', this.postDataPramas)
-        if (response.msg == 'fail') {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 = ''
-          this.getTab1List()
-          this.getPendingList()
-          this.tab1.contractManagement.create.dialogFormVisible = false
-          this.tab1.contractManagement.create.temp.providerName = ''
-          this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-        }
-      })
-    },
-    form_see(row) {
-      console.log('查看', row)
-      row.statue = String(row.statue)
-      row.synchronousPasture2 = []
-      row.synchronousPastureName2 = []
-      row.synchronousPasture = []
-      this.tab1.contractManagement.create.temp = Object.assign({}, row)
-      this.dialogStatus = 'see'
-      this.tab1.contractManagement.create.dialogFormVisible = true
-      var reason = '未通过原因:' + this.tab1.contractManagement.create.temp.workflowNote
-      if (this.tab1.contractManagement.create.temp.SHStatus == 2) {
-        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核' }, { title: '设备中心审核' }]
-        this.tab1.contractManagement.create.temp.active = 1
-      } else if (this.tab1.contractManagement.create.temp.SHStatus == 3) {
-        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核' }]
-        this.tab1.contractManagement.create.temp.active = 2
-      } else if (this.tab1.contractManagement.create.temp.SHStatus == 4) {
-        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson, status: 'error', reason: reason }, { title: '设备中心审核' }]
-        this.tab1.contractManagement.create.temp.active = 2
-      } else if (this.tab1.contractManagement.create.temp.SHStatus == 5) {
-        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核' }]
-        this.tab1.contractManagement.create.temp.active = 2
-      } else if (this.tab1.contractManagement.create.temp.SHStatus == 6) {
-        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核' }]
-        this.tab1.contractManagement.create.temp.active = 3
-      } else if (this.tab1.contractManagement.create.temp.SHStatus == 7) {
-        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核', date: this.tab1.contractManagement.create.temp.CGChargedate, name: this.tab1.contractManagement.create.temp.CGChargePerson }]
-        this.tab1.contractManagement.create.temp.active = 4
-      } else if (this.tab1.contractManagement.create.temp.SHStatus == 8) {
-        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核', date: this.tab1.contractManagement.create.temp.CGChargedate, name: this.tab1.contractManagement.create.temp.CGChargePerson, status: 'error', reason: reason }]
-        this.tab1.contractManagement.create.temp.active = 4
-      }
-      this.tab1.contractManagement.create.changeEchoParm.parammaps.bigcontract_id = row.id
-      GetDataByName(this.tab1.contractManagement.create.changeEchoParm).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            this.tab1.contractManagement.create.temp.synchronousPasture2.push(response.data.list[i].pasture_id)
-            this.tab1.contractManagement.create.temp.synchronousPasture.push(response.data.list[i].pasture_id)
-            this.tab1.contractManagement.create.temp.synchronousPastureName2.push(this.findAllPasture.find(obj => obj.id == response.data.list[i].pasture_id).name)
-          }
-        } else {
-          this.tab1.contractManagement.create.temp.synchronousPasture = []
-        }
-        console.log(this.tab1.contractManagement.create.temp.synchronousPastureName2, 'synchronousPastureName2')
-      })
-    },
-    handleTab1Change(row) {
-      console.log('变更', row)
-      // row.statue = String(row.statue)
-      this.$set(row, 'mystopTime', row.stopTime)
-      row.synchronousPasture2 = []
-      row.synchronousPastureName2 = []
-      row.synchronousPasture = []
-      this.tab1.contractManagement.create.temp = Object.assign({}, row)
-      this.tab1.contractManagement.create.temp.statue = String(this.tab1.contractManagement.create.temp.statue)
-
-      this.dialogStatus = 'change'
-      this.tab1.contractManagement.create.dialogFormVisible = true
-      this.tab1.contractManagement.create.changeEchoParm.parammaps.bigcontract_id = row.id
-      GetDataByName(this.tab1.contractManagement.create.changeEchoParm).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            this.tab1.contractManagement.create.temp.synchronousPasture2.push(response.data.list[i].pasture_id)
-            this.tab1.contractManagement.create.temp.synchronousPasture.push(response.data.list[i].pasture_id)
-            this.tab1.contractManagement.create.temp.synchronousPastureName2.push(this.findAllPasture.find(obj => obj.id == response.data.list[i].pasture_id).name)
-          }
-        } else {
-          this.tab1.contractManagement.create.temp.synchronousPasture = []
-        }
-        console.log(this.tab1.contractManagement.create.temp.synchronousPastureName2, 'synchronousPastureName2')
-      })
-    },
-
-    terminationData() {
-      var aa = '确认终止合同?'
-      if (this.tab1.contractManagement.create.temp.isZeroStock == 1) {
-        aa = '若此合同库存中有剩余库存,建议先进行退货操作。'
-      } else {
-        aa = '确认终止合同?'
-      }
-      MessageBox.confirm(aa, { confirmButtonText: '确认终止', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        this.postDataPramas = {}
-        this.postDataPramas.name = 'updatecontractstatuV2'
-        this.postDataPramas.parammaps = {}
-        this.postDataPramas.parammaps = this.tab1.contractManagement.create.temp
-        this.postDataPramas.parammaps.creatorId = Cookies.get('employeid')
-        this.postDataPramas.parammaps.creatorMan = Cookies.get('employename')
-        this.postDataPramas.parammaps.creatorTime = parseTime(new Date(), '{y}-{m}-{d}')
-        PostDataByName(this.postDataPramas).then(response => {
-          console.log('变更保存发送参数', this.postDataPramas)
-          if (response.msg == 'fail') {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          } else {
-            this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 = ''
-            this.getTab1List()
-            this.getPendingList()
-            this.tab1.contractManagement.create.dialogFormVisible = false
-            this.tab1.contractManagement.create.temp.providerName = ''
-            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-          }
-        })
-      })
-    },
-    changeData() {
-      if (Cookies.get('pastureid') == 18) {
-        this.UpdateDataParam = {}
-        this.UpdateDataParam.name = 'pasture_bigcontract'
-        this.UpdateDataParam.dataname = 'bigcontract_id'
-        this.UpdateDataParam.datavalue = this.tab1.contractManagement.create.temp.id
-        this.UpdateDataParam.valuename = 'pasture_id'
-        this.UpdateDataParam.values = this.tab1.contractManagement.create.temp.synchronousPasture
-        UpdateDataRelation(this.UpdateDataParam).then(response => {
-          if (response.msg !== 'fail') {
-            this.UpdateDataParam2.name = 'updateBigcontractPId'
-            this.UpdateDataParam2.parammaps = {}
-            this.UpdateDataParam2.parammaps.bigcontract_id = this.tab1.contractManagement.create.temp.id
-            this.UpdateDataParam2.parammaps.enable = 0
-            PostDataByName(this.UpdateDataParam2).then(response => {})
-          }
-        })
-      }
-      this.postDataPramas = {}
-      this.postDataPramas.common = { 'returnmap': '0' }
-      this.postDataPramas.data = []
-      this.postDataPramas.data[0] = { 'name': 'checkbigcontractSH', 'type': 'v', 'parammaps': {
-        pastureId: this.tab1.contractManagement.create.temp.pastureId,
-        providerId: this.tab1.contractManagement.create.temp.providerId,
-        stopTime: this.tab1.contractManagement.create.temp.mystopTime,
-        flag: this.tab1.contractManagement.create.temp.flag,
-        isZeroStock: this.tab1.contractManagement.create.temp.isZeroStock,
-        statue: this.tab1.contractManagement.create.temp.statue
-      }}
-      if (Cookies.get('pastureid') == 18) {
-        var synchronousPastureName = []
-        for (let i = 0; i < this.tab1.contractManagement.create.temp.synchronousPasture.length; i++) {
-          synchronousPastureName.push(this.findAllPasture.find(obj => obj.id == this.tab1.contractManagement.create.temp.synchronousPasture[i]).name)
-        }
-        this.postDataPramas.data[1] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
-          pastureId: this.tab1.contractManagement.create.temp.pastureId,
-          providerId: this.tab1.contractManagement.create.temp.providerId,
-          providerName: this.tab1.contractManagement.create.temp.providerName,
-          startTime: this.tab1.contractManagement.create.temp.startTime,
-          stopTime: this.tab1.contractManagement.create.temp.mystopTime,
-          stopTime1: this.tab1.contractManagement.create.temp.stopTime,
-          contractCode: '',
-          contractCode1: this.tab1.contractManagement.create.temp.contractCode,
-          creatorId: this.tab1.contractManagement.create.temp.creatorId,
-          creatorMan: this.tab1.contractManagement.create.temp.creatorMan,
-          creatorTime: this.tab1.contractManagement.create.temp.creatorTime,
-          isZeroStock: this.tab1.contractManagement.create.temp.isZeroStock,
-          statue: this.tab1.contractManagement.create.temp.statue,
-          remark: this.tab1.contractManagement.create.temp.remark,
-          flag: this.tab1.contractManagement.create.temp.flag,
-          SHtype: 3,
-          pastureNamesOld: this.tab1.contractManagement.create.temp.synchronousPastureName2.toString(),
-          pastureNamesNow: synchronousPastureName.toString()
-        }}
-      } else {
-        this.postDataPramas.data[1] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
-          pastureId: this.tab1.contractManagement.create.temp.pastureId,
-          providerId: this.tab1.contractManagement.create.temp.providerId,
-          providerName: this.tab1.contractManagement.create.temp.providerName,
-          startTime: this.tab1.contractManagement.create.temp.startTime,
-          stopTime: this.tab1.contractManagement.create.temp.mystopTime,
-          stopTime1: this.tab1.contractManagement.create.temp.stopTime,
-          contractCode: '',
-          contractCode1: this.tab1.contractManagement.create.temp.contractCode,
-          creatorId: this.tab1.contractManagement.create.temp.creatorId,
-          creatorMan: this.tab1.contractManagement.create.temp.creatorMan,
-          creatorTime: this.tab1.contractManagement.create.temp.creatorTime,
-          isZeroStock: this.tab1.contractManagement.create.temp.isZeroStock,
-          statue: this.tab1.contractManagement.create.temp.statue,
-          remark: this.tab1.contractManagement.create.temp.remark,
-          flag: this.tab1.contractManagement.create.temp.flag,
-          SHtype: 3
-        }}
-      }
-      ExecDataByConfig(this.postDataPramas).then(response => {
-        console.log('变更保存发送参数', this.postDataPramas)
-        if (response.msg == 'fail') {
-          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-        } else {
-          this.getTab1List()
-          this.getPendingList()
-          this.tab1.contractManagement.create.dialogFormVisible = false
-          this.tab1.contractManagement.create.temp.providerName = ''
-          this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-        }
-      })
-    },
-    // 备件明细
-    handleTab1DetailsSpareParts(row) {
-      console.log('备件明细', row)
-      this.contractCodese = row.contractCode
-      this.tab1.detailsSpareParts.updateList = Object.assign({}, row)
-      this.tab1.detailsSpareParts.detailsList = Object.assign({}, row)
-      this.isContractManagement = false
-      this.isDetailsSpareParts = true
-      this.tab1.detailsSpareParts.getdataListParm.parammaps.pastureId = row.pastureId
-      this.tab1.detailsSpareParts.getdataListParm.parammaps.providerId = row.providerId
-      this.tab1.detailsSpareParts.getdataListParm.parammaps.stopTime = row.stopTime
-      this.tab1.detailsSpareParts.getdataListParm.parammaps.flag = row.flag
-      this.tab1.detailsSpareParts.getdataListParm.parammaps.isZeroStock = row.isZeroStock
-      this.tab1.detailsSpareParts.getdataListParm.parammaps.statue = row.statue
-      this.tab1.detailsSpareParts.getdataListParm.parammaps.partCode = ''
-      this.tab1.detailsSpareParts.getdataListParm.parammaps.partName = ''
-      this.tab1.detailsSpareParts.getdataListParm.parammaps.specification = ''
-      this.getTab1List2()
-    },
-    handleTab1goBack() {
-      // this.reload()
-      this.isContractManagement = true
-      this.isDetailsSpareParts = false
-      this.tab1.detailsSpareParts.total = 0
-      this.getTab1List()
-    },
-
-    change_enabled(){
-
-    },
-    change_no(){
-      console.log("selectList",this.selectList)
-
-
-      var send_data =    {
-        "common": {
-            "returnmap": "0"
-        },
-        "data": [
-            {
-                "name": "insertSpotList",
-                "resultmaps": {
-                    "list":  this.selectList
-                },
-                "children": [
-                    {
-                        "name": "updateContractEnableById",
-                        "type": "e",
-                        "parammaps": {
-                            "id": "@insertSpotList.id"
-                        }
-                    }
-                ]
-            },{
-        "name": "updateBigcontractIsToSap",
-                        "type": "e",
-                        "parammaps": {
-                            "contractCode": this.contractCodese
-                        }
-      }
-
-        ]
-    }
-
-
-      ExecDataByConfig(send_data).then(response => {
-          console.log('发送参数', send_data)
-          if (response.msg === 'fail') {
-            this.$notify({
-              title: '禁用失败',
-              message: response.data,
-              type: 'warning',
-              duration: 2000
-            })
-          } else {
-
-            this.getTab1List2()
-
-            this.$notify({
-              title: '',
-              message: '禁用成功',
-              type: 'success',
-              duration: 2000
-            })
-          }
-        })
-
-
-    },
-
-    handleSelectionChange(val) {
-      // this.create.temp.rowsNumber = []
-      // for(let i=0;i<val.length;i++){
-      //   this.create.temp.rowsNumber.push(val[i].rowNumber)
-      // }
-      console.log(val)
-      this.selectList = val
-    },
-    getTab1List2() {
-      this.tab1.detailsSpareParts.listLoading = true
-      GetDataByName(this.tab1.detailsSpareParts.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
-              const srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
-              const picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
-              response.data.list[i].srcpath = srcpath
-              response.data.list[i].picpath = picpath
-            } else {
-              response.data.list[i].srcpath = ''
-              response.data.list[i].picpath = ''
-            }
-          }
-          this.tab1.detailsSpareParts.list = response.data.list
-          this.tab1.detailsSpareParts.pageNum = response.data.pageNum
-          this.tab1.detailsSpareParts.pageSize = response.data.pageSize
-          if (response.data.list !== null) {
-            this.tab1.detailsSpareParts.total = response.data.total
-          } else {
-            this.tab1.detailsSpareParts.total = 0
-          }
-        } else {
-          this.tab1.detailsSpareParts.list = []
-        }
-        setTimeout(() => {
-          this.tab1.detailsSpareParts.listLoading = false
-        }, 300)
-      })
-    },
-    handleTab1Filter2() {
-      this.tab1.detailsSpareParts.listLoading = true
-      this.tab1.detailsSpareParts.getdataListParm.offset = 1
-      this.getTab1List2()
-    },
-    sparePartSearch(queryString, cb) {
-      this.tab1.detailsSpareParts.requestSparePart.parammaps['partCode'] = queryString
-      GetDataByName(this.tab1.detailsSpareParts.requestSparePart).then(response => {
-        if (response.data.list == null) {
-          cb([])
-        } else {
-          cb(response.data.list)
-        }
-      })
-    },
-    handleSelectSparePart(item) {
-      console.log('备件模糊查询选中值', item)
-      if (this.tab1.detailsSpareParts.listAdd.length > 0) {
-        if (this.tab1.detailsSpareParts.listAdd.find(obj => obj.partCode == item.partCode)) {
-          this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
-        } else {
-          if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
-            this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
-            this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
-          } else {
-            item.srcpath = ''
-            item.picpath = ''
-          }
-          this.$set(item, 'myid', new Date().getTime())
-          this.$set(item, 'taxcode', '')
-          this.tab1.detailsSpareParts.listAdd.unshift(item)
-        }
-      } else {
-        if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
-          this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
-          this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
-        } else {
-          item.srcpath = ''
-          item.picpath = ''
-        }
-        this.$set(item, 'myid', new Date().getTime())
-        this.tab1.detailsSpareParts.listAdd.unshift(item)
-      }
-    },
-    brandSearch(queryString, cb) {
-      this.tab1.detailsSpareParts.requestBrand.parammaps['brandName'] = queryString
-      GetDataByName(this.tab1.detailsSpareParts.requestBrand).then(response => {
-        this.tab1.detailsSpareParts.BrandList = response.data.list
-        cb(this.tab1.detailsSpareParts.BrandList)
-      })
-    },
-    handleSelectBrand(item, row) {
-      this.$set(row, 'brandName', item.brandName)
-      this.$set(row, 'brandId', item.brandId)
-      this.$forceUpdate()
-    },
-    handleFocusBrand(row) {
-      this.$set(row, 'brandName', '')
-      this.$set(row, 'brandId', '')
-    },
-    handleBlurBrand(row) {
-      if (row.brandId == '') {
-        this.$set(row, 'brand', '')
-        this.$set(row, 'brandName', '')
-        this.$set(row, 'brandId', '')
-      }
-    },
-    partDelete(row) {
-      console.log('备件明细-备件删除', row)
-      MessageBox.confirm('设备名称:' + row.partName, '确认删除?', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        for (var i = 0; i < this.tab1.detailsSpareParts.listAdd.length; i++) {
-          console.log(this.tab1.detailsSpareParts.listAdd[i])
-          if (this.tab1.detailsSpareParts.listAdd[i].myid === row.myid) {
-            var listAddIndex = this.tab1.detailsSpareParts.listAdd.indexOf(this.tab1.detailsSpareParts.listAdd[i])
-          }
-          if (listAddIndex > -1) {
-            this.tab1.detailsSpareParts.listAdd.splice(listAddIndex, 1)
-            return
-          }
-        }
-      })
-    },
-    handleTab1DownloadTemp2() {
-      console.log('备件明细-备件模板')
-      import('@/vendor/Export2Excel').then(excel => {
-        const list1 = []
-        const tHeader = ['备件编号', '备件名称', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注']
-        const filterVal = ['备件编号', '备件名称', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注']
-        const data1 = this.formatJsonTemp(filterVal, list1)
-        excel.export_json_to_excel({ header: tHeader, data: data1, filename: '备件明细模板', autoWidth: true, bookType: 'xlsx' })
-      })
-    },
-    formatJsonTemp(filterVal, jsonData) {
-      return jsonData.map(v =>
-        filterVal.map(j => {
-          if (j === 'timestamp') {
-            return parseTime(v[j])
-          } else {
-            return v[j]
-          }
-        })
-      )
-    },
-    beforeImportExcel(file) {
-      const isLt2M = file.size / 1024 / 1024 < 6
-      if (!isLt2M) {
-        this.$message.error('上传文件大小不能超过 6MB!')
-      }
-      return isLt2M
-    },
-    handleImportExcelSuccess(res, file) {
-      console.log(res)
-      if (res.msg == 'ok') {
-        this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
-        if (res.data.err_count > 0) {
-          this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
-           import('@/vendor/Export2Excel').then(excel => {
-             const list1 = res.data.result
-             const tHeader = ['备件编号', '备件名称', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '报错信息']
-             const filterVal = ['备件编号', '备件名称', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', 'error_msg']
-             const data1 = this.formatJson(filterVal, list1)
-             excel.export_json_to_excel({ header: tHeader, data: data1, filename: '合同报错信息', autoWidth: true, bookType: 'xlsx' })
-           })
-        }
-        this.getImportExcelList()
-      } else {
-        this.$notify({ title: '失败', message: '上传失败,文件格式错误', type: 'danger', duration: 2000 })
-      }
-    },
-    formatJson(filterVal, jsonData) {
-      return jsonData.map(v =>
-        filterVal.map(j => {
-          if (j == 'timestamp') {
-            return parseTime(v[j])
-          } else {
-            return v[j]
-          }
-        })
-      )
-    },
-    getClearImportExcelList() {
-      PostDataByName(this.tab1.detailsSpareParts.clearImportExcelParm).then(response => {
-        console.log(response.msg)
-        if (response.msg == 'ok') {
-          this.tab1.detailsSpareParts.isDisabledImport = false
-        }
-      })
-    },
-    getImportExcelList() {
-      GetDataByName(this.tab1.detailsSpareParts.importExcelParm).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].picpath == undefined) {
-              response.data.list[i].picpath = ''
-              response.data.list[i].srcpath = ''
-            } else {
-              this.$set(response.data.list[i], 'srcpath', process.env.VUE_APP_BASE_API + response.data.list[i].srcpath)
-              this.$set(response.data.list[i], 'picpath', process.env.VUE_APP_BASE_API + response.data.list[i].picpath)
-            }
-            response.data.list[i].myid = new Date().getTime() + i
-          }
-          this.tab1.detailsSpareParts.listAdd = response.data.list
-        } else {
-          this.tab1.detailsSpareParts.list = []
-        }
-      })
-    },
-    handleTab1Create2() {
-      console.log('备件明细-新增/变更')
-      this.dialogStatus = 'tab1create2'
-      this.tab1.detailsSpareParts.create.dialogFormVisible = true
-      this.tab1.detailsSpareParts.listAdd = []
-      this.tab1.detailsSpareParts.partCode = ''
-      this.tab1.detailsSpareParts.requestSparePart.name = 'getcontratListBybigALLParts'
-      this.tab1.detailsSpareParts.requestSparePart.parammaps = {}
-      this.getClearImportExcelList()
-    },
-    add_dialog_save2() {
-      console.log('备件明细-新增保存')
-      if (this.tab1.detailsSpareParts.listAdd.length !== 0) {
-        for (let i = 0; i < this.tab1.detailsSpareParts.listAdd.length; i++) {
-          if (this.tab1.detailsSpareParts.listAdd[i].planAmount == null || this.tab1.detailsSpareParts.listAdd[i].brand == null || this.tab1.detailsSpareParts.listAdd[i].price == null || this.tab1.detailsSpareParts.listAdd[i].planAmount == '' || this.tab1.detailsSpareParts.listAdd[i].brand === '' || this.tab1.detailsSpareParts.listAdd[i].brandId === '' || this.tab1.detailsSpareParts.listAdd[i].price == '' || this.tab1.detailsSpareParts.listAdd[i].brand == undefined || this.tab1.detailsSpareParts.listAdd[i].brandId == undefined) {
-            this.$message({ type: 'warning', message: '请检查备件品牌或计划量或单价是否为空', duration: 2000 })
-            return false
-          } else {
-            var rulesPlanAmount = /^[1-9]\d*$/
-            if (!rulesPlanAmount.test(parseFloat(this.tab1.detailsSpareParts.listAdd[i].planAmount))) {
-              this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
-              return false
-            }
-            var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
-            if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
-              this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
-              return false
-            }
-          }
-        }
-        this.postDataPramas = {}
-        this.postDataPramas.common = { 'returnmap': '0' }
-        this.postDataPramas.data = []
-        this.postDataPramas.data[0] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
-          pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
-          flag: this.tab1.detailsSpareParts.detailsList.flag,
-          providerId: this.tab1.detailsSpareParts.detailsList.providerId,
-          providerName: this.tab1.detailsSpareParts.detailsList.providerName,
-          startTime: this.tab1.detailsSpareParts.detailsList.startTime,
-          stopTime: this.tab1.detailsSpareParts.detailsList.stopTime,
-          contractCode: '',
-          contractCode1: this.tab1.detailsSpareParts.detailsList.contractCode,
-          creatorId: Cookies.get('employeid'),
-          creatorMan: Cookies.get('employename'),
-          creatorTime: parseTime(new Date(), '{y}-{m}-{d}'),
-          isZeroStock: this.tab1.detailsSpareParts.detailsList.isZeroStock,
-          statue: this.tab1.detailsSpareParts.detailsList.statue,
-          remark: this.tab1.detailsSpareParts.detailsList.remark,
-          SHtype: 1
-        }}
-        this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.tab1.detailsSpareParts.listAdd }}
-        this.postDataPramas.data[1].children = []
-        this.postDataPramas.data[1].children[0] = { 'name': 'checkcontracPartCode', 'type': 'v', 'parammaps': {
-          pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
-          providerId: this.tab1.detailsSpareParts.detailsList.providerId,
-          stopTime: this.tab1.detailsSpareParts.detailsList.stopTime,
-          flag: this.tab1.detailsSpareParts.detailsList.flag,
-          isZeroStock: this.tab1.detailsSpareParts.detailsList.isZeroStock,
-          statue: this.tab1.detailsSpareParts.detailsList.statue,
-          partCode: '@insertSpotList.partCode',
-          brandId: '@insertSpotList.brandId'
-        }}
-        this.postDataPramas.data[1].children[1] = { 'name': 'insertContractV2', 'type': 'e', 'parammaps': {
-          bigId: '@insertBigContractV2.LastInsertId',
-          pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
-          pastureName: this.tab1.detailsSpareParts.detailsList.pastureName,
-          partId: '@insertSpotList.id',
-          partName: '@insertSpotList.partName',
-          partCode: '@insertSpotList.partCode',
-          specification: '@insertSpotList.specification',
-          price: '@insertSpotList.price',
-          brandId: '@insertSpotList.brandId',
-          brand: '@insertSpotList.brand',
-          planAmount: '@insertSpotList.planAmount',
-          remark: '@insertSpotList.remark',
-          unit: '@insertSpotList.unit',
-          contractId: '@insertSpotList.contractId',
-          taxcode: '@insertSpotList.taxcode',
-          lifeCycle: '@insertSpotList.lifeCycle',
-          contractVarianceItem: '@insertSpotList.contractVarianceItem',
-        }}
-        ExecDataByConfig(this.postDataPramas).then(response => {
-          console.log('新增保存发送参数', this.postDataPramas)
-          if (response.msg == 'fail') {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          } else {
-            this.getTab1List2()
-            this.getPendingList()
-            this.tab1.detailsSpareParts.create.dialogFormVisible = false
-            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-          }
-        })
-      } else {
-        this.$notify({ title: '', message: '请选择备件', type: 'warning', duration: 2000 })
-        return false
-      }
-    },
-    handleTab1Change2() {
-      console.log('备件明细-变更')
-      this.dialogStatus = 'tab1change2'
-      this.tab1.detailsSpareParts.create.dialogFormVisible = true
-      this.tab1.detailsSpareParts.listAdd = []
-      this.tab1.detailsSpareParts.requestSparePart.parammaps.pastureId = this.tab1.detailsSpareParts.detailsList.pastureId
-      this.tab1.detailsSpareParts.requestSparePart.parammaps.providerId = this.tab1.detailsSpareParts.detailsList.providerId
-      this.tab1.detailsSpareParts.requestSparePart.parammaps.stopTime = this.tab1.detailsSpareParts.detailsList.stopTime
-      this.tab1.detailsSpareParts.requestSparePart.parammaps.flag = this.tab1.detailsSpareParts.detailsList.flag
-      this.tab1.detailsSpareParts.requestSparePart.parammaps.isZeroStock = this.tab1.detailsSpareParts.detailsList.isZeroStock
-      this.tab1.detailsSpareParts.requestSparePart.parammaps.statue = this.tab1.detailsSpareParts.detailsList.statue
-      this.tab1.detailsSpareParts.requestSparePart.name = 'getcontratListBybigParts'
-    },
-    changeData2() {
-      console.log('备件明细-变更保存')
-      if (this.tab1.detailsSpareParts.listAdd.length !== 0) {
-        for (let i = 0; i < this.tab1.detailsSpareParts.listAdd.length; i++) {
-          if (this.tab1.detailsSpareParts.listAdd[i].planAmount == null || this.tab1.detailsSpareParts.listAdd[i].brand == null || this.tab1.detailsSpareParts.listAdd[i].price == null || this.tab1.detailsSpareParts.listAdd[i].planAmount == '' || this.tab1.detailsSpareParts.listAdd[i].brand === '' || this.tab1.detailsSpareParts.listAdd[i].brandId === '' || this.tab1.detailsSpareParts.listAdd[i].price == '' || this.tab1.detailsSpareParts.listAdd[i].brand == undefined || this.tab1.detailsSpareParts.listAdd[i].brandId == undefined) {
-            this.$message({ type: 'warning', message: '请检查备件品牌或计划量或单价是否为空', duration: 2000 })
-            return false
-          } else {
-            var rulesPlanAmount = /^[1-9]\d*$/
-            if (!rulesPlanAmount.test(parseFloat(this.tab1.detailsSpareParts.listAdd[i].planAmount))) {
-              this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
-              return false
-            } else {
-              var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
-              if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
-                this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
-                return false
-              }
-            }
-          }
-        }
-        this.postDataPramas = {}
-        this.postDataPramas.common = { 'returnmap': '0' }
-        this.postDataPramas.data = []
-        this.postDataPramas.data[0] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
-          pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
-          flag: this.tab1.detailsSpareParts.detailsList.flag,
-          providerId: this.tab1.detailsSpareParts.detailsList.providerId,
-          providerName: this.tab1.detailsSpareParts.detailsList.providerName,
-          startTime: this.tab1.detailsSpareParts.detailsList.startTime,
-          stopTime: this.tab1.detailsSpareParts.detailsList.stopTime,
-          contractCode: '',
-          contractCode1: this.tab1.detailsSpareParts.detailsList.contractCode,
-          creatorId: Cookies.get('employeid'),
-          creatorMan: Cookies.get('employename'),
-          creatorTime: parseTime(new Date(), '{y}-{m}-{d}'),
-          isZeroStock: this.tab1.detailsSpareParts.detailsList.isZeroStock,
-          statue: this.tab1.detailsSpareParts.detailsList.statue,
-          remark: this.tab1.detailsSpareParts.detailsList.remark,
-          SHtype: 2
-        }}
-        this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.tab1.detailsSpareParts.listAdd }}
-        this.postDataPramas.data[1].children = []
-        this.postDataPramas.data[1].children[0] = { 'name': 'insertContractV2', 'type': 'e', 'parammaps': {
-          bigId: '@insertBigContractV2.LastInsertId',
-          pastureId: '@insertSpotList.pastureId',
-          pastureName: '@insertSpotList.pastureName',
-          partId: '@insertSpotList.partId',
-          partName: '@insertSpotList.partName',
-          partCode: '@insertSpotList.partCode',
-          specification: '@insertSpotList.specification',
-          price: '@insertSpotList.price',
-          brandId: '@insertSpotList.brandId',
-          brand: '@insertSpotList.brand',
-          planAmount: '@insertSpotList.planAmount',
-          remark: '@insertSpotList.remark',
-          unit: '@insertSpotList.unit',
-          contractId: '@insertSpotList.contractId',
-          taxcode: '@insertSpotList.taxcode',
-          lifeCycle: '@insertSpotList.lifeCycle',
-          contractVarianceItem: '@insertSpotList.contractVarianceItem',
-        }}
-        ExecDataByConfig(this.postDataPramas).then(response => {
-          console.log('新增保存发送参数', this.postDataPramas)
-          if (response.msg == 'fail') {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          } else {
-            this.getTab1List2()
-            this.getPendingList()
-            this.tab1.detailsSpareParts.create.dialogFormVisible = false
-            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-          }
-        })
-      } else {
-        this.$notify({ title: '', message: '请选择备件', type: 'warning', duration: 2000 })
-        return false
-      }
-    },
-    handleTab1Export2() {
-      console.log('备件明细-导出')
-      this.$alert('备件明细正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
-      this.isPercentage = true
-      this.percentage = 1
-      var timer = setInterval(() => {
-        this.percentage += 5
-        if (this.percentage > 95) {
-          this.percentage = 99
-          clearInterval(timer)
-          this.tab1.detailsSpareParts.getdataListParm.pagecount = 10
-        }
-        this.percentage = this.percentage
-      }, 1000)
-      this.tab1.detailsSpareParts.getdataListParm.pagecount = ''
-      GetDataByName(this.tab1.detailsSpareParts.getdataListParm).then(response => {
-        if (response.data.list !== '') {
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-        }
-        if (response.data.list !== null) {
-          this.$nextTick(() => {
-            const ExcelDatas = [
-              {
-                tHeader: ['备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '计划量', '单价', '使用周期', '合同差异项', '备注'],
-                filterVal: ['partCode', 'partName', 'specification', 'brand', 'unit', 'planAmount', 'price','lifeCycle','contractVarianceItem', 'remark'],
-                tableDatas: response.data.list,
-                sheetName: '合同管理-备件明细'
-              }
-            ]
-            json2excel(ExcelDatas, '合同管理-备件明细', true, 'xlsx')
-          })
-        }
-      })
-    },
-
-    // 变更记录
-    handleTab1ChangeRecord(row) {
-      console.log('变更记录')
-      this.tab1.detailsSpareParts.detailsList = Object.assign({}, row)
-      this.contractCodese = row.contractCode
-      this.isContractManagement = false
-      this.isChangeRecord = true
-      this.tab1.changeRecord.getdataListParm.parammaps.pastureId = row.pastureId
-      this.tab1.changeRecord.getdataListParm.parammaps.providerId = row.providerId
-      this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = row.stopTime
-      this.tab1.changeRecord.getdataListParm.parammaps.flag = row.flag
-      this.tab1.changeRecord.getdataListParm.parammaps.isZeroStock = row.isZeroStock
-      this.tab1.changeRecord.getdataListParm.parammaps.statue = row.statue
-      this.tab1.changeRecord.getdataListParm.parammaps.contractCode = ''
-      this.tab1.changeRecord.getdataListParm.parammaps.tab1InputDatetime3 = ''
-      this.tab1.changeRecord.getdataListParm.parammaps.startTime = ''
-      this.tab1.changeRecord.getdataListParm.parammaps.stopTime = ''
-      this.tab1.changeRecord.getdataListParm.parammaps.SHtype = ''
-      this.tab1.changeRecord.getdataListParm.parammaps.stuteSH = ''
-      this.getTab1List3()
-    },
-    handleTab1goBack2() {
-      // this.reload()
-      this.isContractManagement = true
-      this.isChangeRecord = false
-      this.tab1.changeRecord.total = 0
-      // this.tab1.contractManagement.getdataListParm.offset = 1
-      this.getTab1List()
-    },
-    getTab1List3() {
-      this.tab1.changeRecord.listLoading = true
-      if (this.$refs['tab1InputDatetime3'] !== undefined && this.$refs['tab1InputDatetime3'].value !== null) {
-        this.tab1.changeRecord.getdataListParm.parammaps.startTime = this.$refs['tab1InputDatetime3'].value[0]
-        this.tab1.changeRecord.getdataListParm.parammaps.stopTime = this.$refs['tab1InputDatetime3'].value[1]
-      } else {
-        this.tab1.changeRecord.getdataListParm.parammaps.startTime = ''
-        this.tab1.changeRecord.getdataListParm.parammaps.stopTime = ''
-      }
-      GetDataByName(this.tab1.changeRecord.getdataListParm).then(response => {
-        this.tab1.changeRecord.list = response.data.list
-        this.tab1.changeRecord.pageNum = response.data.pageNum
-        this.tab1.changeRecord.pageSize = response.data.pageSize
-        if (response.data.list !== null) {
-          this.tab1.changeRecord.total = response.data.total
-        } else {
-          this.tab1.changeRecord.total = 0
-        }
-        setTimeout(() => {
-          this.tab1.changeRecord.listLoading = false
-        }, 300)
-      })
-    },
-    handleTab1Filter3() {
-      this.tab1.changeRecord.listLoading = true
-      if (this.tab1.changeRecord.getdataListParm.parammaps.tab1InputDatetime3 == null) {
-        this.tab1.changeRecord.getdataListParm.parammaps.tab1InputDatetime3 = ''
-      }
-      this.tab1.changeRecord.getdataListParm.offset = 1
-      if (this.tab1.changeRecord.radioAll == '全部') {
-        this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 2
-        this.getTab1List3()
-      } else if (this.tab1.changeRecord.radioAll == '待处理') {
-        this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 0
-        this.getTab1List3()
-      } else if (this.tab1.changeRecord.radioAll == '已处理') {
-        this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 1
-        this.getTab1List3()
-      }
-    },
-    changeChangeRecordAll() {
-      if (this.tab1.changeRecord.radioAll == '全部') {
-        this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 2
-        this.getTab1List3()
-      } else if (this.tab1.changeRecord.radioAll == '待处理') {
-        this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 0
-        this.getTab1List3()
-      } else if (this.tab1.changeRecord.radioAll == '已处理') {
-        this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 1
-        this.getTab1List3()
-      }
-    },
-    handleTab1See3(row) {
-      console.log('变更记录-查看')
-      this.tab1.changeRecord.see.temp = Object.assign({}, row)
-      this.dialogStatus = 'tab1See2'
-      this.tab1.changeRecord.see.dialogFormVisible = true
-      if (row.SHtype == 0 || row.SHtype == 1 || row.SHtype == 2) {
-        this.tab1.changeRecord.see.getdataListParm.parammaps.id = row.id
-        this.getTab1List3See()
-      }
-      var reason = '未通过原因:' + this.tab1.changeRecord.see.temp.workflowNote
-      if (this.tab1.changeRecord.see.temp.SHStatus == 2) {
-        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核' }, { title: '设备中心审核' }]
-        this.tab1.changeRecord.see.active = 1
-      } else if (this.tab1.changeRecord.see.temp.SHStatus == 3) {
-        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核' }]
-        this.tab1.changeRecord.see.active = 2
-      } else if (this.tab1.changeRecord.see.temp.SHStatus == 4) {
-        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson, status: 'error', reason: reason }, { title: '设备中心审核' }]
-        this.tab1.changeRecord.see.active = 2
-      } else if (this.tab1.changeRecord.see.temp.SHStatus == 5) {
-        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核' }]
-        this.tab1.changeRecord.see.active = 2
-      } else if (this.tab1.changeRecord.see.temp.SHStatus == 6) {
-        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核' }]
-        this.tab1.changeRecord.see.active = 3
-      } else if (this.tab1.changeRecord.see.temp.SHStatus == 7) {
-        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核', date: this.tab1.changeRecord.see.temp.CGChargedate, name: this.tab1.changeRecord.see.temp.CGChargePerson }]
-        this.tab1.changeRecord.see.active = 4
-      } else if (this.tab1.changeRecord.see.temp.SHStatus == 8) {
-        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核', date: this.tab1.changeRecord.see.temp.CGChargedate, name: this.tab1.changeRecord.see.temp.CGChargePerson, status: 'error', reason: reason }]
-        this.tab1.changeRecord.see.active = 4
-      }
-    },
-    getTab1List3See() {
-      GetDataByName(this.tab1.changeRecord.see.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          this.tab1.changeRecord.see.pageNum = response.data.pageNum
-          this.tab1.changeRecord.see.pageSize = response.data.pageSize
-          if (response.data.total) {
-            this.tab1.changeRecord.see.total = response.data.total
-          }
-          for (let i = 0; i < response.data.list.length; i++) {
-            response.data.list[i].myid = new Date().getTime() + i
-            if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
-              const srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
-              const picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
-              response.data.list[i].srcpath = srcpath
-              response.data.list[i].picpath = picpath
-            } else {
-              response.data.list[i].srcpath = ''
-              response.data.list[i].picpath = ''
-            }
-          }
-          this.tab1.changeRecord.see.list = response.data.list
-          this.tab1.detailsSpareParts.listAdd = response.data.list
-        } else {
-          this.tab1.changeRecord.see.list = []
-          this.tab1.detailsSpareParts.listAdd = []
-        }
-        setTimeout(() => {
-          this.tab1.changeRecord.see.listLoading = false
-        }, 300)
-      })
-    },
-    handleTab1Update3(row) {
-      console.log('变更记录-编辑', row)
-      this.tab1.detailsSpareParts.updateList = Object.assign({}, row)
-      this.tab1.detailsSpareParts.create.temp = Object.assign({}, row)
-      this.dialogStatus = 'tab1Update2'
-      this.tab1.detailsSpareParts.create.dialogFormVisible = true
-      this.tab1.changeRecord.see.getdataListParm.parammaps.id = row.id
-      this.getTab1List3See()
-      if (row.SHtype == 1) {
-        this.tab1.detailsSpareParts.requestSparePart.name = 'getcontratListBybigALLParts'
-        this.tab1.detailsSpareParts.requestSparePart.parammaps = {}
-      } else {
-        this.tab1.detailsSpareParts.requestSparePart.parammaps.pastureId = this.tab1.detailsSpareParts.detailsList.pastureId
-        this.tab1.detailsSpareParts.requestSparePart.parammaps.providerId = this.tab1.detailsSpareParts.detailsList.providerId
-        this.tab1.detailsSpareParts.requestSparePart.parammaps.stopTime = this.tab1.detailsSpareParts.detailsList.stopTime
-        this.tab1.detailsSpareParts.requestSparePart.parammaps.flag = this.tab1.detailsSpareParts.detailsList.flag
-        this.tab1.detailsSpareParts.requestSparePart.parammaps.isZeroStock = this.tab1.detailsSpareParts.detailsList.isZeroStock
-        this.tab1.detailsSpareParts.requestSparePart.parammaps.statue = this.tab1.detailsSpareParts.detailsList.statue
-        this.tab1.detailsSpareParts.requestSparePart.name = 'getcontratListBybigParts'
-      }
-    },
-    edit_dialog_save2() {
-      console.log('编辑保存')
-      // 新增合同 || 变更日期
-      if (this.tab1.detailsSpareParts.updateList.SHtype == 0 || this.tab1.detailsSpareParts.updateList.SHtype == 3) {
-        this.postDataPramas = {}
-        this.postDataPramas.common = { 'returnmap': '0' }
-        this.postDataPramas.data = []
-        this.postDataPramas.data[0] = { 'name': 'updateBigcontractV2', 'type': 'e', 'parammaps': {
-          id: this.tab1.detailsSpareParts.create.temp.id,
-          startTime: this.tab1.detailsSpareParts.create.temp.startTime,
-          stopTime: this.tab1.detailsSpareParts.create.temp.stopTime,
-          isZeroStock: this.tab1.detailsSpareParts.create.temp.isZeroStock,
-          remark: this.tab1.detailsSpareParts.create.temp.remark,
-          stopTimeHis: this.tab1.detailsSpareParts.create.temp.stopTimeHis
-        }}
-        ExecDataByConfig(this.postDataPramas).then(response => {
-          console.log('新增保存发送参数', this.postDataPramas)
-          if (response.msg == 'fail') {
-            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-          } else {
-            if (this.tab1.detailsSpareParts.updateList.SHtype == 0) {
-              this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = this.tab1.detailsSpareParts.create.temp.stopTime
-            }
-            this.getTab1List3()
-            this.getPendingList()
-            this.tab1.detailsSpareParts.create.dialogFormVisible = false
-            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-          }
-        })
-      } else {
-        if (this.tab1.detailsSpareParts.listAdd.length !== 0) {
-          for (let i = 0; i < this.tab1.detailsSpareParts.listAdd.length; i++) {
-            if (this.tab1.detailsSpareParts.listAdd[i].planAmount == null || this.tab1.detailsSpareParts.listAdd[i].brand == null || this.tab1.detailsSpareParts.listAdd[i].price == null || this.tab1.detailsSpareParts.listAdd[i].planAmount == '' || this.tab1.detailsSpareParts.listAdd[i].brand == '' || this.tab1.detailsSpareParts.listAdd[i].brandId === '' || this.tab1.detailsSpareParts.listAdd[i].price == '' || this.tab1.detailsSpareParts.listAdd[i].brand == undefined || this.tab1.detailsSpareParts.listAdd[i].brandId == undefined) {
-              console.log(this.tab1.detailsSpareParts.listAdd[i])
-              this.$message({ type: 'warning', message: '请检查备件品牌或计划量或单价是否为空', duration: 2000 })
-              return false
-            } else {
-              var rulesPlanAmount = /^[1-9]\d*$/
-              if (!rulesPlanAmount.test(parseFloat(this.tab1.detailsSpareParts.listAdd[i].planAmount))) {
-                this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
-                return false
-              } else {
-                var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
-                if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
-                  this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
-                  return false
-                }
-              }
-            }
-          }
-          this.postDataPramas = {}
-          this.postDataPramas.common = { 'returnmap': '0' }
-          this.postDataPramas.data = []
-          this.postDataPramas.data[0] = { 'name': 'deleteContract', 'type': 'e', 'parammaps': {
-            bigId: this.tab1.detailsSpareParts.updateList.id
-          }}
-          this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.tab1.detailsSpareParts.listAdd }}
-          this.postDataPramas.data[1].children = []
-
-          if (this.tab1.detailsSpareParts.updateList.SHtype == 2) {
-            this.postDataPramas.data[1].children[0] = { 'name': 'insertContractV2', 'type': 'e', 'parammaps': {
-              bigId: this.tab1.detailsSpareParts.updateList.id,
-              pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
-              pastureName: this.tab1.detailsSpareParts.detailsList.pastureName,
-              partId: '@insertSpotList.id',
-              partName: '@insertSpotList.partName',
-              partCode: '@insertSpotList.partCode',
-              specification: '@insertSpotList.specification',
-              price: '@insertSpotList.price',
-              brandId: '@insertSpotList.brandId',
-              brand: '@insertSpotList.brand',
-              planAmount: '@insertSpotList.planAmount',
-              remark: '@insertSpotList.remark',
-              unit: '@insertSpotList.unit',
-              contractId: '@insertSpotList.contractId',
-              taxcode: '@insertSpotList.taxcode',
-              lifeCycle: '@insertSpotList.lifeCycle',
-              contractVarianceItem: '@insertSpotList.contractVarianceItem',
-            }}
-          } else {
-            this.postDataPramas.data[1].children[0] = { 'name': 'checkcontracPartCode', 'type': 'v', 'parammaps': { pastureId: this.tab1.detailsSpareParts.detailsList.pastureId, providerId: this.tab1.detailsSpareParts.detailsList.providerId, stopTime: this.tab1.detailsSpareParts.detailsList.stopTime, flag: this.tab1.detailsSpareParts.detailsList.flag, isZeroStock: this.tab1.detailsSpareParts.detailsList.isZeroStock, statue: this.tab1.detailsSpareParts.detailsList.statue, partCode: '@insertSpotList.partCode', brandId: '@insertSpotList.brandId' }}
-            this.postDataPramas.data[1].children[1] = { 'name': 'insertContractV2', 'type': 'e', 'parammaps': {
-              bigId: this.tab1.detailsSpareParts.updateList.id,
-              pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
-              pastureName: this.tab1.detailsSpareParts.detailsList.pastureName,
-              partId: '@insertSpotList.id',
-              partName: '@insertSpotList.partName',
-              partCode: '@insertSpotList.partCode',
-              specification: '@insertSpotList.specification',
-              price: '@insertSpotList.price',
-              brandId: '@insertSpotList.brandId',
-              brand: '@insertSpotList.brand',
-              planAmount: '@insertSpotList.planAmount',
-              remark: '@insertSpotList.remark',
-              unit: '@insertSpotList.unit',
-              contractId: '@insertSpotList.contractId',
-              lifeCycle: '@insertSpotList.lifeCycle',
-              contractVarianceItem: '@insertSpotList.contractVarianceItem',
-              // taxcode: '@insertSpotList.taxcode'
-            }}
-          }
-          this.postDataPramas.data[2] = { 'name': 'updateBigcontract', 'type': 'e', 'parammaps': {
-            id: this.tab1.detailsSpareParts.updateList.id
-          }}
-          ExecDataByConfig(this.postDataPramas).then(response => {
-            console.log('新增保存发送参数', this.postDataPramas)
-            if (response.msg == 'fail') {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              this.getTab1List3()
-              this.getPendingList()
-              this.tab1.detailsSpareParts.create.dialogFormVisible = false
-              this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-            }
-          })
-        } else {
-          this.$notify({ title: '', message: '请选择备件', type: 'warning', duration: 2000 })
-          return false
-        }
-      }
-    },
-    changeExamineStatue(val) {
-      if (val == 2) {
-        this.tab1.changeRecord.examine.isReason = true
-      } else {
-        this.tab1.changeRecord.examine.isReason = false
-      }
-    },
-    // 审核1
-    handleTab1Examine(row) {
-      console.log('变更记录-审核')
-      this.dialogStatus = 'tab1examine'
-      this.tab1.changeRecord.examine.dialogFormVisible = true
-      this.tab1.changeRecord.examine.temp = Object.assign({}, row)
-      this.tab1.changeRecord.examine.isReason = false
-      if (row == undefined) {
-        this.tab1.changeRecord.examine.temp = this.tab1.changeRecord.see.temp
-        this.$set(this.tab1.changeRecord.see.temp, 'statueSH', 1)
-        this.$set(this.tab1.changeRecord.see.temp, 'workflowNote', '')
-      } else {
-        this.tab1.changeRecord.examine.temp = Object.assign({}, row)
-        this.$set(this.tab1.changeRecord.examine.temp, 'statueSH', 1)
-        this.$set(this.tab1.changeRecord.examine.temp, 'workflowNote', '')
-      }
-      this.keyupSubmit()
-    },
-    keyupSubmit() {
-      if (this.dialogStatus == 'tab1examine' || this.dialogStatus == 'tab1examine2' || this.dialogStatus == 'tab1examine3') {
-        document.onkeydown = e => {
-          const _key = window.event.keyCode
-          if (_key === 13) {
-            if (this.dialogStatus == 'tab1examine') {
-              this.createExamineData()
-            } else {
-              this.createExamineData3()
-            }
-          }
-        }
-      }
-    },
-    createExamineData() {
-      console.log('点击了设备主管审核确认1')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['examineTemp'].validate(valid => {
-        if (valid) {
-          this.postDataPramas = {}
-          this.postDataPramas.name = 'contractCharge'
-          this.postDataPramas.parammaps = {}
-          this.postDataPramas.parammaps.id = this.tab1.changeRecord.examine.temp.id
-          if (this.tab1.changeRecord.examine.temp.statueSH === 1) {
-            this.postDataPramas.parammaps.statue = 5
-          } else {
-            this.postDataPramas.parammaps.statue = 4
-          }
-          this.postDataPramas.parammaps.empId	 = Cookies.get('employeid')
-          this.postDataPramas.parammaps.workflowNote = this.tab1.changeRecord.examine.temp.workflowNote
-          PostDataByName(this.postDataPramas).then(response => {
-            console.log('设备主管审核确认发送参数', this.postDataPramas)
-            if (response.msg !== 'fail') {
-              this.tab1.changeRecord.examine.dialogFormVisible = false
-              this.tab1.changeRecord.see.dialogFormVisible = false
-              this.tab1.changeRecord.isStatueReason = false
-              this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
-              this.getTab1List3()
-              this.getTab1List()
-              this.getPendingList()
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-    // 审核2
-    handleTab1Examine3(row) {
-      console.log(' 变更记录-审核3')
-      if (row == undefined) {
-        this.tab1.changeRecord.examine.temp = this.tab1.changeRecord.see.temp
-        this.$set(this.tab1.changeRecord.see.temp, 'statueSH', 1)
-        this.$set(this.tab1.changeRecord.see.temp, 'workflowNote', '')
-      } else {
-        this.tab1.changeRecord.examine.temp = Object.assign({}, row)
-        this.$set(this.tab1.changeRecord.examine.temp, 'statueSH', 1)
-        this.$set(this.tab1.changeRecord.examine.temp, 'workflowNote', '')
-      }
-      this.dialogStatus = 'tab1examine3'
-      this.tab1.changeRecord.examine.dialogFormVisible = true
-      this.tab1.changeRecord.examine.isReason = false
-      this.keyupSubmit()
-    },
-    createExamineData3() {
-      console.log('点击了设备中心审核确认3')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['examineTemp'].validate(valid => {
-        if (valid) {
-          this.postDataPramas = {}
-          this.postDataPramas.common = { 'returnmap': '0' }
-          this.postDataPramas.data = []
-          if (this.tab1.changeRecord.examine.temp.statueSH == 1) {
-            this.postDataPramas.data[0] = { 'name': 'contractCharge1', 'type': 'e', 'parammaps': {
-              statue: 7,
-              empId: Cookies.get('employeid'),
-              workflowNote: this.tab1.changeRecord.examine.temp.workflowNote,
-              id: this.tab1.changeRecord.examine.temp.id
-            }}
-            if (this.tab1.changeRecord.examine.temp.SHtype == 1 || this.tab1.changeRecord.examine.temp.SHtype == 2) {
-              this.postDataPramas.data[1] = { 'name': 'updateContractEnable', 'type': 'e', 'parammaps': {
-                id: this.tab1.changeRecord.examine.temp.id
-              }}
-            } else if (this.tab1.changeRecord.examine.temp.SHtype == 3) {
-              this.postDataPramas.data[1] = { 'name': 'updatecontractdate', 'type': 'e', 'parammaps': {
-                pastureId: this.tab1.changeRecord.examine.temp.pastureId,
-                providerId: this.tab1.changeRecord.examine.temp.providerId,
-                stopTimeHis: this.tab1.changeRecord.examine.temp.stopTimeHis,
-                flag: this.tab1.changeRecord.examine.temp.flag,
-                isZeroStock: this.tab1.changeRecord.examine.temp.isZeroStock,
-                statue: this.tab1.changeRecord.examine.temp.statue,
-                startTime: this.tab1.changeRecord.examine.temp.startTime,
-                stopTime: this.tab1.changeRecord.examine.temp.stopTime,
-                id: this.tab1.changeRecord.examine.temp.id
-              }}
-            }
-            this.postDataPramas.data[2] = {
-                  "name": "updateBigcontractIsToSap",
-                              "type": "e",
-                              "parammaps": {
-                                  "contractCode": this.contractCodese
-                              }
-            }
-
-
-          } else {
-            this.postDataPramas.data[0] = { 'name': 'contractCharge1', 'type': 'e', 'parammaps': {
-              statue: 8,
-              empId: Cookies.get('employeid'),
-              workflowNote: this.tab1.changeRecord.examine.temp.workflowNote,
-              id: this.tab1.changeRecord.examine.temp.id
-            }}
-          }
-          ExecDataByConfig(this.postDataPramas).then(response => {
-            console.log('新增保存发送参数', this.postDataPramas)
-            if (response.msg === 'fail') {
-              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-            } else {
-              if (this.postDataPramas.data[0].parammaps.statue == 7) {
-                if (this.tab1.changeRecord.examine.temp.SHtype == 3) {
-                  this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = this.tab1.changeRecord.examine.temp.stopTimeHis
-                } else {
-                  this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = this.tab1.changeRecord.examine.temp.stopTime
-                }
-              } else {
-                this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = this.tab1.detailsSpareParts.detailsList.stopTime
-              }
-              this.tab1.changeRecord.examine.dialogFormVisible = false
-              this.tab1.changeRecord.see.dialogFormVisible = false
-              this.tab1.changeRecord.examine.isStatueReason = false
-              this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-              this.getTab1List3()
-              this.getTab1List()
-              this.getPendingList()
-            }
-          })
-        }
-      })
-    },
-    handleTab1Delete3(row) {
-      console.log('变更记录-删除')
-      console.log('点击了删除')
-      MessageBox.confirm('确认删除此条信息?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        this.postDataPramas = {}
-        this.postDataPramas.common = { 'returnmap': '0' }
-        this.postDataPramas.data = []
-        this.postDataPramas.data[0] = { 'name': 'deleteBigContract', 'type': 'e', 'parammaps': {
-          id: row.id
-        }}
-        this.postDataPramas.data[1] = { 'name': 'deleteContract', 'type': 'e', 'parammaps': {
-          bigId: row.id
-        }}
-        ExecDataByConfig(this.postDataPramas).then(response => {
-          this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
-          this.getTab1List3()
-          this.getPendingList()
-        })
-      }).catch(() => {
-        this.$message({ type: 'info', message: '已取消删除' })
-      })
-    },
-
-    // 合同明细
-    getTab2List() {
-      this.tab2.listLoading = true
-      if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
-        this.tab2.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
-        this.tab2.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
-      } else {
-        this.tab2.getdataListParm.parammaps.startTime = ''
-        this.tab2.getdataListParm.parammaps.stopTime = ''
-      }
-      GetDataByName(this.tab2.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          this.tab2.list = response.data.list
-          this.tab2.pageNum = response.data.pageNum
-          this.tab2.pageSize = response.data.pageSize
-          if (response.data.total) {
-            this.tab2.total = response.data.total
-          }
-        } else {
-          this.tab2.list = []
-        }
-        setTimeout(() => {
-          this.tab2.listLoading = false
-        }, 300)
-      })
-    },
-    handleTab2Filter() {
-      this.listLoading2 = true
-      if (this.tab2.getdataListParm.parammaps.inputDatetime === null) {
-        this.tab2.getdataListParm.parammaps.inputDatetime = ''
-      }
-      this.tab2.getdataListParm.offset = 1
-      this.getTab2List()
-    },
-    handleTab2Export() {
-      this.$alert('合同明细正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
-      this.isPercentage = true
-      this.percentage = 1
-      var timer = setInterval(() => {
-        this.percentage += 5
-        if (this.percentage > 95) {
-          this.percentage = 99
-          clearInterval(timer)
-        }
-        this.percentage = this.percentage
-      }, 1000)
-      if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
-        this.tab2.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
-        this.tab2.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
-      } else {
-        this.tab2.getdataListParm.parammaps.startTime = ''
-        this.tab2.getdataListParm.parammaps.stopTime = ''
-      }
-      this.tab2.getdataListParm.pagecount = ''
-      GetDataByName(this.tab2.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].isZeroStock == 0) {
-              response.data.list[i].isZeroStock = '否'
-            } else {
-              response.data.list[i].isZeroStock = '是'
-            }
-          }
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-        } else {
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-        }
-        this.tab2.getdataListParm.pagecount = 10
-        this.$nextTick(() => {
-          const ExcelDatas = [
-            {
-              tHeader: ['牧场', '合同编号', '合同状态', '供应商', '合同开始日期', '合同截止日期', '零库存', '备件编号', '备件名称', '规格', '备件品牌', '计量单位', '计划量', '单价', '备注', '录入人', '录入日期'],
-              filterVal: ['pastureName', 'contractCode', 'statue', 'providerName', 'startTime', 'stopTime', 'isZeroStock', 'partCode', 'partName', 'specification', 'brand', 'unit', 'planAmount', 'price', 'remark', 'creatorMan', 'creatorTime'],
-              tableDatas: response.data.list,
-              sheetName: '合同明细'
-            }
-          ]
-          json2excel(ExcelDatas, '合同明细', true, 'xlsx')
-        })
-      })
-    },
-    sapUpload(){
-      if(this.selectList.length == 0){
-        this.$notify({ title: '失败', message: '请勾选数据!'  , type: 'error', duration: 2000 })
-        return false
-      }
-      let url = 'authdata/contract/push'
-      let ids = []
-      this.selectList.forEach((i)=>{
-        ids.push(i.id)
-        console.log(i,'===')
-      })
-      let data = {
-        pastureId:parseInt(Cookies.get('pastureid')),
-        providerId:this.tab1.detailsSpareParts.detailsList.providerId,
-        contractIdList:ids
-      }
-      postJson(url,data).then(response => {
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
-        } else {
-          this.$notify({ title: '上传失败', message: response.data, type: 'warning', duration: 2000 })
-        }
-      })
-    }
-  }
-}
-</script>
-<style lang="scss" scoped>
-  /deep/ .el-badge__content.is-fixed{
-    z-index: 1;
-  }
-  .el-notification__content {
-    white-space: pre-line !important;
-  }
-</style>
-<style lang="scss">
-  .el-notification__content {
-      white-space: pre-line !important;
-    }
-</style>
+<template>
+  <div class="app-container">
+    <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
+      <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
+      <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
+    </div>
+    <el-tabs v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="合同管理" name="first">
+        <div v-if="isContractManagement" class="contractManagement">
+          <div class="filter-container">
+            <el-select v-model="tab1.contractManagement.getdataListParm.parammaps.pastureName" placeholder="牧场" style="width:120px" class="filter-item">
+              <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
+            </el-select>
+            <el-input v-model="tab1.contractManagement.getdataListParm.parammaps.contractCode" placeholder="合同编号" style="width: 140px;" class="filter-item" />
+            <el-select v-model="tab1.contractManagement.getdataListParm.parammaps.statue" clearable placeholder="合同状态" class="filter-item" style="width: 120px;">
+              <el-option v-for="item in contractStatusList" :key="item.id" :label="item.name" :value="item.name" />
+            </el-select>
+            <el-select v-model="tab1.contractManagement.getdataListParm.parammaps.providerName" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
+              <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.name" />
+            </el-select>
+            <el-select v-model="tab1.contractManagement.getdataListParm.parammaps.isZeroStock" clearable placeholder="是否零库存" class="filter-item" style="width: 120px;">
+              <el-option v-for="item in isZeroInventoryList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+            <el-date-picker ref="tab1InputDatetime1" v-model="tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
+            <el-date-picker ref="tab1InputDatetime2" v-model="tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="审批日期" end-placeholder="审批日期" />
+            <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleTab1Filter">搜索</el-button>
+            <div>
+              <el-button v-if="tab1.contractManagement.isContractAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="handleTab1Create">新增</el-button>
+              <el-radio-group v-model="tab1.contractManagement.radioAll" style="margin-top:-9px" @change="changeContractManagementAll()">
+                <el-radio-button label="全部" />
+                <el-badge :value="pending.total" class="item">
+                  <el-radio-button label="待处理" />
+                </el-badge>
+                <el-radio-button label="已处理" />
+              </el-radio-group>
+            </div>
+          </div>
+          <el-table
+            :key="tab1.contractManagement.tableKey"
+            v-loading="tab1.contractManagement.listLoading"
+            element-loading-text="给我一点时间"
+            :data="tab1.contractManagement.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :max-height="myHeight"
+          >
+            <el-table-column label="序号" align="center" type="index" width="50px">
+              <template slot-scope="scope">
+                <span>{{ scope.$index + (tab1.contractManagement.pageNum-1) * tab1.contractManagement.pageSize + 1 }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="牧场" min-width="120px" align="center" prop="pastureName" />
+            <el-table-column label="合同编号" min-width="120px" align="center" prop="contractCode" />
+            <el-table-column label="合同状态" min-width="110px" align="center" prop="statued" />
+            <el-table-column label="供应商" min-width="120px" align="center" prop="providerName" />
+            <el-table-column label="合同开始日期" sortable min-width="120px" align="center" prop="startTime" />
+            <el-table-column label="合同截止日期" sortable min-width="120px" align="center" prop="stopTime" />
+            <el-table-column label="零库存" min-width="110px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.isZeroStock == 0">否</span>
+                <span v-if="scope.row.isZeroStock == 1">是</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="录入人" min-width="120px" align="center" prop="creatorMan" />
+            <el-table-column label="录入时间" sortable min-width="120px" align="center" prop="creatorTime" />
+            <el-table-column label="审批时间" sortable min-width="120px" align="center" prop="SHdateTime" />
+            <el-table-column label="操作" align="center" width="350px" class-name="small-padding fixed-width" fixed="right">
+              <template slot-scope="{row}">
+                <el-button v-if="tab1.contractManagement.isContractSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
+                <el-button v-if="tab1.contractManagement.isContractSee" type="primary" style="width:70px;" size="mini" @click="handleTab1DetailsSpareParts(row)">备件明细</el-button>
+                <el-button v-if="tab1.contractManagement.isContractSee" type="primary" style="width:70px;" size="mini" @click="handleTab1ChangeRecord(row)">变更记录</el-button>
+                <el-button v-if="tab1.contractManagement.isContractChange && (row.statued == '正常' || row.statued == '已过期')" :disabled="parseInt(row.pastureId) == 18 && parseInt(isGroupAdministrator) !== 18" type="warning" size="mini" @click="handleTab1Change(row)">变更</el-button>
+              </template>
+              <!-- //parseInt(row.pastureId) == 18 && parseInt(isGroupAdministrator) == 18 -->
+            </el-table-column>
+          </el-table>
+          <pagination v-show="tab1.contractManagement.total>0" :total="tab1.contractManagement.total" :page.sync="tab1.contractManagement.getdataListParm.offset" :limit.sync="tab1.contractManagement.getdataListParm.pagecount" @pagination="getTab1List" />
+        </div>
+        <div v-if="isDetailsSpareParts" class="DetailsSpareParts">
+          <div class="title" style="height: 30px;">
+            <b style="font-size: 20px;float: left;">备件明细</b>
+            <a style="float: right;font-weight: 600;font-size: 20px;" @click="handleTab1goBack()">&lt;返回</a>
+          </div>
+          <div class="filter-container">
+            <el-input v-model="tab1.detailsSpareParts.getdataListParm.parammaps.partCode" placeholder="备件编号" style="width: 140px;" class="filter-item" />
+            <el-input v-model="tab1.detailsSpareParts.getdataListParm.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
+            <el-input v-model="tab1.detailsSpareParts.getdataListParm.parammaps.specification" placeholder="备件规格" style="width: 140px;" class="filter-item" />
+            <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleTab1Filter2">搜索</el-button>
+            <!-- <el-button v-waves class="filter-item" type="success" icon="el-icon-edit" @click="change_enabled">启用</el-button> -->
+            <el-button v-if="isContractJinyong" v-waves class="filter-item" type="danger" icon="el-icon-edit" @click="change_no">禁用</el-button>
+          </div>
+          <div class="filter-container">
+            <el-button v-if="tab1.contractManagement.isContractAdd && parseInt(tab1.detailsSpareParts.detailsList.pastureId) == parseInt(isGroupAdministrator) || parseInt(isEmployeid) == 0" class="filter-item" type="primary" icon="el-icon-edit" :disabled="tab1.detailsSpareParts.detailsList.statued=='终止' || tab1.detailsSpareParts.detailsList.statued=='已过期' || tab1.detailsSpareParts.detailsList.statued=='新增未通过'" @click="handleTab1Create2">新增</el-button>
+            <el-button v-if="tab1.contractManagement.isContractChange && parseInt(tab1.detailsSpareParts.detailsList.pastureId) == parseInt(isGroupAdministrator) || parseInt(isEmployeid) == 0" class="filter-item" type="primary" icon="el-icon-edit" :disabled="tab1.detailsSpareParts.detailsList.statued=='终止' || tab1.detailsSpareParts.detailsList.statued=='已过期' || tab1.detailsSpareParts.detailsList.statued=='新增未通过'" @click="handleTab1Change2">变更</el-button>
+            <el-button v-if="tab1.contractManagement.isContractExport" class="filter-item" type="primary" icon="el-icon-edit" @click="handleTab1Export2">导出</el-button>
+            <el-button v-if="tab1.contractManagement.isContractUplaod" class="filter-item" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
+          </div>
+          <el-table
+            :key="tab1.detailsSpareParts.tableKey"
+            v-loading="tab1.detailsSpareParts.listLoading"
+            element-loading-text="给我一点时间"
+            :data="tab1.detailsSpareParts.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :max-height="myHeight"
+            @sort-change="tableSort1"
+            @selection-change="handleSelectionChange"
+          >
+            <el-table-column type="selection" width="55" />
+            <el-table-column label="序号" align="center" type="index" width="50px">
+              <template slot-scope="scope">
+                <span>{{ scope.$index + (tab1.detailsSpareParts.pageNum-1) * tab1.detailsSpareParts.pageSize + 1 }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="备件编号" min-width="120px" align="center" prop="partCode" />
+            <el-table-column label="备件名称" min-width="120px" align="center" prop="partName" />
+            <el-table-column label="备件规格" min-width="120px" align="center" prop="specification" />
+            <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
+              <template slot-scope="scope">
+                <el-popover placement="right" title="" trigger="hover">
+                  <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
+                  <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
+                </el-popover>
+              </template>
+            </el-table-column>
+            <el-table-column label="备件品牌" min-width="120px" align="center" prop="brand" />
+            <el-table-column label="计量单位" min-width="120px" align="center" prop="unit" />
+            <el-table-column label="计划量" sortable min-width="120px" align="center" prop="planAmount" />
+            <el-table-column label="单价" sortable min-width="120px" align="center" prop="price" />
+            <el-table-column label="使用周期" min-width="120px" align="center" prop="lifeCycle" />
+            <el-table-column label="合同差异项" min-width="120px" align="center" prop="contractVarianceItem" />
+            <el-table-column label="备注" sortable min-width="120px" align="center" prop="remark" />
+          </el-table>
+          <pagination v-show="tab1.detailsSpareParts.total>0" :total="tab1.detailsSpareParts.total" :page.sync="tab1.detailsSpareParts.getdataListParm.offset" :limit.sync="tab1.detailsSpareParts.getdataListParm.pagecount" @pagination="getTab1List2" />
+        </div>
+
+        <div v-if="isChangeRecord" class="ChangeRecord">
+          <div class="title" style="height: 30px;">
+            <b style="font-size: 20px;float: left;">变更记录</b>
+            <a style="float: right;font-weight: 600;font-size: 20px;" @click="handleTab1goBack2()">&lt;返回</a>
+          </div>
+          <div class="filter-container">
+            <el-input v-model="tab1.changeRecord.getdataListParm.parammaps.contractCode" placeholder="流水编号" style="width: 140px;" class="filter-item" />
+            <el-select v-model="tab1.changeRecord.getdataListParm.parammaps.SHtype" clearable placeholder="变更类型" class="filter-item" style="width: 120px;">
+              <el-option v-for="item in changeTypeList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+            <el-select v-model="tab1.changeRecord.getdataListParm.parammaps.stuteSH" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
+              <el-option v-for="item in auditStatusList" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
+            <el-date-picker ref="tab1InputDatetime3" v-model="tab1.changeRecord.getdataListParm.parammaps.tab1InputDatetime3" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
+            <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleTab1Filter3">搜索</el-button>
+          </div>
+          <div class="filter-container">
+            <el-radio-group v-model="tab1.changeRecord.radioAll" style="margin-top:-9px" @change="changeChangeRecordAll()">
+              <el-radio-button label="全部" />
+              <el-radio-button label="待处理" />
+              <el-radio-button label="已处理" />
+            </el-radio-group>
+          </div>
+          <el-table
+            :key="tab1.changeRecord.tableKey"
+            v-loading="tab1.changeRecord.listLoading"
+            element-loading-text="给我一点时间"
+            :data="tab1.changeRecord.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :max-height="myHeight"
+          >
+            <el-table-column label="序号" align="center" type="index" width="50px">
+              <template slot-scope="scope">
+                <span>{{ scope.$index + (tab1.changeRecord.pageNum-1) * tab1.changeRecord.pageSize + 1 }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="流水编号" min-width="120px" align="center" prop="contractCode" />
+            <el-table-column label="变更类型" min-width="110px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.SHtype == 0">新增合同</span>
+                <span v-if="scope.row.SHtype == 1">新增备件</span>
+                <span v-if="scope.row.SHtype == 2">变更备件</span>
+                <span v-if="scope.row.SHtype == 3">合同变更</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="录入人" min-width="120px" align="center" prop="creatorMan" />
+            <el-table-column label="录入时间" sortable min-width="120px" align="center" prop="creatorTime" />
+            <el-table-column label="审核状态" min-width="110px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.SHStatus == 2 || scope.row.SHStatus == 3 || scope.row.SHStatus == 5">审核中</span>
+                <span v-if="scope.row.SHStatus == 4 || scope.row.SHStatus == 6 || scope.row.SHStatus == 8">未通过</span>
+                <span v-if="scope.row.SHStatus == 7">通过</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center" width="350px" class-name="small-padding fixed-width" fixed="right">
+              <template slot-scope="{row}">
+                <el-button type="primary" size="mini" @click="handleTab1See3(row)">查看</el-button>
+                <el-button v-if="tab1.changeRecord.isContractDelete && (row.SHStatus == 4 || row.SHStatus == 6 || row.SHStatus == 8)" type="success" size="mini" @click="handleTab1Update3(row)">编辑</el-button>
+                <el-button v-if="tab1.changeRecord.isContractExamineZG && row.SHStatus == 2" type="success" style="display:inline-block" size="mini" @click="handleTab1Examine(row)">审核1</el-button>
+                <el-button v-else type="success" style="display:none" size="mini" @click="handleTab1Examine(row)">审核1</el-button>
+                <!-- 设备助理审核 -->
+                <!-- <el-button v-if="tab1.changeRecord.isContractExamineZL && row.SHStatus == 3" type="success" style="display:inline-block" size="mini" @click="handleExamine2(row)">审核2</el-button>
+                <el-button v-else type="success" style="display:none" size="mini" @click="handleExamine2(row)">审核2</el-button> -->
+                <!-- 设备中心审核 -->
+                <el-button v-if="tab1.changeRecord.isContractExamineZX && row.SHStatus == 5" type="success" style="display:inline-block" size="mini" @click="handleTab1Examine3(row)">审核2</el-button>
+                <el-button v-else type="success" style="display:none" size="mini" @click="handleTab1Examine3(row)">审核2</el-button>
+                <el-button v-if="tab1.changeRecord.isContractDelete && (row.SHStatus == 4 || row.SHStatus == 6 || row.SHStatus == 8) " type="danger" size="mini" @click="handleTab1Delete3(row)">删除</el-button>
+                <el-button v-else style="display:none" type="danger" size="mini" @click="handleTab1Delete3(row)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <pagination v-show="tab1.changeRecord.total>0" :total="tab1.changeRecord.total" :page.sync="tab1.changeRecord.getdataListParm.offset" :limit.sync="tab1.changeRecord.getdataListParm.pagecount" @pagination="getTab1List3" />
+        </div>
+      </el-tab-pane>
+      <el-tab-pane label="合同明细" name="second">
+        <div class="filter-container">
+          <el-select v-model="tab2.getdataListParm.parammaps.pastureName" placeholder="牧场" style="width:120px" class="filter-item">
+            <el-option v-for="item in findAllPastureList2" :key="item.id" :label="item.name" :value="item.name" />
+          </el-select>
+          <el-input v-model="tab2.getdataListParm.parammaps.contractCode" placeholder="合同编号" style="width: 140px;" class="filter-item" />
+          <el-select v-model="tab2.getdataListParm.parammaps.statue" clearable placeholder="合同状态" class="filter-item" style="width: 120px;">
+            <el-option v-for="item in contractStatusList" :key="item.id" :label="item.name" :value="item.name" />
+          </el-select>
+          <el-select v-model="tab2.getdataListParm.parammaps.isZeroStock" clearable placeholder="是否零库存" class="filter-item" style="width: 120px;">
+            <el-option v-for="item in isZeroInventoryList" :key="item.id" :label="item.name" :value="item.id" />
+          </el-select>
+          <el-input v-model="tab2.getdataListParm.parammaps.partCode" placeholder="备件编号" style="width: 140px;" class="filter-item" />
+          <el-input v-model="tab2.getdataListParm.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
+          <el-select v-model="tab2.getdataListParm.parammaps.providerName" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
+            <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.name" />
+          </el-select>
+          <el-date-picker ref="inputDatetime" v-model="tab2.getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
+          <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleTab2Filter">搜索</el-button>
+          <el-button v-if="tab1.contractManagement.isContractExport" class="filter-item" type="primary" icon="el-icon-edit" @click="handleTab2Export">导出</el-button>
+        </div>
+        <el-table
+          :key="tab2.tableKey"
+          v-loading="tab2.listLoading"
+          element-loading-text="给我一点时间"
+          :data="tab2.list"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+          :max-height="myHeight"
+          @sort-change="tableSort2"
+        >
+          <el-table-column label="序号" align="center" type="index" width="50px">
+            <template slot-scope="scope">
+              <span>{{ scope.$index + (tab2.pageNum-1) * tab2.pageSize + 1 }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="牧场" min-width="110px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.pastureName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="合同编号" min-width="130px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.contractCode }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="合同状态" min-width="100px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.statue }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="供应商" min-width="120px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.providerName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="合同开始日期" sortable prop="startTime" min-width="110px" align="center" />
+          <el-table-column label="合同截止日期" sortable prop="stopTime" min-width="110px" align="center" />
+          <el-table-column label="零库存" min-width="110px" align="center">
+            <template slot-scope="scope">
+              <span v-if="scope.row.isZeroStock == 0">否</span>
+              <span v-if="scope.row.isZeroStock == 1">是</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件编号" min-width="110px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.partCode }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件名称" min-width="110px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.partName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件规格" min-width="110px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.specification }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件品牌" min-width="110px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.brand }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="计量单位" min-width="110px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.unit }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="计划量" sortable prop="planAmount" min-width="110px" align="center" />
+          <el-table-column label="单价" sortable prop="price" min-width="110px" align="center" />
+          <el-table-column label="备注" min-width="110px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.remark }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="录入人" min-width="110px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.creatorMan }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="录入日期" sortable prop="creatorTime" min-width="110px" align="center" />
+        </el-table>
+        <pagination v-show="tab2.total>0" :total="tab2.total" :page.sync="tab2.getdataListParm.offset" :limit.sync="tab2.getdataListParm.pagecount" @pagination="getTab2List" />
+      </el-tab-pane>
+    </el-tabs>
+    <!-- 合同管理新增/查看/变更 -->
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="tab1.contractManagement.create.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <div class="app-add">
+        <el-form ref="createTemp" :rules="rules" :model="tab1.contractManagement.create.temp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="合同编号:" prop="contractCode">
+                <el-input ref="contractCode" v-model="tab1.contractManagement.create.temp.contractCode" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="牧场:" prop="pastureId">
+                <el-select v-model="tab1.contractManagement.create.temp.pastureId" placeholder="牧场" class="filter-item" style="width:100%;" :disabled="disabled">
+                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="供应商:" prop="providerName">
+                <el-autocomplete v-model="tab1.contractManagement.create.temp.providerName" :disabled="dialogStatus==='see' || tab1.contractManagement.isDisabled || dialogStatus==='change'" value-key="name" class="inline-input" :fetch-suggestions="providerSearch" placeholder="请输入供应商名称或供应商编号" style="width:100%;" @focus="handleFocusProvider" @blur="handleBlurProvider" @select="handleSelectProvider" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="开始日期:" prop="startTime">
+                <el-date-picker v-model="tab1.contractManagement.create.temp.startTime" :disabled="dialogStatus==='see' || tab1.contractManagement.isDisabled || dialogStatus==='change'" type="date" placeholder="开始日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTime" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="截止日期:" prop="stopTime">
+                <el-date-picker v-model="tab1.contractManagement.create.temp.stopTime" style="width:100%;" :disabled="dialogStatus==='see' || tab1.contractManagement.isDisabled" type="date" :clearable="false" placeholder="截止日期" :picker-options="pickerOptions2" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="changeTime" />
+              </el-form-item>
+            </el-col>
+            <el-col v-if="dialogStatus=='create'" :span="8">
+              <el-form-item label="合同状态:" prop="statue">
+                <el-select v-model="tab1.contractManagement.create.temp.statue" clearable placeholder="合同状态" class="filter-item" style="width: 100%;" disabled>
+                  <el-option v-for="item in contractStatus2List" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col v-if="dialogStatus=='change' || dialogStatus=='see'" :span="8">
+              <el-form-item label="合同状态:" prop="statued">
+                <el-input ref="contractCode" v-model="tab1.contractManagement.create.temp.statued" placeholder="合同状态" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="零库存:" prop="isZeroStock">
+                <el-radio-group v-model="tab1.contractManagement.create.temp.isZeroStock" :disabled="dialogStatus==='see' || tab1.contractManagement.isDisabled || dialogStatus==='change'" @change="changeIsZero">
+                  <el-radio v-model="tab1.contractManagement.create.temp.isZeroStock" :label="1">是</el-radio>
+                  <el-radio v-model="tab1.contractManagement.create.temp.isZeroStock" :label="0">否</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="录入人:" prop="creatorId">
+                <el-select ref="creatorId" v-model="tab1.contractManagement.create.temp.creatorId" :disabled="tab1.contractManagement.isDisabled || dialogStatus==='see' || dialogStatus==='change'" placeholder="录入人" class="filter-item" style="width:100%;" @change="changeCreatorMan">
+                  <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="录入日期:" prop="creatorTime">
+                <el-date-picker v-model="tab1.contractManagement.create.temp.creatorTime" :disabled="disabled" type="date" :picker-options="pickerOptions3" placeholder="录入日期" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="备注:" prop="remark">
+                <el-input ref="remark" v-model="tab1.contractManagement.create.temp.remark" placeholder="备注" :disabled="tab1.contractManagement.isDisabled || dialogStatus==='see' || dialogStatus==='change'" />
+              </el-form-item>
+            </el-col>
+            <el-col v-if="dialogStatus !== 'see'" :span="8">
+              <el-form-item label="同步牧场:" prop="synchronousPasture">
+                <el-select v-model="tab1.contractManagement.create.temp.synchronousPasture" multiple collapse-tags placeholder="同步牧场" :disabled="isGroupAdministrator !== '18'">
+                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col v-else :span="16">
+              <el-form-item label="同步牧场:" prop="pastureName2">
+                <el-input v-model="tab1.contractManagement.create.temp.pastureName2" type="textarea" :rows="2" placeholder="同步牧场" :disabled="dialogStatus=='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <!-- <el-row v-if="dialogStatus == 'see'">
+            <el-col>
+              <el-form-item label="流程进度1" />
+              <el-steps :active="tab1.contractManagement.create.temp.active" align-center finish-status="success">
+                <el-step
+                  v-for="(item,index) in tab1.contractManagement.create.temp.activeList"
+                  :key="index"
+                  :title="item.title"
+                  :status="item.status"
+                >
+                  <template slot="description">
+                    <div class="step-row">
+                      <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
+                      <div>{{ item.reason }}</div>
+                    </div>
+                  </template>
+                </el-step>
+              </el-steps>
+            </el-col>
+          </el-row> -->
+        </el-form>
+        <div slot="footer" class="dialog-footer" style="bottom:5px">
+          <el-button v-if="dialogStatus =='change'" type="primary" @click="terminationData()">终止合同</el-button>
+          <el-button v-if="dialogStatus !=='see'" type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():changeData()">保存并关闭</el-button>
+          <el-button @click="tab1.contractManagement.create.dialogFormVisible = false;getTab1List();tab1.contractManagement.create.temp.providerName=''">取消并关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+
+    <!-- 备件明细新增/变更 -->
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="tab1.detailsSpareParts.create.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <div v-if="tab1.detailsSpareParts.updateList.SHtype !== 0 && tab1.detailsSpareParts.updateList.SHtype !== 3" class="app-add">
+        <el-form ref="createTemp2" :rules="rules" :model="tab1.detailsSpareParts.create.temp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
+          <el-row>
+            <el-col :span="10">
+              <el-form-item label="备件:" prop="partCode">
+                <el-autocomplete v-model="tab1.detailsSpareParts.partCode" value-key="name1" class="inline-input" :fetch-suggestions="sparePartSearch" placeholder="请输入备件编号或备件名称或备件规格" style="width:550px" @select="handleSelectSparePart">
+                  <template slot-scope="{ item }">
+                    <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
+                    |  &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
+                    |  &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
+                  </template>
+                </el-autocomplete>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div v-if="dialogStatus=='tab1create2'" class="filter-container" style="float: right;">
+          <el-button v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleTab1DownloadTemp2">模板</el-button>
+          <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
+            <el-button v-waves :disabled="tab1.detailsSpareParts.isDisabledImport" class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
+          </el-upload>
+        </div>
+        <el-table
+          :key="tab1.detailsSpareParts.tableKeyAdd"
+          v-loading="tab1.detailsSpareParts.listLoadingAdd"
+          element-loading-text="给我一点时间"
+          :data="tab1.detailsSpareParts.listAdd"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+        >
+          <el-table-column label="序号" align="center" type="index" width="50px" />
+          <el-table-column label="备件编号" min-width="90px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.partCode }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件名称" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.partName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件规格" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.specification }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
+            <template slot-scope="scope">
+              <el-popover placement="right" title="" trigger="hover">
+                <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
+                <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
+              </el-popover>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件品牌" min-width="120px" align="center">
+            <template slot-scope="scope">
+              <el-autocomplete v-model="scope.row.brand" value-key="brandName" class="inline-input" :fetch-suggestions="brandSearch" placeholder="请输入品牌" style="width:100%;" @focus="handleFocusBrand( scope.row)" @blur="handleBlurBrand(scope.row)" @select="(value)=> {handleSelectBrand(value, scope.row)}" />
+            </template>
+          </el-table-column>
+          <el-table-column label="计量单位" min-width="60px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.unit }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="计划量" min-width="70px" align="center" valign="middle">
+            <template slot-scope="scope">
+              <el-form :model="scope.row" :rules="rules">
+                <el-form-item prop="planAmount">
+                  <el-input ref="planAmount" v-model="scope.row.planAmount" style="margin-top:15px" />
+                </el-form-item>
+              </el-form>
+            </template>
+          </el-table-column>
+          <el-table-column label="单价" min-width="80px" align="center" valign="middle">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.price" />
+            </template>
+          </el-table-column>
+          <el-table-column label="使用周期" min-width="110px" align="center" valign="middle">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.lifeCycle" />
+            </template>
+          </el-table-column>
+          <el-table-column label="合同差异项" min-width="110px" align="center" valign="middle">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.contractVarianceItem" />
+            </template>
+          </el-table-column>
+          <el-table-column label="备注" min-width="110px" align="center">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.remark" type="textarea" placeholder="备注" autosize maxlength="100" show-word-limit />
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" align="center" width="100px" class-name="small-padding fixed-width" fixed="right">
+            <template slot-scope="{row}">
+              <a class="del" :disabled="isokDisable" @click="partDelete(row)">删除</a>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div v-if="tab1.detailsSpareParts.updateList.SHtype == 0 || tab1.detailsSpareParts.updateList.SHtype == 3" class="app-add">
+        <el-form ref="createTemp2" :rules="rules" :model="tab1.detailsSpareParts.create.temp" label-position="right" label-width="130px" style="width: 90%;margin:0 auto;">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="牧场:" prop="pastureName">
+                <el-input ref="pastureName" v-model="tab1.detailsSpareParts.create.temp.pastureName" placeholder="牧场" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="合同编号:" prop="contractCode">
+                <el-input ref="contractCode" v-model="tab1.detailsSpareParts.create.temp.contractCode" placeholder="合同编号" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="供应商:" prop="providerName">
+                <el-input ref="providerName" v-model="tab1.detailsSpareParts.create.temp.providerName" placeholder="合同编号" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="开始日期:" prop="startTime">
+                <el-date-picker v-model="tab1.detailsSpareParts.create.temp.startTime" :disabled="tab1.detailsSpareParts.create.temp.SHtype == 3" type="date" placeholder="开始日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
+              </el-form-item>
+            </el-col>
+            <el-col v-if="dialogStatus == 'tab1Update2' && tab1.detailsSpareParts.updateList.SHtype == 0" :span="8">
+              <el-form-item label="截止日期:" prop="stopTime">
+                <el-date-picker v-model="tab1.detailsSpareParts.create.temp.stopTime" type="date" placeholder="截止日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
+              </el-form-item>
+            </el-col>
+            <el-col v-if="dialogStatus == 'tab1Update2' && tab1.detailsSpareParts.updateList.SHtype !== 0" :span="8">
+              <el-form-item label="截止日期后:" prop="stopTimeHis">
+                <el-date-picker v-model="tab1.detailsSpareParts.create.temp.stopTimeHis" type="date" placeholder="截止日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :picker-options="pickerOptions2" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="合同状态:" prop="statued">
+                <span>{{ tab1.detailsSpareParts.create.temp.statued }}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="零库存:" prop="isZeroStock">
+                <el-radio-group v-model="tab1.detailsSpareParts.create.temp.isZeroStock" :disabled="tab1.detailsSpareParts.create.temp.SHtype == 3">
+                  <el-radio v-model="tab1.detailsSpareParts.create.temp.isZeroStock" :label="1">是</el-radio>
+                  <el-radio v-model="tab1.detailsSpareParts.create.temp.isZeroStock" :label="0">否</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="录入人:" prop="creatorMan">
+                <el-input ref="creatorMan" v-model="tab1.detailsSpareParts.create.temp.creatorMan" placeholder="录入人" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="录入日期:" prop="creatorTime">
+                <el-date-picker v-model="tab1.detailsSpareParts.create.temp.creatorTime" :disabled="tab1.detailsSpareParts.create.temp.SHtype == 3 || dialogStatus=='tab1Update2' " type="date" placeholder="截止日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="备注:" prop="remark">
+                <el-input ref="remark" v-model="tab1.detailsSpareParts.create.temp.remark" placeholder="备注" />
+              </el-form-item>
+            </el-col>
+            <el-col v-if="tab1.detailsSpareParts.create.temp.SHtype !== 0 && dialogStatus !=='tab1Update2'" :span="8">
+              <el-form-item label="变更后截止日期:" prop="stopTimeHis">
+                <el-date-picker v-model="tab1.detailsSpareParts.create.temp.stopTimeHis" :disabled="tab1.detailsSpareParts.create.temp.SHtype !== 3" type="date" placeholder="截止日期" :clearable="false" style="width:100%;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :picker-options="pickerOptions2" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+      <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
+        <el-button v-if="dialogStatus=='tab1create2'" type="primary" :disabled="isokDisable" @click="add_dialog_save2()">保存并关闭</el-button>
+        <el-button v-if="dialogStatus=='tab1change2'" type="primary" :disabled="isokDisable" @click="changeData2()">保存并关闭</el-button>
+        <el-button v-if="dialogStatus=='tab1Update2'" type="primary" :disabled="isokDisable" @click="edit_dialog_save2()">保存并关闭</el-button>
+        <el-button @click="tab1.detailsSpareParts.create.dialogFormVisible = false;">关闭</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 变更记录查看 -->
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="tab1.changeRecord.see.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <div class="app-see">
+        <div class="app-contentcard">
+          <el-form ref="seeTemp" :rules="rules" :model="tab1.changeRecord.see.temp" label-position="right" label-width="128px" style="width: 90%;margin:0 auto;">
+            <div v-if="tab1.changeRecord.see.temp.SHtype == 0 || tab1.changeRecord.see.temp.SHtype == 3">
+              <el-row>
+                <el-col :span="8">
+                  <el-form-item label="牧场:" prop="pastureName">
+                    <span> {{ tab1.changeRecord.see.temp.pastureName }} </span>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="合同编号:" prop="contractCode">
+                    <span> {{ tab1.changeRecord.see.temp.contractCode }} </span>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="供应商:" prop="providerName">
+                    <span> {{ tab1.changeRecord.see.temp.providerName }} </span>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row>
+                <el-col :span="8">
+                  <el-form-item label="开始日期:" prop="startTime">
+                    <span> {{ tab1.changeRecord.see.temp.startTime }} </span>
+                  </el-form-item>
+                </el-col>
+                <el-col v-if="dialogStatus !== 'tab1See2'" :span="8">
+                  <el-form-item label="截止日期:" prop="stopTime">
+                    <span> {{ tab1.changeRecord.see.temp.stopTime }} </span>
+                  </el-form-item>
+                </el-col>
+                <el-col v-if="dialogStatus == 'tab1See2' && tab1.changeRecord.see.temp.SHtype !== 3 && tab1.changeRecord.see.temp.SHtype !== 0" :span="8">
+                  <el-form-item label="截止日期:" prop="stopTimeHis">
+                    <span> {{ tab1.changeRecord.see.temp.stopTimeHis }} </span>
+                  </el-form-item>
+                </el-col>
+                <el-col v-if="dialogStatus == 'tab1See2' && tab1.changeRecord.see.temp.SHtype == 3" :span="8">
+                  <el-form-item label="截止日期:" prop="stopTime">
+                    <span> {{ tab1.changeRecord.see.temp.stopTime }} </span>
+                  </el-form-item>
+                </el-col>
+                <el-col v-if="dialogStatus == 'tab1See2' && tab1.changeRecord.see.temp.SHtype == 0" :span="8">
+                  <el-form-item label="截止日期:" prop="stopTime">
+                    <span> {{ tab1.changeRecord.see.temp.stopTime }} </span>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="合同状态:" prop="statued">
+                    <span>{{ tab1.changeRecord.see.temp.statued }}</span>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row>
+                <el-col :span="8">
+                  <el-form-item label="零库存:" prop="isZeroStock">
+                    <el-radio-group v-model="tab1.changeRecord.see.temp.isZeroStock" disabled>
+                      <el-radio v-model="tab1.changeRecord.see.temp.isZeroStock" :label="1">是</el-radio>
+                      <el-radio v-model="tab1.changeRecord.see.temp.isZeroStock" :label="0">否</el-radio>
+                    </el-radio-group>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="录入人:" prop="creatorMan">
+                    <span> {{ tab1.changeRecord.see.temp.creatorMan }} </span>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="录入日期:" prop="creatorTime">
+                    <span> {{ tab1.changeRecord.see.temp.creatorTime }} </span>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row>
+                <el-col :span="8">
+                  <el-form-item label="备注:" prop="remark">
+                    <span> {{ tab1.changeRecord.see.temp.remark }} </span>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="共享牧场:" prop="pastureNamesOld">
+                    <span> {{ tab1.changeRecord.see.temp.pastureNamesOld }} </span>
+                  </el-form-item>
+                </el-col>
+                <el-col v-if="tab1.changeRecord.see.temp.SHtype == 3" :span="8">
+                  <el-form-item label="变更后截止日期:" prop="stopTimeHis">
+                    <span> {{ tab1.changeRecord.see.temp.stopTimeHis }} </span>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row>
+                <el-col :span="8">
+                  <el-form-item label="变更后共享牧场:" prop="pastureNamesNow">
+                    <span> {{ tab1.changeRecord.see.temp.pastureNamesNow }} </span>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </div>
+            <div v-if="tab1.changeRecord.see.temp.SHtype == 1 || tab1.changeRecord.see.temp.SHtype == 2">
+              <el-row>
+                <el-col :span="8">
+                  <el-form-item label="流水编号:" prop="contractCode">
+                    <span> {{ tab1.changeRecord.see.temp.contractCode }} </span>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="录入人:" prop="creatorMan">
+                    <span> {{ tab1.changeRecord.see.temp.creatorMan }} </span>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="录入日期:" prop="creatorTime">
+                    <span> {{ tab1.changeRecord.see.temp.creatorTime }} </span>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </div>
+          </el-form>
+          <div v-if="tab1.changeRecord.see.temp.SHtype == 1">
+            <el-table
+              :key="tab1.changeRecord.see.tableKey"
+              element-loading-text="给我一点时间"
+              :data="tab1.changeRecord.see.list"
+              border
+              fit
+              highlight-current-row
+              style="width: 100%;"
+              :row-style="rowStyle"
+              :cell-style="cellStyle"
+              class="elTable table-fixed"
+            >
+              <el-table-column label="序号" align="center" type="index" width="50px">
+                <template slot-scope="scope">
+                  <span>{{ scope.$index + (tab1.changeRecord.see.pageNum-1) * tab1.changeRecord.see.pageSize + 1 }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="备件编号" min-width="110px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.partCode }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="备件名称" min-width="130px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.partName }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="备件规格" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.specification }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
+                <template slot-scope="scope">
+                  <el-popover placement="right" title="" trigger="hover">
+                    <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
+                    <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
+                  </el-popover>
+                </template>
+              </el-table-column>
+              <el-table-column label="备件品牌" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.brand }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="计量单位" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.unit }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="计划量" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.planAmount }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="单价" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.price }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="备注" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.remark }}</span>
+                </template>
+              </el-table-column>
+            </el-table>
+            <pagination v-show="tab1.changeRecord.see.total>0" :total="tab1.changeRecord.see.total" :page.sync="tab1.changeRecord.see.getdataListParm.offset" :limit.sync="tab1.changeRecord.see.getdataListParm.pagecount" @pagination="getTab1List3See" />
+          </div>
+          <div v-if="tab1.changeRecord.see.temp.SHtype == 2">
+            <el-table
+              :key="tab1.changeRecord.see.tableKey"
+              element-loading-text="给我一点时间"
+              :data="tab1.changeRecord.see.list"
+              border
+              fit
+              highlight-current-row
+              style="width: 100%;"
+              :row-style="rowStyle"
+              :cell-style="cellStyle"
+              class="elTable table-fixed"
+            >
+              <el-table-column label="序号" align="center" type="index" width="50px">
+                <template slot-scope="scope">
+                  <span>{{ scope.$index + (tab1.changeRecord.see.pageNum-1) * tab1.changeRecord.see.pageSize + 1 }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="备件编号" min-width="110px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.partCode }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="备件名称" min-width="130px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.partName }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="备件规格" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.specification }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
+                <template slot-scope="scope">
+                  <el-popover placement="right" title="" trigger="hover">
+                    <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
+                    <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
+                  </el-popover>
+                </template>
+              </el-table-column>
+              <el-table-column label="备件品牌" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.brandhis }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="变更后品牌" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.brand }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="计量单位" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.unit }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="计划量" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.planAmounthis }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="变更后计划量" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.planAmount }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="单价" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.pricehis }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="变更后单价" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.price }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="备注" min-width="80px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.remark }}</span>
+                </template>
+              </el-table-column>
+            </el-table>
+            <pagination v-show="tab1.changeRecord.see.total>0" :total="tab1.changeRecord.see.total" :page.sync="tab1.changeRecord.see.getdataListParm.offset" :limit.sync="tab1.changeRecord.see.getdataListParm.pagecount" @pagination="getTab1List3See" />
+          </div>
+          <el-form ref="seeTemp" :rules="rules" :model="tab1.changeRecord.see.temp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
+            <el-row>
+              <el-col>
+                <el-form-item label="流程进度" />
+                <el-steps :active="tab1.changeRecord.see.active" align-center finish-status="success">
+                  <el-step
+                    v-for="(item,index) in tab1.changeRecord.see.activeList"
+                    :key="index"
+                    :title="item.title"
+                    :status="item.status"
+                  >
+                    <template slot="description">
+                      <div class="step-row">
+                        <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
+                        <div>{{ item.reason }}</div>
+                      </div>
+                    </template>
+                  </el-step>
+                </el-steps>
+              </el-col>
+            </el-row>
+            <el-row>
+              <el-col>
+                <el-form-item label="操作:">
+                  <!-- 设备主管审核 -->
+                  <el-button v-if="tab1.changeRecord.isContractExamineZG &&tab1.changeRecord.see.temp.SHStatus == 2" type="success" style="display:inline-block" @click="handleTab1Examine()">审核1</el-button>
+                  <el-button v-else type="success" style="display:none" @click="handleTab1Examine()">审核1</el-button>
+                  <!-- 设备助理审核 -->
+                  <!-- <el-button v-if="isContractExamineZL && seeTemp.SHStatus == 3" type="success" style="display:inline-block" @click="handleExamine2()">审核2</el-button>
+                  <el-button v-else type="success" style="display:none" @click="handleExamine2()">审核2</el-button> -->
+
+                  <!-- 设备中心审核 -->
+                  <el-button v-if="tab1.changeRecord.isContractExamineZX && tab1.changeRecord.see.temp.SHStatus == 5" type="success" style="display:inline-block" @click="handleTab1Examine3()">审核2</el-button>
+                  <el-button v-else type="success" style="display:none" @click="handleTab1Examine3()">审核2</el-button>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+        </div>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
+          <el-button @click="tab1.changeRecord.see.dialogFormVisible = false">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- 变更记录审核 -->
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="tab1.changeRecord.examine.dialogFormVisible" :close-on-click-modal="false" width="30%">
+      <div class="app-examine">
+        <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
+        <el-form ref="examineTemp" :rules="rules" :model="tab1.changeRecord.examine.temp" label-position="right" style="width: 50%;margin:0 auto;">
+          <el-row style="width:88%;height:150px;margin:0 auto;">
+            <el-col :span="20">
+              <el-form-item>
+                <el-radio-group v-model="tab1.changeRecord.examine.temp.statueSH" @change="changeExamineStatue">
+                  <el-radio :label="1" checked>通过</el-radio>
+                  <el-radio :label="2">不通过</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col v-if="tab1.changeRecord.examine.isReason" :span="20">
+              <el-input v-model="tab1.changeRecord.examine.temp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button v-if="dialogStatus==='tab1examine'" type="primary" :disabled="isokDisable" @keyup.enter.native="createExamineData()" @click="createExamineData()">确认</el-button>
+        <!-- <el-button v-if="dialogStatus==='tab1examine2'" type="primary" :disabled="isokDisable" @click="createExamineData2()">确认</el-button> -->
+        <el-button v-if="dialogStatus==='tab1examine3'" type="primary" :disabled="isokDisable" @keyup.enter.native="createExamineData3()" @click="createExamineData3()">确认</el-button>
+        <el-button @click="tab1.changeRecord.examine.dialogFormVisible = false;">关闭</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+// 引入
+import { GetDataByName, GetDataByNames, checkButtons, ExecDataByConfig, UpdateDataRelation, PostDataByName, failproccess, postJson } from '@/api/common'
+import waves from '@/directive/waves'
+import { parseTime, json2excel, sortChange } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+import Cookies from 'js-cookie'
+import { getToken } from '@/utils/auth'
+import { MessageBox } from 'element-ui'
+export default {
+  inject: ['reload'],
+  name: 'ContractManagement',
+  components: { Pagination },
+  directives: { waves },
+  data() {
+    return {
+      selectList: [],
+      contractCodese: '',
+      isGroupAdministrator: Cookies.get('pastureid'),
+      isEmployeid: Cookies.get('employeid'),
+      isPercentage: false,
+      percentage: 1,
+      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      buttons: [],
+      activeName: 'first',
+      contractStatusList: [{ id: '0', name: '正常' }, { id: '1', name: '已过期' }, { id: '2', name: '终止' }, { id: '3', name: '新增未通过' }],
+      contractStatus2List: [{ id: '1', name: '正常' }, { id: '0', name: '终止' }],
+      auditStatusList: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }], // 审核状态
+      changeTypeList: [{ id: '0', name: '新增合同' }, { id: '1', name: '新增备件' }, { id: '2', name: '变更备件' }, { id: '3', name: '合同变更' }],
+      isZeroInventoryList: [{ id: '0', name: '否' }, { id: '1', name: '是' }], // 是否零库存
+      findAllProvider: [], findAllAssetType: [], findAllPasture: [], findAllPastureList2: [], findAllDepart: [], findAllEmploye: [], findAllCategory: [],
+      requestParams: [
+        { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
+        { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'findAllPastureForContract', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': 18 }},
+        { name: 'findAllDepart', offset: 0, pagecount: 0, params: [] },
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': 18 }},
+        { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
+      ],
+      isokDisable: false,
+      disabled: true,
+      rules: {},
+      textMap: {
+        create: '新增合同',
+        see: '查看详情',
+        change: '变更合同',
+        tab1create2: '新增备件',
+        tab1change2: '变更备件',
+        tab1examine: '审核',
+        tab1examine2: '审核2',
+        tab1examine3: '审核2',
+        tab1See2: '查看',
+        tab1Update2: '编辑'
+      },
+      dialogStatus: '',
+      isContractManagement: true, // 备件合同
+      isDetailsSpareParts: false, // 备件明细
+      isChangeRecord: false, // 变更记录
+      tab1: {
+        // 合同管理1
+        contractManagement: {
+          radioAll: '全部',
+          isContractAdd: [],
+          isContractExport: [],
+          isContractUplaod: [],
+          isContractSee: [],
+          isContractChange: [],
+          isDisabled: false,
+          tableKey: 0,
+          listLoading: false,
+          total: 0,
+          list: [],
+          getdataListParm: {
+            name: 'providerPactListV2',
+            page: 1,
+            offset: 1,
+            pagecount: 10,
+            returntype: 'Map',
+            parammaps: {
+              loginid: Cookies.get('employeid'),
+              pastureName: Cookies.get('pasturename'),
+              contractCode: '',
+              statue: '',
+              stuteSH: '',
+              providerName: '',
+              tab1InputDatetime1: '',
+              startTime: '',
+              stopTime: '',
+              tab1InputDatetime2: '',
+              SHdateTimeF: '',
+              SHdateTimeE: '',
+              SHnums: 2
+            }
+          },
+          getParmCreateNumber: {
+            name: 'autoCreatCode',
+            page: 0,
+            offset: 0,
+            pagecount: 0,
+            returntype: 'Map',
+            parammaps: {
+              pastureId: Cookies.get('pastureid'),
+              codeType: 'HT'
+            }
+          },
+          create: {
+            dialogFormVisible: false,
+            temp: { contractCode: '', pastureId: Cookies.get('pastureid'), providerName: '', startTime: '', stopTime: '', statue: '', isZeroStock: 0, creatorId: Cookies.get('employeid'), creatorMan: Cookies.get('employename'), creatorTime: parseTime(new Date(), '{y}-{m}-{d}'), activeList: [], active: 3, workflowNote: '', synchronousPasture: [], synchronousPastureList: [] },
+            changeEchoParm: { name: 'getBigcontractPId', page: 0, offset: 0, pagecount: 0, returntype: 'Map', parammaps: {}}
+          }
+        },
+        // 合同管理-备件明细
+        detailsSpareParts: {
+          tableKey: 1,
+          listLoading: false,
+          total: 0,
+          list: [],
+          getdataListParm: {
+            name: 'getcontratListBybigV2',
+            page: 1,
+            offset: 1,
+            pagecount: 10,
+            returntype: 'Map',
+            parammaps: {
+              specification: '',
+              partName: '',
+              partCode: '',
+              pastureId: '',
+              providerId: '',
+              stopTime: '',
+              flag: '',
+              isZeroStock: '',
+              statue: ''
+            }
+          },
+          partCode: '',
+          requestSparePart: {
+            name: '',
+            page: 1,
+            offset: 1,
+            pagecount: 20,
+            returntype: 'Map',
+            parammaps: {}
+          },
+          detailsList: [],
+          updateList: [],
+          tableKeyAdd: 0,
+          listLoadingAdd: false,
+          listAdd: [],
+          requestBrand: {
+            name: 'getBrandByPartCode',
+            page: 0,
+            offset: 0,
+            pagecount: 10,
+            returntype: 'Map',
+            parammaps: {}
+          },
+          BrandList: [],
+          create: {
+            dialogFormVisible: false,
+            temp: { contractCode: '', pastureId: Cookies.get('pastureid'), providerName: '', startTime: '', stopTime: '', statue: '', isZeroStock: 0, creatorId: Cookies.get('employeid'), creatorMan: Cookies.get('employename'), creatorTime: parseTime(new Date(), '{y}-{m}-{d}'), activeList: [], active: 3, workflowNote: '' }
+          },
+          isDisabledImport: true,
+          clearImportExcelParm: {
+            name: 'deletecontract_upload',
+            page: 0,
+            offset: 0,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              user: Cookies.get('name')
+            }
+          },
+          importExcelParm: {
+            name: 'getcontract_uploadlist',
+            page: 0,
+            offset: 0,
+            pagecount: '',
+            returntype: 'Map',
+            parammaps: {
+              user: Cookies.get('name')
+            }
+          }
+        },
+        // 变更记录
+        changeRecord: {
+          isContractExamineZG: [],
+          //  isContractExamineZL: [],
+          isContractExamineZX: [],
+          isContractDelete: [],
+          isStatueReason: false,
+          isReason: false,
+          radioAll: '全部',
+          tableKey: 2,
+          listLoading: false,
+          total: 0,
+          list: [],
+          getdataListParm: {
+            name: 'providerPactListSH',
+            page: 1,
+            offset: 1,
+            pagecount: 10,
+            returntype: 'Map',
+            parammaps: {
+              loginid: Cookies.get('employeid'),
+              contractCode: '',
+              tab1InputDatetime3: '',
+              startTime: '',
+              stopTime: '',
+              SHStatus: '',
+              SHtype: '',
+              pastureId: '',
+              providerId: '',
+              stopTime1: '',
+              flag: '',
+              isZeroStock: '',
+              statue: '',
+              SHnums: 2,
+              stuteSH: ''
+            }
+          },
+          see: {
+            dialogFormVisible: false,
+            activeList: [], active: 3,
+            temp: {},
+            tableKey: 0,
+            listLoading: false,
+            total: 0,
+            list: [],
+            getdataListParm: {
+              name: 'getcontratListBybigSH',
+              returntype: 'Map',
+              page: 0,
+              offset: 0,
+              pagecount: 10,
+              parammaps: {}
+            }
+          },
+          examine: {
+            dialogFormVisible: false,
+            temp: {
+              statueSH: 1
+            },
+            isReason: false
+          }
+        }
+      },
+      postDataPramas: {},
+      // 开始日期
+      // pickerOptions1: {
+      //   disabledDate: (time) => {
+      //     if (this.tab1.contractManagement.create.temp.stopTime !== '') {
+      //       return parseTime(time.getTime(), '{y}-{m}-{d}') > parseTime(Date.now(), '{y}-{m}-{d}') || parseTime(time.getTime(), '{y}-{m}-{d}') >= this.tab1.contractManagement.create.temp.stopTime
+      //     } else {
+      //       return time.getTime() > Date.now()
+      //     }
+      //   }
+      // },
+      // 截止日期
+      pickerOptions2: {
+        disabledDate: (time) => {
+          return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.tab1.contractManagement.create.temp.startTime || parseTime(time.getTime(), '{y}-{m}-{d}') < parseTime(Date.now(), '{y}-{m}-{d}')
+        }
+      },
+      pickerOptions3: {
+        disabledDate(time) {
+          return time.getTime() > Date.now()// 当天之前的时间可选
+        }
+      },
+      // 合同明细
+      tab2: {
+        tableKey: 0,
+        listLoading: false,
+        total: 0,
+        getdataListParm: {
+          name: 'contractDetailV2',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            inputDatetime: '',
+            providerName: '',
+            contractCode: '',
+            stopTime: '',
+            startTime: '',
+            statue: '',
+            partCode: '',
+            partName: '',
+            isZeroStock: '',
+            // pastureName: Cookies.get('pasturename')
+            pastureName: ''
+          }
+        },
+        list: []
+      },
+      UpdateDataParam: {},
+      UpdateDataParam2: {},
+      pending: {
+        total: 0,
+        getdataListParm: {
+          name: 'providerPactListV2', page: 1, offset: 1, getTotal: 'total3', pagecount: 10, returntype: 'Map',
+          parammaps: {}
+        }
+      },
+      myHeight: document.documentElement.clientHeight - 85 - 250
+    }
+  },
+  computed: {
+    // 设置请求头
+    headers() {
+      return {
+        token: getToken()
+      }
+    },
+    uploadData() {
+      return {
+        name: 'insertcontract_upload',
+        importParams: '备件编号,备件名称,规格型号,计量单位,品牌,计划量,单价,备注',
+        sheetname: 'SheetJS'
+      }
+    },
+    // 设置上传地址
+    uploadExcelUrl() {
+      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
+    }
+  },
+  created() {
+    // this.keyupSubmit()
+    console.log(this.$route.query.contractCode)
+    this.get_select_list()
+    const that = this
+    GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
+      that.buttons = response.data.list
+      that.get_auto_buttons()
+    })
+
+    this.getTab1List()
+    this.getPendingList()
+    if (this.$route.query.contractCode == undefined) {
+      this.tab1.contractManagement.getdataListParm.parammaps.contractCode = ''
+    } else {
+      this.tab1.contractManagement.getdataListParm.parammaps.contractCode = this.$route.query.contractCode
+    }
+  },
+
+  methods: {
+    tableSort1(column) {
+      sortChange(column, this.tab1.detailsSpareParts.list)
+    },
+    tableSort2(column) {
+      sortChange(column, this.tab2.list)
+    },
+    get_auto_buttons() {
+      // 新增
+      const ContractJinyong = 'customs:contract:jinyong'
+      const isContractJinyong = checkButtons(this.$store.state.user.buttons, ContractJinyong)
+      this.isContractJinyong = isContractJinyong
+
+      // 新增
+      const ContractAdd = 'customs:contract:add'
+      const isContractAdd = checkButtons(this.$store.state.user.buttons, ContractAdd)
+      this.tab1.contractManagement.isContractAdd = isContractAdd
+
+      // 查看
+      const ContractSee = 'customs:contract:see'
+      const isContractSee = checkButtons(this.$store.state.user.buttons, ContractSee)
+      this.tab1.contractManagement.isContractSee = isContractSee
+
+      // 办公室主任
+      const ContractExamineZG = 'customs:contract:examineZG'
+      const isContractExamineZG = checkButtons(this.$store.state.user.buttons, ContractExamineZG)
+      this.tab1.changeRecord.isContractExamineZG = isContractExamineZG
+      // 设备中心审核
+      const ContractExamineZX = 'customs:contract:examineZX'
+      const isContractExamineZX = checkButtons(this.$store.state.user.buttons, ContractExamineZX)
+      this.tab1.changeRecord.isContractExamineZX = isContractExamineZX
+      // 审核删除
+      const ContractDelete = 'customs:contract:delete'
+      const isContractDelete = checkButtons(this.$store.state.user.buttons, ContractDelete)
+      this.tab1.changeRecord.isContractDelete = isContractDelete
+      // 导出
+      const ContractExport = 'customs:contract:export'
+      const isContractExport = checkButtons(this.$store.state.user.buttons, ContractExport)
+      this.tab1.contractManagement.isContractExport = isContractExport
+      // SAP上传
+      const ContractUplaod = 'customs:contract:sapupload'
+      const isContractUplaod = checkButtons(this.$store.state.user.buttons, ContractUplaod)
+      this.tab1.contractManagement.isContractUplaod = isContractUplaod
+      // 变更
+      const ContractChange = 'customs:contract:change'
+      const isContractChange = checkButtons(this.$store.state.user.buttons, ContractChange)
+      this.tab1.contractManagement.isContractChange = isContractChange
+    },
+    get_select_list() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.findAllProvider = response.data.findAllProvider.list
+        this.findAllAssetType = response.data.findAllAssetType.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
+        this.findAllPastureList2 = response.data.findAllPastureForContract.list
+        this.findAllDepart = response.data.findAllDepart.list
+        this.findAllEmploye = response.data.findAllEmploye.list
+        this.findAllCategory = response.data.findAllCategory.list
+      })
+    },
+    handleClick() {
+      if (this.tab1.contractManagement.create.temp.activeName == 'first') {
+        console.log('点击了合同管理')
+        this.getTab1List()
+      } else {
+        console.log('点击了合同明细')
+        this.getTab2List()
+      }
+    },
+    getPendingList() {
+      this.pending.getdataListParm.parammaps.loginid = this.tab1.contractManagement.getdataListParm.parammaps.loginid
+      this.pending.getdataListParm.parammaps.pastureName = this.tab1.contractManagement.getdataListParm.parammaps.pastureName
+      this.pending.getdataListParm.parammaps.contractCode = this.tab1.contractManagement.getdataListParm.parammaps.contractCode
+      this.pending.getdataListParm.parammaps.statue = this.tab1.contractManagement.getdataListParm.parammaps.statue
+      this.pending.getdataListParm.parammaps.stuteSH = this.tab1.contractManagement.getdataListParm.parammaps.stuteSH
+      this.pending.getdataListParm.parammaps.providerName = this.tab1.contractManagement.getdataListParm.parammaps.providerName
+      this.pending.getdataListParm.parammaps.tab1InputDatetime1 = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1
+      this.pending.getdataListParm.parammaps.startTime = this.tab1.contractManagement.getdataListParm.parammaps.startTime
+      this.pending.getdataListParm.parammaps.stopTime = this.tab1.contractManagement.getdataListParm.parammaps.stopTime
+      this.pending.getdataListParm.parammaps.tab1InputDatetime2 = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2
+      this.pending.getdataListParm.parammaps.SHdateTimeF = this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeF
+      this.pending.getdataListParm.parammaps.SHdateTimeE = this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeE
+      this.pending.getdataListParm.parammaps.SHnums = 0
+      GetDataByName(this.pending.getdataListParm).then(response => {
+        this.pending.total = response.data.total3
+      })
+    },
+    getTab1List() {
+      this.tab1.contractManagement.listLoading = true
+      if (this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 !== '' && this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 !== null) {
+        this.tab1.contractManagement.getdataListParm.parammaps.startTime = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1[0]
+        this.tab1.contractManagement.getdataListParm.parammaps.stopTime = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1[1]
+      } else {
+        this.tab1.contractManagement.getdataListParm.parammaps.startTime = ''
+        this.tab1.contractManagement.getdataListParm.parammaps.stopTime = ''
+      }
+      if (this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2 !== '' && this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2 !== null) {
+        this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeF = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2[0]
+        this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeE = this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2[1]
+      } else {
+        this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeF = ''
+        this.tab1.contractManagement.getdataListParm.parammaps.SHdateTimeE = ''
+      }
+      GetDataByName(this.tab1.contractManagement.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          this.tab1.contractManagement.list = response.data.list
+          this.tab1.contractManagement.pageNum = response.data.pageNum
+          this.tab1.contractManagement.pageSize = response.data.pageSize
+        } else {
+          this.tab1.contractManagement.list = []
+        }
+        this.tab1.contractManagement.total = response.data.total
+        setTimeout(() => {
+          this.tab1.contractManagement.listLoading = false
+        }, 300)
+      })
+    },
+    handleTab1Filter() {
+      this.tab1.contractManagement.listLoading = true
+      if (this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 == null) {
+        this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 = ''
+      }
+      if (this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2 == null) {
+        this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime2 = ''
+      }
+      this.tab1.contractManagement.getdataListParm.offset = 1
+      this.getTab1List()
+      this.getPendingList()
+      if (this.tab1.contractManagement.radioAll == '全部') {
+        this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 2
+        this.getTab1List()
+      } else if (this.tab1.contractManagement.radioAll == '待处理') {
+        this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 0
+        this.getTab1List()
+      } else if (this.tab1.contractManagement.radioAll == '已处理') {
+        this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 1
+        this.getTab1List()
+      }
+    },
+    changeContractManagementAll() {
+      if (this.tab1.contractManagement.radioAll == '全部') {
+        this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 2
+      } else if (this.tab1.contractManagement.radioAll == '待处理') {
+        this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 0
+      } else if (this.tab1.contractManagement.radioAll == '已处理') {
+        this.tab1.contractManagement.getdataListParm.parammaps.SHnums = 1
+      }
+      this.tab1.contractManagement.getdataListParm.offset = 1
+      this.getTab1List()
+    },
+    changeTime(val) {
+      if (this.tab1.contractManagement.create.temp.stopTime !== '') {
+        if (this.tab1.contractManagement.create.temp.stopTime <= this.tab1.contractManagement.create.temp.startTime) {
+          this.tab1.contractManagement.create.temp.stopTime = ''
+          this.tab1.contractManagement.create.temp.statue = ''
+          this.tab1.contractManagement.create.temp.statueId = ''
+        } else {
+          if (parseTime(new Date(), '{y}-{m}-{d}') <= this.tab1.contractManagement.create.temp.stopTime) {
+            this.tab1.contractManagement.create.temp.statue = '1'
+            // this.tab1.contractManagement.create.temp.statueId = 1
+          } else {
+            this.tab1.contractManagement.create.temp.statue = '0'
+            // this.tab1.contractManagement.create.temp.statueId = 2
+          }
+        }
+      } else {
+        this.tab1.contractManagement.create.temp.statue = ''
+        this.tab1.contractManagement.create.temp.statueId = ''
+      }
+    },
+    changeIsZero(val) {
+      console.log(val)
+    },
+    providerSearch(queryString, cb) {
+      var returnList = this.findAllProvider
+      var results = queryString ? returnList.filter(this.createFilter(queryString)) : returnList
+      // 调用 callback 返回建议列表的数据
+      cb(results)
+    },
+    createFilter(queryString) {
+      return returnValue => {
+        return (
+          returnValue.name.toLowerCase().indexOf(queryString.toLowerCase()) >= 0
+        )
+      }
+    },
+    handleSelectProvider(item) {
+      this.$set(this.tab1.contractManagement.create.temp, 'providerId', item.id)
+      this.$set(this.tab1.contractManagement.create.temp, 'providerName', item.name)
+    },
+    handleFocusProvider() {
+      this.tab1.contractManagement.create.temp.providerId = ''
+      this.tab1.contractManagement.create.temp.providerName = ''
+    },
+    handleBlurProvider() {
+      if (this.tab1.contractManagement.create.temp.providerId == '') {
+        this.tab1.contractManagement.create.temp.providerId = ''
+        this.tab1.contractManagement.create.temp.providerName = ''
+      }
+    },
+    changeCreatorMan(val) {
+      this.tab1.contractManagement.create.temp.creatorMan = this.findAllEmploye.find(obj => obj.id == val).name
+    },
+    resetCreateTemp() {
+      this.tab1.contractManagement.create.temp.synchronousPastureList = []
+      if (Cookies.get('pastureid') == 18) {
+        for (let i = 0; i < this.findAllPasture.length; i++) {
+          this.tab1.contractManagement.create.temp.synchronousPastureList.push(this.findAllPasture[i].id)
+        }
+      } else {
+        this.tab1.contractManagement.create.temp.synchronousPastureList.push(parseInt(Cookies.get('pastureid')))
+      }
+      this.tab1.contractManagement.create.temp = { contractCode: '', pastureId: parseFloat(Cookies.get('pastureid')), providerName: '', startTime: '', stopTime: '', statue: '', isZeroStock: 0, creatorId: parseFloat(Cookies.get('employeid')), creatorMan: Cookies.get('employename'), creatorTime: parseTime(new Date(), '{y}-{m}-{d}'), synchronousPasture: this.tab1.contractManagement.create.temp.synchronousPastureList, synchronousPasture2: [] }
+    },
+    handleTab1Create() {
+      this.resetCreateTemp()
+      this.dialogStatus = 'create'
+      this.tab1.contractManagement.create.dialogFormVisible = true
+      this.getCreateNumber()
+    },
+    getCreateNumber() {
+      GetDataByName(this.tab1.contractManagement.getParmCreateNumber).then(response => {
+        this.$nextTick(() => {
+          console.log('合同编号', response.data.list[0].orderCode)
+          this.tab1.contractManagement.create.temp.contractCode = response.data.list[0].orderCode
+          this.$forceUpdate()
+        })
+      })
+    },
+    add_dialog_save() {
+      console.log('点击了新增保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          if (this.tab1.contractManagement.create.temp.contractCode == '') {
+            GetDataByName(this.getParmCreateNumber).then(response => {
+              this.$nextTick(() => {
+                this.tab1.contractManagement.create.temp.contractCode = response.data.list[0].orderCode
+                this.$forceUpdate()
+                this.saveCreateData()
+              })
+            })
+          } else {
+            this.saveCreateData()
+          }
+        }
+      })
+    },
+    saveCreateData() {
+      this.postDataPramas = {}
+      if (Cookies.get('pastureid') == 18) {
+        if (this.tab1.contractManagement.create.temp.synchronousPasture.indexOf(18) == -1) {
+          this.$message({ type: 'error', message: '当前合同归属于现代牧业,未选中,共享牧场请选中现代牧业!', duration: 2000 })
+          return false
+        }
+      }
+      this.postDataPramas.common = { 'returnmap': '0' }
+      this.postDataPramas.data = []
+      this.postDataPramas.data[0] = { 'name': 'checkbigcontract', 'type': 'v', 'parammaps': {
+        pastureId: this.tab1.contractManagement.create.temp.pastureId,
+        providerId: this.tab1.contractManagement.create.temp.providerId
+      }}
+      this.postDataPramas.data[1] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
+        pastureId: this.tab1.contractManagement.create.temp.pastureId,
+        providerId: this.tab1.contractManagement.create.temp.providerId,
+        providerName: this.tab1.contractManagement.create.temp.providerName,
+        startTime: this.tab1.contractManagement.create.temp.startTime,
+        stopTime: this.tab1.contractManagement.create.temp.stopTime,
+        contractCode: this.tab1.contractManagement.create.temp.contractCode,
+        creatorId: this.tab1.contractManagement.create.temp.creatorId,
+        creatorMan: this.tab1.contractManagement.create.temp.creatorMan,
+        creatorTime: this.tab1.contractManagement.create.temp.creatorTime,
+        isZeroStock: this.tab1.contractManagement.create.temp.isZeroStock,
+        statue: 1,
+        remark: this.tab1.contractManagement.create.temp.remark,
+        SHtype: 0
+      }}
+      var groupRanchList = []
+      for (let i = 0; i < this.tab1.contractManagement.create.temp.synchronousPasture.length; i++) {
+        var obj = {}
+        obj.pastureId = this.tab1.contractManagement.create.temp.synchronousPasture[i]
+        groupRanchList.push(obj)
+      }
+      if (Cookies.get('pastureid') == 18) {
+        this.postDataPramas.data[2] = { 'name': 'insertSpotList', 'resultmaps': { 'list': groupRanchList }}
+        this.postDataPramas.data[2].children = []
+        this.postDataPramas.data[2].children[0] = { 'name': 'insertPastureBigcontract', 'type': 'e', 'parammaps': {
+          bigcontractId: '@insertBigContractV2.LastInsertId',
+          pastureId: '@insertSpotList.pastureId'
+        }}
+      }
+      ExecDataByConfig(this.postDataPramas).then(response => {
+        console.log('新增保存发送参数', this.postDataPramas)
+        if (response.msg == 'fail') {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        } else {
+          this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 = ''
+          this.getTab1List()
+          this.getPendingList()
+          this.tab1.contractManagement.create.dialogFormVisible = false
+          this.tab1.contractManagement.create.temp.providerName = ''
+          this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+        }
+      })
+    },
+    form_see(row) {
+      console.log('查看', row)
+      row.statue = String(row.statue)
+      row.synchronousPasture2 = []
+      row.synchronousPastureName2 = []
+      row.synchronousPasture = []
+      this.tab1.contractManagement.create.temp = Object.assign({}, row)
+      this.dialogStatus = 'see'
+      this.tab1.contractManagement.create.dialogFormVisible = true
+      var reason = '未通过原因:' + this.tab1.contractManagement.create.temp.workflowNote
+      if (this.tab1.contractManagement.create.temp.SHStatus == 2) {
+        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核' }, { title: '设备中心审核' }]
+        this.tab1.contractManagement.create.temp.active = 1
+      } else if (this.tab1.contractManagement.create.temp.SHStatus == 3) {
+        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核' }]
+        this.tab1.contractManagement.create.temp.active = 2
+      } else if (this.tab1.contractManagement.create.temp.SHStatus == 4) {
+        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson, status: 'error', reason: reason }, { title: '设备中心审核' }]
+        this.tab1.contractManagement.create.temp.active = 2
+      } else if (this.tab1.contractManagement.create.temp.SHStatus == 5) {
+        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核' }]
+        this.tab1.contractManagement.create.temp.active = 2
+      } else if (this.tab1.contractManagement.create.temp.SHStatus == 6) {
+        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核' }]
+        this.tab1.contractManagement.create.temp.active = 3
+      } else if (this.tab1.contractManagement.create.temp.SHStatus == 7) {
+        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核', date: this.tab1.contractManagement.create.temp.CGChargedate, name: this.tab1.contractManagement.create.temp.CGChargePerson }]
+        this.tab1.contractManagement.create.temp.active = 4
+      } else if (this.tab1.contractManagement.create.temp.SHStatus == 8) {
+        this.tab1.contractManagement.create.temp.activeList = [{ title: '合同录入', date: this.tab1.contractManagement.create.temp.creatorTime, name: this.tab1.contractManagement.create.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.contractManagement.create.temp.chargeDate, name: this.tab1.contractManagement.create.temp.chargePerson }, { title: '设备中心审核', date: this.tab1.contractManagement.create.temp.CGChargedate, name: this.tab1.contractManagement.create.temp.CGChargePerson, status: 'error', reason: reason }]
+        this.tab1.contractManagement.create.temp.active = 4
+      }
+      this.tab1.contractManagement.create.changeEchoParm.parammaps.bigcontract_id = row.id
+      GetDataByName(this.tab1.contractManagement.create.changeEchoParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            this.tab1.contractManagement.create.temp.synchronousPasture2.push(response.data.list[i].pasture_id)
+            this.tab1.contractManagement.create.temp.synchronousPasture.push(response.data.list[i].pasture_id)
+            this.tab1.contractManagement.create.temp.synchronousPastureName2.push(this.findAllPasture.find(obj => obj.id == response.data.list[i].pasture_id).name)
+          }
+        } else {
+          this.tab1.contractManagement.create.temp.synchronousPasture = []
+        }
+        console.log(this.tab1.contractManagement.create.temp.synchronousPastureName2, 'synchronousPastureName2')
+      })
+    },
+    handleTab1Change(row) {
+      console.log('变更', row)
+      // row.statue = String(row.statue)
+      this.$set(row, 'mystopTime', row.stopTime)
+      row.synchronousPasture2 = []
+      row.synchronousPastureName2 = []
+      row.synchronousPasture = []
+      this.tab1.contractManagement.create.temp = Object.assign({}, row)
+      this.tab1.contractManagement.create.temp.statue = String(this.tab1.contractManagement.create.temp.statue)
+
+      this.dialogStatus = 'change'
+      this.tab1.contractManagement.create.dialogFormVisible = true
+      this.tab1.contractManagement.create.changeEchoParm.parammaps.bigcontract_id = row.id
+      GetDataByName(this.tab1.contractManagement.create.changeEchoParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            this.tab1.contractManagement.create.temp.synchronousPasture2.push(response.data.list[i].pasture_id)
+            this.tab1.contractManagement.create.temp.synchronousPasture.push(response.data.list[i].pasture_id)
+            this.tab1.contractManagement.create.temp.synchronousPastureName2.push(this.findAllPasture.find(obj => obj.id == response.data.list[i].pasture_id).name)
+          }
+        } else {
+          this.tab1.contractManagement.create.temp.synchronousPasture = []
+        }
+        console.log(this.tab1.contractManagement.create.temp.synchronousPastureName2, 'synchronousPastureName2')
+      })
+    },
+
+    terminationData() {
+      var aa = '确认终止合同?'
+      if (this.tab1.contractManagement.create.temp.isZeroStock == 1) {
+        aa = '若此合同库存中有剩余库存,建议先进行退货操作。'
+      } else {
+        aa = '确认终止合同?'
+      }
+      MessageBox.confirm(aa, { confirmButtonText: '确认终止', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.postDataPramas = {}
+        this.postDataPramas.name = 'updatecontractstatuV2'
+        this.postDataPramas.parammaps = {}
+        this.postDataPramas.parammaps = this.tab1.contractManagement.create.temp
+        this.postDataPramas.parammaps.creatorId = Cookies.get('employeid')
+        this.postDataPramas.parammaps.creatorMan = Cookies.get('employename')
+        this.postDataPramas.parammaps.creatorTime = parseTime(new Date(), '{y}-{m}-{d}')
+        PostDataByName(this.postDataPramas).then(response => {
+          console.log('变更保存发送参数', this.postDataPramas)
+          if (response.msg == 'fail') {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          } else {
+            this.tab1.contractManagement.getdataListParm.parammaps.tab1InputDatetime1 = ''
+            this.getTab1List()
+            this.getPendingList()
+            this.tab1.contractManagement.create.dialogFormVisible = false
+            this.tab1.contractManagement.create.temp.providerName = ''
+            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+          }
+        })
+      })
+    },
+    changeData() {
+      if (Cookies.get('pastureid') == 18) {
+        this.UpdateDataParam = {}
+        this.UpdateDataParam.name = 'pasture_bigcontract'
+        this.UpdateDataParam.dataname = 'bigcontract_id'
+        this.UpdateDataParam.datavalue = this.tab1.contractManagement.create.temp.id
+        this.UpdateDataParam.valuename = 'pasture_id'
+        this.UpdateDataParam.values = this.tab1.contractManagement.create.temp.synchronousPasture
+        UpdateDataRelation(this.UpdateDataParam).then(response => {
+          if (response.msg !== 'fail') {
+            this.UpdateDataParam2.name = 'updateBigcontractPId'
+            this.UpdateDataParam2.parammaps = {}
+            this.UpdateDataParam2.parammaps.bigcontract_id = this.tab1.contractManagement.create.temp.id
+            this.UpdateDataParam2.parammaps.enable = 0
+            PostDataByName(this.UpdateDataParam2).then(response => {})
+          }
+        })
+      }
+      this.postDataPramas = {}
+      this.postDataPramas.common = { 'returnmap': '0' }
+      this.postDataPramas.data = []
+      this.postDataPramas.data[0] = { 'name': 'checkbigcontractSH', 'type': 'v', 'parammaps': {
+        pastureId: this.tab1.contractManagement.create.temp.pastureId,
+        providerId: this.tab1.contractManagement.create.temp.providerId,
+        stopTime: this.tab1.contractManagement.create.temp.mystopTime,
+        flag: this.tab1.contractManagement.create.temp.flag,
+        isZeroStock: this.tab1.contractManagement.create.temp.isZeroStock,
+        statue: this.tab1.contractManagement.create.temp.statue
+      }}
+      if (Cookies.get('pastureid') == 18) {
+        var synchronousPastureName = []
+        for (let i = 0; i < this.tab1.contractManagement.create.temp.synchronousPasture.length; i++) {
+          synchronousPastureName.push(this.findAllPasture.find(obj => obj.id == this.tab1.contractManagement.create.temp.synchronousPasture[i]).name)
+        }
+        this.postDataPramas.data[1] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
+          pastureId: this.tab1.contractManagement.create.temp.pastureId,
+          providerId: this.tab1.contractManagement.create.temp.providerId,
+          providerName: this.tab1.contractManagement.create.temp.providerName,
+          startTime: this.tab1.contractManagement.create.temp.startTime,
+          stopTime: this.tab1.contractManagement.create.temp.mystopTime,
+          stopTime1: this.tab1.contractManagement.create.temp.stopTime,
+          contractCode: '',
+          contractCode1: this.tab1.contractManagement.create.temp.contractCode,
+          creatorId: this.tab1.contractManagement.create.temp.creatorId,
+          creatorMan: this.tab1.contractManagement.create.temp.creatorMan,
+          creatorTime: this.tab1.contractManagement.create.temp.creatorTime,
+          isZeroStock: this.tab1.contractManagement.create.temp.isZeroStock,
+          statue: this.tab1.contractManagement.create.temp.statue,
+          remark: this.tab1.contractManagement.create.temp.remark,
+          flag: this.tab1.contractManagement.create.temp.flag,
+          SHtype: 3,
+          pastureNamesOld: this.tab1.contractManagement.create.temp.synchronousPastureName2.toString(),
+          pastureNamesNow: synchronousPastureName.toString()
+        }}
+      } else {
+        this.postDataPramas.data[1] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
+          pastureId: this.tab1.contractManagement.create.temp.pastureId,
+          providerId: this.tab1.contractManagement.create.temp.providerId,
+          providerName: this.tab1.contractManagement.create.temp.providerName,
+          startTime: this.tab1.contractManagement.create.temp.startTime,
+          stopTime: this.tab1.contractManagement.create.temp.mystopTime,
+          stopTime1: this.tab1.contractManagement.create.temp.stopTime,
+          contractCode: '',
+          contractCode1: this.tab1.contractManagement.create.temp.contractCode,
+          creatorId: this.tab1.contractManagement.create.temp.creatorId,
+          creatorMan: this.tab1.contractManagement.create.temp.creatorMan,
+          creatorTime: this.tab1.contractManagement.create.temp.creatorTime,
+          isZeroStock: this.tab1.contractManagement.create.temp.isZeroStock,
+          statue: this.tab1.contractManagement.create.temp.statue,
+          remark: this.tab1.contractManagement.create.temp.remark,
+          flag: this.tab1.contractManagement.create.temp.flag,
+          SHtype: 3
+        }}
+      }
+      ExecDataByConfig(this.postDataPramas).then(response => {
+        console.log('变更保存发送参数', this.postDataPramas)
+        if (response.msg == 'fail') {
+          this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+        } else {
+          this.getTab1List()
+          this.getPendingList()
+          this.tab1.contractManagement.create.dialogFormVisible = false
+          this.tab1.contractManagement.create.temp.providerName = ''
+          this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+        }
+      })
+    },
+    // 备件明细
+    handleTab1DetailsSpareParts(row) {
+      console.log('备件明细', row)
+      this.contractCodese = row.contractCode
+      this.tab1.detailsSpareParts.updateList = Object.assign({}, row)
+      this.tab1.detailsSpareParts.detailsList = Object.assign({}, row)
+      this.isContractManagement = false
+      this.isDetailsSpareParts = true
+      this.tab1.detailsSpareParts.getdataListParm.parammaps.pastureId = row.pastureId
+      this.tab1.detailsSpareParts.getdataListParm.parammaps.providerId = row.providerId
+      this.tab1.detailsSpareParts.getdataListParm.parammaps.stopTime = row.stopTime
+      this.tab1.detailsSpareParts.getdataListParm.parammaps.flag = row.flag
+      this.tab1.detailsSpareParts.getdataListParm.parammaps.isZeroStock = row.isZeroStock
+      this.tab1.detailsSpareParts.getdataListParm.parammaps.statue = row.statue
+      this.tab1.detailsSpareParts.getdataListParm.parammaps.partCode = ''
+      this.tab1.detailsSpareParts.getdataListParm.parammaps.partName = ''
+      this.tab1.detailsSpareParts.getdataListParm.parammaps.specification = ''
+      this.getTab1List2()
+    },
+    handleTab1goBack() {
+      // this.reload()
+      this.isContractManagement = true
+      this.isDetailsSpareParts = false
+      this.tab1.detailsSpareParts.total = 0
+      this.getTab1List()
+    },
+
+    change_enabled() {
+
+    },
+    change_no() {
+      console.log('selectList', this.selectList)
+
+      var send_data = {
+        'common': {
+          'returnmap': '0'
+        },
+        'data': [
+          {
+            'name': 'insertSpotList',
+            'resultmaps': {
+              'list': this.selectList
+            },
+            'children': [
+              {
+                'name': 'updateContractEnableById',
+                'type': 'e',
+                'parammaps': {
+                  'id': '@insertSpotList.id'
+                }
+              }
+            ]
+          }, {
+            'name': 'updateBigcontractIsToSap',
+            'type': 'e',
+            'parammaps': {
+              'contractCode': this.contractCodese
+            }
+          }
+
+        ]
+      }
+
+      ExecDataByConfig(send_data).then(response => {
+        console.log('发送参数', send_data)
+        if (response.msg === 'fail') {
+          this.$notify({
+            title: '禁用失败',
+            message: response.data,
+            type: 'warning',
+            duration: 2000
+          })
+        } else {
+          this.getTab1List2()
+
+          this.$notify({
+            title: '',
+            message: '禁用成功',
+            type: 'success',
+            duration: 2000
+          })
+        }
+      })
+    },
+
+    handleSelectionChange(val) {
+      // this.create.temp.rowsNumber = []
+      // for(let i=0;i<val.length;i++){
+      //   this.create.temp.rowsNumber.push(val[i].rowNumber)
+      // }
+      console.log(val)
+      this.selectList = val
+    },
+    getTab1List2() {
+      this.tab1.detailsSpareParts.listLoading = true
+      GetDataByName(this.tab1.detailsSpareParts.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
+              const srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
+              const picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
+              response.data.list[i].srcpath = srcpath
+              response.data.list[i].picpath = picpath
+            } else {
+              response.data.list[i].srcpath = ''
+              response.data.list[i].picpath = ''
+            }
+          }
+          this.tab1.detailsSpareParts.list = response.data.list
+          this.tab1.detailsSpareParts.pageNum = response.data.pageNum
+          this.tab1.detailsSpareParts.pageSize = response.data.pageSize
+          if (response.data.list !== null) {
+            this.tab1.detailsSpareParts.total = response.data.total
+          } else {
+            this.tab1.detailsSpareParts.total = 0
+          }
+        } else {
+          this.tab1.detailsSpareParts.list = []
+        }
+        setTimeout(() => {
+          this.tab1.detailsSpareParts.listLoading = false
+        }, 300)
+      })
+    },
+    handleTab1Filter2() {
+      this.tab1.detailsSpareParts.listLoading = true
+      this.tab1.detailsSpareParts.getdataListParm.offset = 1
+      this.getTab1List2()
+    },
+    sparePartSearch(queryString, cb) {
+      this.tab1.detailsSpareParts.requestSparePart.parammaps['partCode'] = queryString
+      GetDataByName(this.tab1.detailsSpareParts.requestSparePart).then(response => {
+        if (response.data.list == null) {
+          cb([])
+        } else {
+          cb(response.data.list)
+        }
+      })
+    },
+    handleSelectSparePart(item) {
+      console.log('备件模糊查询选中值', item)
+      if (this.tab1.detailsSpareParts.listAdd.length > 0) {
+        if (this.tab1.detailsSpareParts.listAdd.find(obj => obj.partCode == item.partCode)) {
+          this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
+        } else {
+          if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
+            this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
+            this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
+          } else {
+            item.srcpath = ''
+            item.picpath = ''
+          }
+          this.$set(item, 'myid', new Date().getTime())
+          this.$set(item, 'taxcode', '')
+          this.tab1.detailsSpareParts.listAdd.unshift(item)
+        }
+      } else {
+        if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
+          this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
+          this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
+        } else {
+          item.srcpath = ''
+          item.picpath = ''
+        }
+        this.$set(item, 'myid', new Date().getTime())
+        this.tab1.detailsSpareParts.listAdd.unshift(item)
+      }
+    },
+    brandSearch(queryString, cb) {
+      this.tab1.detailsSpareParts.requestBrand.parammaps['brandName'] = queryString
+      GetDataByName(this.tab1.detailsSpareParts.requestBrand).then(response => {
+        this.tab1.detailsSpareParts.BrandList = response.data.list
+        cb(this.tab1.detailsSpareParts.BrandList)
+      })
+    },
+    handleSelectBrand(item, row) {
+      this.$set(row, 'brandName', item.brandName)
+      this.$set(row, 'brandId', item.brandId)
+      this.$forceUpdate()
+    },
+    handleFocusBrand(row) {
+      this.$set(row, 'brandName', '')
+      this.$set(row, 'brandId', '')
+    },
+    handleBlurBrand(row) {
+      if (row.brandId == '') {
+        this.$set(row, 'brand', '')
+        this.$set(row, 'brandName', '')
+        this.$set(row, 'brandId', '')
+      }
+    },
+    partDelete(row) {
+      console.log('备件明细-备件删除', row)
+      MessageBox.confirm('设备名称:' + row.partName, '确认删除?', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        for (var i = 0; i < this.tab1.detailsSpareParts.listAdd.length; i++) {
+          console.log(this.tab1.detailsSpareParts.listAdd[i])
+          if (this.tab1.detailsSpareParts.listAdd[i].myid === row.myid) {
+            var listAddIndex = this.tab1.detailsSpareParts.listAdd.indexOf(this.tab1.detailsSpareParts.listAdd[i])
+          }
+          if (listAddIndex > -1) {
+            this.tab1.detailsSpareParts.listAdd.splice(listAddIndex, 1)
+            return
+          }
+        }
+      })
+    },
+    handleTab1DownloadTemp2() {
+      console.log('备件明细-备件模板')
+      import('@/vendor/Export2Excel').then(excel => {
+        const list1 = []
+        const tHeader = ['备件编号', '备件名称', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注']
+        const filterVal = ['备件编号', '备件名称', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注']
+        const data1 = this.formatJsonTemp(filterVal, list1)
+        excel.export_json_to_excel({ header: tHeader, data: data1, filename: '备件明细模板', autoWidth: true, bookType: 'xlsx' })
+      })
+    },
+    formatJsonTemp(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j === 'timestamp') {
+            return parseTime(v[j])
+          } else {
+            return v[j]
+          }
+        })
+      )
+    },
+    beforeImportExcel(file) {
+      const isLt2M = file.size / 1024 / 1024 < 6
+      if (!isLt2M) {
+        this.$message.error('上传文件大小不能超过 6MB!')
+      }
+      return isLt2M
+    },
+    handleImportExcelSuccess(res, file) {
+      console.log(res)
+      if (res.msg == 'ok') {
+        this.$message({ title: '成功', message: '导入成功:' + res.data.success + '条!', type: 'success', duration: 2000 })
+        if (res.data.err_count > 0) {
+          this.$notify({ title: '失败', message: '导入失败:' + res.data.err_count + '条!', type: 'danger', duration: 2000 })
+           import('@/vendor/Export2Excel').then(excel => {
+             const list1 = res.data.result
+             const tHeader = ['备件编号', '备件名称', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '报错信息']
+             const filterVal = ['备件编号', '备件名称', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', 'error_msg']
+             const data1 = this.formatJson(filterVal, list1)
+             excel.export_json_to_excel({ header: tHeader, data: data1, filename: '合同报错信息', autoWidth: true, bookType: 'xlsx' })
+           })
+        }
+        this.getImportExcelList()
+      } else {
+        this.$notify({ title: '失败', message: '上传失败,文件格式错误', type: 'danger', duration: 2000 })
+      }
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j == 'timestamp') {
+            return parseTime(v[j])
+          } else {
+            return v[j]
+          }
+        })
+      )
+    },
+    getClearImportExcelList() {
+      PostDataByName(this.tab1.detailsSpareParts.clearImportExcelParm).then(response => {
+        console.log(response.msg)
+        if (response.msg == 'ok') {
+          this.tab1.detailsSpareParts.isDisabledImport = false
+        }
+      })
+    },
+    getImportExcelList() {
+      GetDataByName(this.tab1.detailsSpareParts.importExcelParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (response.data.list[i].picpath == undefined) {
+              response.data.list[i].picpath = ''
+              response.data.list[i].srcpath = ''
+            } else {
+              this.$set(response.data.list[i], 'srcpath', process.env.VUE_APP_BASE_API + response.data.list[i].srcpath)
+              this.$set(response.data.list[i], 'picpath', process.env.VUE_APP_BASE_API + response.data.list[i].picpath)
+            }
+            response.data.list[i].myid = new Date().getTime() + i
+          }
+          this.tab1.detailsSpareParts.listAdd = response.data.list
+        } else {
+          this.tab1.detailsSpareParts.list = []
+        }
+      })
+    },
+    handleTab1Create2() {
+      console.log('备件明细-新增/变更')
+      this.dialogStatus = 'tab1create2'
+      this.tab1.detailsSpareParts.create.dialogFormVisible = true
+      this.tab1.detailsSpareParts.listAdd = []
+      this.tab1.detailsSpareParts.partCode = ''
+      this.tab1.detailsSpareParts.requestSparePart.name = 'getcontratListBybigALLParts'
+      this.tab1.detailsSpareParts.requestSparePart.parammaps = {}
+      this.getClearImportExcelList()
+    },
+    add_dialog_save2() {
+      console.log('备件明细-新增保存')
+      if (this.tab1.detailsSpareParts.listAdd.length !== 0) {
+        for (let i = 0; i < this.tab1.detailsSpareParts.listAdd.length; i++) {
+          if (this.tab1.detailsSpareParts.listAdd[i].planAmount == null || this.tab1.detailsSpareParts.listAdd[i].brand == null || this.tab1.detailsSpareParts.listAdd[i].price == null || this.tab1.detailsSpareParts.listAdd[i].planAmount == '' || this.tab1.detailsSpareParts.listAdd[i].brand === '' || this.tab1.detailsSpareParts.listAdd[i].brandId === '' || this.tab1.detailsSpareParts.listAdd[i].price == '' || this.tab1.detailsSpareParts.listAdd[i].brand == undefined || this.tab1.detailsSpareParts.listAdd[i].brandId == undefined) {
+            this.$message({ type: 'warning', message: '请检查备件品牌或计划量或单价是否为空', duration: 2000 })
+            return false
+          } else {
+            var rulesPlanAmount = /^[1-9]\d*$/
+            if (!rulesPlanAmount.test(parseFloat(this.tab1.detailsSpareParts.listAdd[i].planAmount))) {
+              this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
+              return false
+            }
+            var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
+            if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
+              this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
+              return false
+            }
+          }
+        }
+        this.postDataPramas = {}
+        this.postDataPramas.common = { 'returnmap': '0' }
+        this.postDataPramas.data = []
+        this.postDataPramas.data[0] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
+          pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
+          flag: this.tab1.detailsSpareParts.detailsList.flag,
+          providerId: this.tab1.detailsSpareParts.detailsList.providerId,
+          providerName: this.tab1.detailsSpareParts.detailsList.providerName,
+          startTime: this.tab1.detailsSpareParts.detailsList.startTime,
+          stopTime: this.tab1.detailsSpareParts.detailsList.stopTime,
+          contractCode: '',
+          contractCode1: this.tab1.detailsSpareParts.detailsList.contractCode,
+          creatorId: Cookies.get('employeid'),
+          creatorMan: Cookies.get('employename'),
+          creatorTime: parseTime(new Date(), '{y}-{m}-{d}'),
+          isZeroStock: this.tab1.detailsSpareParts.detailsList.isZeroStock,
+          statue: this.tab1.detailsSpareParts.detailsList.statue,
+          remark: this.tab1.detailsSpareParts.detailsList.remark,
+          SHtype: 1
+        }}
+        this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.tab1.detailsSpareParts.listAdd }}
+        this.postDataPramas.data[1].children = []
+        this.postDataPramas.data[1].children[0] = { 'name': 'checkcontracPartCode', 'type': 'v', 'parammaps': {
+          pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
+          providerId: this.tab1.detailsSpareParts.detailsList.providerId,
+          stopTime: this.tab1.detailsSpareParts.detailsList.stopTime,
+          flag: this.tab1.detailsSpareParts.detailsList.flag,
+          isZeroStock: this.tab1.detailsSpareParts.detailsList.isZeroStock,
+          statue: this.tab1.detailsSpareParts.detailsList.statue,
+          partCode: '@insertSpotList.partCode',
+          brandId: '@insertSpotList.brandId'
+        }}
+        this.postDataPramas.data[1].children[1] = { 'name': 'insertContractV2', 'type': 'e', 'parammaps': {
+          bigId: '@insertBigContractV2.LastInsertId',
+          pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
+          pastureName: this.tab1.detailsSpareParts.detailsList.pastureName,
+          partId: '@insertSpotList.id',
+          partName: '@insertSpotList.partName',
+          partCode: '@insertSpotList.partCode',
+          specification: '@insertSpotList.specification',
+          price: '@insertSpotList.price',
+          brandId: '@insertSpotList.brandId',
+          brand: '@insertSpotList.brand',
+          planAmount: '@insertSpotList.planAmount',
+          remark: '@insertSpotList.remark',
+          unit: '@insertSpotList.unit',
+          contractId: '@insertSpotList.contractId',
+          taxcode: '@insertSpotList.taxcode',
+          lifeCycle: '@insertSpotList.lifeCycle',
+          contractVarianceItem: '@insertSpotList.contractVarianceItem'
+        }}
+        ExecDataByConfig(this.postDataPramas).then(response => {
+          console.log('新增保存发送参数', this.postDataPramas)
+          if (response.msg == 'fail') {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          } else {
+            this.getTab1List2()
+            this.getPendingList()
+            this.tab1.detailsSpareParts.create.dialogFormVisible = false
+            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+          }
+        })
+      } else {
+        this.$notify({ title: '', message: '请选择备件', type: 'warning', duration: 2000 })
+        return false
+      }
+    },
+    handleTab1Change2() {
+      console.log('备件明细-变更')
+      this.dialogStatus = 'tab1change2'
+      this.tab1.detailsSpareParts.create.dialogFormVisible = true
+      this.tab1.detailsSpareParts.listAdd = []
+      this.tab1.detailsSpareParts.requestSparePart.parammaps.pastureId = this.tab1.detailsSpareParts.detailsList.pastureId
+      this.tab1.detailsSpareParts.requestSparePart.parammaps.providerId = this.tab1.detailsSpareParts.detailsList.providerId
+      this.tab1.detailsSpareParts.requestSparePart.parammaps.stopTime = this.tab1.detailsSpareParts.detailsList.stopTime
+      this.tab1.detailsSpareParts.requestSparePart.parammaps.flag = this.tab1.detailsSpareParts.detailsList.flag
+      this.tab1.detailsSpareParts.requestSparePart.parammaps.isZeroStock = this.tab1.detailsSpareParts.detailsList.isZeroStock
+      this.tab1.detailsSpareParts.requestSparePart.parammaps.statue = this.tab1.detailsSpareParts.detailsList.statue
+      this.tab1.detailsSpareParts.requestSparePart.name = 'getcontratListBybigParts'
+    },
+    changeData2() {
+      console.log('备件明细-变更保存')
+      if (this.tab1.detailsSpareParts.listAdd.length !== 0) {
+        for (let i = 0; i < this.tab1.detailsSpareParts.listAdd.length; i++) {
+          if (this.tab1.detailsSpareParts.listAdd[i].planAmount == null || this.tab1.detailsSpareParts.listAdd[i].brand == null || this.tab1.detailsSpareParts.listAdd[i].price == null || this.tab1.detailsSpareParts.listAdd[i].planAmount == '' || this.tab1.detailsSpareParts.listAdd[i].brand === '' || this.tab1.detailsSpareParts.listAdd[i].brandId === '' || this.tab1.detailsSpareParts.listAdd[i].price == '' || this.tab1.detailsSpareParts.listAdd[i].brand == undefined || this.tab1.detailsSpareParts.listAdd[i].brandId == undefined) {
+            this.$message({ type: 'warning', message: '请检查备件品牌或计划量或单价是否为空', duration: 2000 })
+            return false
+          } else {
+            var rulesPlanAmount = /^[1-9]\d*$/
+            if (!rulesPlanAmount.test(parseFloat(this.tab1.detailsSpareParts.listAdd[i].planAmount))) {
+              this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
+              return false
+            } else {
+              var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
+              if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
+                this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
+                return false
+              }
+            }
+          }
+        }
+        this.postDataPramas = {}
+        this.postDataPramas.common = { 'returnmap': '0' }
+        this.postDataPramas.data = []
+        this.postDataPramas.data[0] = { 'name': 'insertBigContractV2', 'type': 'e', 'parammaps': {
+          pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
+          flag: this.tab1.detailsSpareParts.detailsList.flag,
+          providerId: this.tab1.detailsSpareParts.detailsList.providerId,
+          providerName: this.tab1.detailsSpareParts.detailsList.providerName,
+          startTime: this.tab1.detailsSpareParts.detailsList.startTime,
+          stopTime: this.tab1.detailsSpareParts.detailsList.stopTime,
+          contractCode: '',
+          contractCode1: this.tab1.detailsSpareParts.detailsList.contractCode,
+          creatorId: Cookies.get('employeid'),
+          creatorMan: Cookies.get('employename'),
+          creatorTime: parseTime(new Date(), '{y}-{m}-{d}'),
+          isZeroStock: this.tab1.detailsSpareParts.detailsList.isZeroStock,
+          statue: this.tab1.detailsSpareParts.detailsList.statue,
+          remark: this.tab1.detailsSpareParts.detailsList.remark,
+          SHtype: 2
+        }}
+        this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.tab1.detailsSpareParts.listAdd }}
+        this.postDataPramas.data[1].children = []
+        this.postDataPramas.data[1].children[0] = { 'name': 'insertContractV2', 'type': 'e', 'parammaps': {
+          bigId: '@insertBigContractV2.LastInsertId',
+          pastureId: '@insertSpotList.pastureId',
+          pastureName: '@insertSpotList.pastureName',
+          partId: '@insertSpotList.partId',
+          partName: '@insertSpotList.partName',
+          partCode: '@insertSpotList.partCode',
+          specification: '@insertSpotList.specification',
+          price: '@insertSpotList.price',
+          brandId: '@insertSpotList.brandId',
+          brand: '@insertSpotList.brand',
+          planAmount: '@insertSpotList.planAmount',
+          remark: '@insertSpotList.remark',
+          unit: '@insertSpotList.unit',
+          contractId: '@insertSpotList.contractId',
+          taxcode: '@insertSpotList.taxcode',
+          lifeCycle: '@insertSpotList.lifeCycle',
+          contractVarianceItem: '@insertSpotList.contractVarianceItem'
+        }}
+        ExecDataByConfig(this.postDataPramas).then(response => {
+          console.log('新增保存发送参数', this.postDataPramas)
+          if (response.msg == 'fail') {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          } else {
+            this.getTab1List2()
+            this.getPendingList()
+            this.tab1.detailsSpareParts.create.dialogFormVisible = false
+            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+          }
+        })
+      } else {
+        this.$notify({ title: '', message: '请选择备件', type: 'warning', duration: 2000 })
+        return false
+      }
+    },
+    handleTab1Export2() {
+      console.log('备件明细-导出')
+      this.$alert('备件明细正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
+      this.isPercentage = true
+      this.percentage = 1
+      var timer = setInterval(() => {
+        this.percentage += 5
+        if (this.percentage > 95) {
+          this.percentage = 99
+          clearInterval(timer)
+          this.tab1.detailsSpareParts.getdataListParm.pagecount = 10
+        }
+        this.percentage = this.percentage
+      }, 1000)
+      this.tab1.detailsSpareParts.getdataListParm.pagecount = ''
+      GetDataByName(this.tab1.detailsSpareParts.getdataListParm).then(response => {
+        if (response.data.list !== '') {
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+        }
+        if (response.data.list !== null) {
+          this.$nextTick(() => {
+            const ExcelDatas = [
+              {
+                tHeader: ['备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '计划量', '单价', '使用周期', '合同差异项', '备注'],
+                filterVal: ['partCode', 'partName', 'specification', 'brand', 'unit', 'planAmount', 'price', 'lifeCycle', 'contractVarianceItem', 'remark'],
+                tableDatas: response.data.list,
+                sheetName: '合同管理-备件明细'
+              }
+            ]
+            json2excel(ExcelDatas, '合同管理-备件明细', true, 'xlsx')
+          })
+        }
+      })
+    },
+
+    // 变更记录
+    handleTab1ChangeRecord(row) {
+      console.log('变更记录')
+      this.tab1.detailsSpareParts.detailsList = Object.assign({}, row)
+      this.contractCodese = row.contractCode
+      this.isContractManagement = false
+      this.isChangeRecord = true
+      this.tab1.changeRecord.getdataListParm.parammaps.pastureId = row.pastureId
+      this.tab1.changeRecord.getdataListParm.parammaps.providerId = row.providerId
+      this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = row.stopTime
+      this.tab1.changeRecord.getdataListParm.parammaps.flag = row.flag
+      this.tab1.changeRecord.getdataListParm.parammaps.isZeroStock = row.isZeroStock
+      this.tab1.changeRecord.getdataListParm.parammaps.statue = row.statue
+      this.tab1.changeRecord.getdataListParm.parammaps.contractCode = ''
+      this.tab1.changeRecord.getdataListParm.parammaps.tab1InputDatetime3 = ''
+      this.tab1.changeRecord.getdataListParm.parammaps.startTime = ''
+      this.tab1.changeRecord.getdataListParm.parammaps.stopTime = ''
+      this.tab1.changeRecord.getdataListParm.parammaps.SHtype = ''
+      this.tab1.changeRecord.getdataListParm.parammaps.stuteSH = ''
+      this.getTab1List3()
+    },
+    handleTab1goBack2() {
+      // this.reload()
+      this.isContractManagement = true
+      this.isChangeRecord = false
+      this.tab1.changeRecord.total = 0
+      // this.tab1.contractManagement.getdataListParm.offset = 1
+      this.getTab1List()
+    },
+    getTab1List3() {
+      this.tab1.changeRecord.listLoading = true
+      if (this.$refs['tab1InputDatetime3'] !== undefined && this.$refs['tab1InputDatetime3'].value !== null) {
+        this.tab1.changeRecord.getdataListParm.parammaps.startTime = this.$refs['tab1InputDatetime3'].value[0]
+        this.tab1.changeRecord.getdataListParm.parammaps.stopTime = this.$refs['tab1InputDatetime3'].value[1]
+      } else {
+        this.tab1.changeRecord.getdataListParm.parammaps.startTime = ''
+        this.tab1.changeRecord.getdataListParm.parammaps.stopTime = ''
+      }
+      GetDataByName(this.tab1.changeRecord.getdataListParm).then(response => {
+        this.tab1.changeRecord.list = response.data.list
+        this.tab1.changeRecord.pageNum = response.data.pageNum
+        this.tab1.changeRecord.pageSize = response.data.pageSize
+        if (response.data.list !== null) {
+          this.tab1.changeRecord.total = response.data.total
+        } else {
+          this.tab1.changeRecord.total = 0
+        }
+        setTimeout(() => {
+          this.tab1.changeRecord.listLoading = false
+        }, 300)
+      })
+    },
+    handleTab1Filter3() {
+      this.tab1.changeRecord.listLoading = true
+      if (this.tab1.changeRecord.getdataListParm.parammaps.tab1InputDatetime3 == null) {
+        this.tab1.changeRecord.getdataListParm.parammaps.tab1InputDatetime3 = ''
+      }
+      this.tab1.changeRecord.getdataListParm.offset = 1
+      if (this.tab1.changeRecord.radioAll == '全部') {
+        this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 2
+        this.getTab1List3()
+      } else if (this.tab1.changeRecord.radioAll == '待处理') {
+        this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 0
+        this.getTab1List3()
+      } else if (this.tab1.changeRecord.radioAll == '已处理') {
+        this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 1
+        this.getTab1List3()
+      }
+    },
+    changeChangeRecordAll() {
+      if (this.tab1.changeRecord.radioAll == '全部') {
+        this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 2
+        this.getTab1List3()
+      } else if (this.tab1.changeRecord.radioAll == '待处理') {
+        this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 0
+        this.getTab1List3()
+      } else if (this.tab1.changeRecord.radioAll == '已处理') {
+        this.tab1.changeRecord.getdataListParm.parammaps.SHnums = 1
+        this.getTab1List3()
+      }
+    },
+    handleTab1See3(row) {
+      console.log('变更记录-查看')
+      this.tab1.changeRecord.see.temp = Object.assign({}, row)
+      this.dialogStatus = 'tab1See2'
+      this.tab1.changeRecord.see.dialogFormVisible = true
+      if (row.SHtype == 0 || row.SHtype == 1 || row.SHtype == 2) {
+        this.tab1.changeRecord.see.getdataListParm.parammaps.id = row.id
+        this.getTab1List3See()
+      }
+      var reason = '未通过原因:' + this.tab1.changeRecord.see.temp.workflowNote
+      if (this.tab1.changeRecord.see.temp.SHStatus == 2) {
+        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核' }, { title: '设备中心审核' }]
+        this.tab1.changeRecord.see.active = 1
+      } else if (this.tab1.changeRecord.see.temp.SHStatus == 3) {
+        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核' }]
+        this.tab1.changeRecord.see.active = 2
+      } else if (this.tab1.changeRecord.see.temp.SHStatus == 4) {
+        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson, status: 'error', reason: reason }, { title: '设备中心审核' }]
+        this.tab1.changeRecord.see.active = 2
+      } else if (this.tab1.changeRecord.see.temp.SHStatus == 5) {
+        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核' }]
+        this.tab1.changeRecord.see.active = 2
+      } else if (this.tab1.changeRecord.see.temp.SHStatus == 6) {
+        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核' }]
+        this.tab1.changeRecord.see.active = 3
+      } else if (this.tab1.changeRecord.see.temp.SHStatus == 7) {
+        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核', date: this.tab1.changeRecord.see.temp.CGChargedate, name: this.tab1.changeRecord.see.temp.CGChargePerson }]
+        this.tab1.changeRecord.see.active = 4
+      } else if (this.tab1.changeRecord.see.temp.SHStatus == 8) {
+        this.tab1.changeRecord.see.activeList = [{ title: '合同录入', date: this.tab1.changeRecord.see.temp.creatorTime, name: this.tab1.changeRecord.see.temp.creatorMan }, { title: '供应主管审核', date: this.tab1.changeRecord.see.temp.chargeDate, name: this.tab1.changeRecord.see.temp.chargePerson }, { title: '设备中心审核', date: this.tab1.changeRecord.see.temp.CGChargedate, name: this.tab1.changeRecord.see.temp.CGChargePerson, status: 'error', reason: reason }]
+        this.tab1.changeRecord.see.active = 4
+      }
+    },
+    getTab1List3See() {
+      GetDataByName(this.tab1.changeRecord.see.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          this.tab1.changeRecord.see.pageNum = response.data.pageNum
+          this.tab1.changeRecord.see.pageSize = response.data.pageSize
+          if (response.data.total) {
+            this.tab1.changeRecord.see.total = response.data.total
+          }
+          for (let i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].myid = new Date().getTime() + i
+            if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
+              const srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
+              const picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
+              response.data.list[i].srcpath = srcpath
+              response.data.list[i].picpath = picpath
+            } else {
+              response.data.list[i].srcpath = ''
+              response.data.list[i].picpath = ''
+            }
+          }
+          this.tab1.changeRecord.see.list = response.data.list
+          this.tab1.detailsSpareParts.listAdd = response.data.list
+        } else {
+          this.tab1.changeRecord.see.list = []
+          this.tab1.detailsSpareParts.listAdd = []
+        }
+        setTimeout(() => {
+          this.tab1.changeRecord.see.listLoading = false
+        }, 300)
+      })
+    },
+    handleTab1Update3(row) {
+      console.log('变更记录-编辑', row)
+      this.tab1.detailsSpareParts.updateList = Object.assign({}, row)
+      this.tab1.detailsSpareParts.create.temp = Object.assign({}, row)
+      this.dialogStatus = 'tab1Update2'
+      this.tab1.detailsSpareParts.create.dialogFormVisible = true
+      this.tab1.changeRecord.see.getdataListParm.parammaps.id = row.id
+      this.getTab1List3See()
+      if (row.SHtype == 1) {
+        this.tab1.detailsSpareParts.requestSparePart.name = 'getcontratListBybigALLParts'
+        this.tab1.detailsSpareParts.requestSparePart.parammaps = {}
+      } else {
+        this.tab1.detailsSpareParts.requestSparePart.parammaps.pastureId = this.tab1.detailsSpareParts.detailsList.pastureId
+        this.tab1.detailsSpareParts.requestSparePart.parammaps.providerId = this.tab1.detailsSpareParts.detailsList.providerId
+        this.tab1.detailsSpareParts.requestSparePart.parammaps.stopTime = this.tab1.detailsSpareParts.detailsList.stopTime
+        this.tab1.detailsSpareParts.requestSparePart.parammaps.flag = this.tab1.detailsSpareParts.detailsList.flag
+        this.tab1.detailsSpareParts.requestSparePart.parammaps.isZeroStock = this.tab1.detailsSpareParts.detailsList.isZeroStock
+        this.tab1.detailsSpareParts.requestSparePart.parammaps.statue = this.tab1.detailsSpareParts.detailsList.statue
+        this.tab1.detailsSpareParts.requestSparePart.name = 'getcontratListBybigParts'
+      }
+    },
+    edit_dialog_save2() {
+      console.log('编辑保存')
+      // 新增合同 || 变更日期
+      if (this.tab1.detailsSpareParts.updateList.SHtype == 0 || this.tab1.detailsSpareParts.updateList.SHtype == 3) {
+        this.postDataPramas = {}
+        this.postDataPramas.common = { 'returnmap': '0' }
+        this.postDataPramas.data = []
+        this.postDataPramas.data[0] = { 'name': 'updateBigcontractV2', 'type': 'e', 'parammaps': {
+          id: this.tab1.detailsSpareParts.create.temp.id,
+          startTime: this.tab1.detailsSpareParts.create.temp.startTime,
+          stopTime: this.tab1.detailsSpareParts.create.temp.stopTime,
+          isZeroStock: this.tab1.detailsSpareParts.create.temp.isZeroStock,
+          remark: this.tab1.detailsSpareParts.create.temp.remark,
+          stopTimeHis: this.tab1.detailsSpareParts.create.temp.stopTimeHis
+        }}
+        ExecDataByConfig(this.postDataPramas).then(response => {
+          console.log('新增保存发送参数', this.postDataPramas)
+          if (response.msg == 'fail') {
+            this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+          } else {
+            if (this.tab1.detailsSpareParts.updateList.SHtype == 0) {
+              this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = this.tab1.detailsSpareParts.create.temp.stopTime
+            }
+            this.getTab1List3()
+            this.getPendingList()
+            this.tab1.detailsSpareParts.create.dialogFormVisible = false
+            this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+          }
+        })
+      } else {
+        if (this.tab1.detailsSpareParts.listAdd.length !== 0) {
+          for (let i = 0; i < this.tab1.detailsSpareParts.listAdd.length; i++) {
+            if (this.tab1.detailsSpareParts.listAdd[i].planAmount == null || this.tab1.detailsSpareParts.listAdd[i].brand == null || this.tab1.detailsSpareParts.listAdd[i].price == null || this.tab1.detailsSpareParts.listAdd[i].planAmount == '' || this.tab1.detailsSpareParts.listAdd[i].brand == '' || this.tab1.detailsSpareParts.listAdd[i].brandId === '' || this.tab1.detailsSpareParts.listAdd[i].price == '' || this.tab1.detailsSpareParts.listAdd[i].brand == undefined || this.tab1.detailsSpareParts.listAdd[i].brandId == undefined) {
+              console.log(this.tab1.detailsSpareParts.listAdd[i])
+              this.$message({ type: 'warning', message: '请检查备件品牌或计划量或单价是否为空', duration: 2000 })
+              return false
+            } else {
+              var rulesPlanAmount = /^[1-9]\d*$/
+              if (!rulesPlanAmount.test(parseFloat(this.tab1.detailsSpareParts.listAdd[i].planAmount))) {
+                this.$message({ type: 'error', message: '计划量请输入正整数', duration: 2000 })
+                return false
+              } else {
+                var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
+                if (rulesPrice.test(this.tab1.detailsSpareParts.listAdd[i].price) == false) {
+                  this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后两位', duration: 2000 })
+                  return false
+                }
+              }
+            }
+          }
+          this.postDataPramas = {}
+          this.postDataPramas.common = { 'returnmap': '0' }
+          this.postDataPramas.data = []
+          this.postDataPramas.data[0] = { 'name': 'deleteContract', 'type': 'e', 'parammaps': {
+            bigId: this.tab1.detailsSpareParts.updateList.id
+          }}
+          this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.tab1.detailsSpareParts.listAdd }}
+          this.postDataPramas.data[1].children = []
+
+          if (this.tab1.detailsSpareParts.updateList.SHtype == 2) {
+            this.postDataPramas.data[1].children[0] = { 'name': 'insertContractV2', 'type': 'e', 'parammaps': {
+              bigId: this.tab1.detailsSpareParts.updateList.id,
+              pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
+              pastureName: this.tab1.detailsSpareParts.detailsList.pastureName,
+              partId: '@insertSpotList.id',
+              partName: '@insertSpotList.partName',
+              partCode: '@insertSpotList.partCode',
+              specification: '@insertSpotList.specification',
+              price: '@insertSpotList.price',
+              brandId: '@insertSpotList.brandId',
+              brand: '@insertSpotList.brand',
+              planAmount: '@insertSpotList.planAmount',
+              remark: '@insertSpotList.remark',
+              unit: '@insertSpotList.unit',
+              contractId: '@insertSpotList.contractId',
+              taxcode: '@insertSpotList.taxcode',
+              lifeCycle: '@insertSpotList.lifeCycle',
+              contractVarianceItem: '@insertSpotList.contractVarianceItem'
+            }}
+          } else {
+            this.postDataPramas.data[1].children[0] = { 'name': 'checkcontracPartCode', 'type': 'v', 'parammaps': { pastureId: this.tab1.detailsSpareParts.detailsList.pastureId, providerId: this.tab1.detailsSpareParts.detailsList.providerId, stopTime: this.tab1.detailsSpareParts.detailsList.stopTime, flag: this.tab1.detailsSpareParts.detailsList.flag, isZeroStock: this.tab1.detailsSpareParts.detailsList.isZeroStock, statue: this.tab1.detailsSpareParts.detailsList.statue, partCode: '@insertSpotList.partCode', brandId: '@insertSpotList.brandId' }}
+            this.postDataPramas.data[1].children[1] = { 'name': 'insertContractV2', 'type': 'e', 'parammaps': {
+              bigId: this.tab1.detailsSpareParts.updateList.id,
+              pastureId: this.tab1.detailsSpareParts.detailsList.pastureId,
+              pastureName: this.tab1.detailsSpareParts.detailsList.pastureName,
+              partId: '@insertSpotList.id',
+              partName: '@insertSpotList.partName',
+              partCode: '@insertSpotList.partCode',
+              specification: '@insertSpotList.specification',
+              price: '@insertSpotList.price',
+              brandId: '@insertSpotList.brandId',
+              brand: '@insertSpotList.brand',
+              planAmount: '@insertSpotList.planAmount',
+              remark: '@insertSpotList.remark',
+              unit: '@insertSpotList.unit',
+              contractId: '@insertSpotList.contractId',
+              lifeCycle: '@insertSpotList.lifeCycle',
+              contractVarianceItem: '@insertSpotList.contractVarianceItem'
+              // taxcode: '@insertSpotList.taxcode'
+            }}
+          }
+          this.postDataPramas.data[2] = { 'name': 'updateBigcontract', 'type': 'e', 'parammaps': {
+            id: this.tab1.detailsSpareParts.updateList.id
+          }}
+          ExecDataByConfig(this.postDataPramas).then(response => {
+            console.log('新增保存发送参数', this.postDataPramas)
+            if (response.msg == 'fail') {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.getTab1List3()
+              this.getPendingList()
+              this.tab1.detailsSpareParts.create.dialogFormVisible = false
+              this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+            }
+          })
+        } else {
+          this.$notify({ title: '', message: '请选择备件', type: 'warning', duration: 2000 })
+          return false
+        }
+      }
+    },
+    changeExamineStatue(val) {
+      if (val == 2) {
+        this.tab1.changeRecord.examine.isReason = true
+      } else {
+        this.tab1.changeRecord.examine.isReason = false
+      }
+    },
+    // 审核1
+    handleTab1Examine(row) {
+      console.log('变更记录-审核')
+      this.dialogStatus = 'tab1examine'
+      this.tab1.changeRecord.examine.dialogFormVisible = true
+      this.tab1.changeRecord.examine.temp = Object.assign({}, row)
+      this.tab1.changeRecord.examine.isReason = false
+      if (row == undefined) {
+        this.tab1.changeRecord.examine.temp = this.tab1.changeRecord.see.temp
+        this.$set(this.tab1.changeRecord.see.temp, 'statueSH', 1)
+        this.$set(this.tab1.changeRecord.see.temp, 'workflowNote', '')
+      } else {
+        this.tab1.changeRecord.examine.temp = Object.assign({}, row)
+        this.$set(this.tab1.changeRecord.examine.temp, 'statueSH', 1)
+        this.$set(this.tab1.changeRecord.examine.temp, 'workflowNote', '')
+      }
+      this.keyupSubmit()
+    },
+    keyupSubmit() {
+      if (this.dialogStatus == 'tab1examine' || this.dialogStatus == 'tab1examine2' || this.dialogStatus == 'tab1examine3') {
+        document.onkeydown = e => {
+          const _key = window.event.keyCode
+          if (_key === 13) {
+            if (this.dialogStatus == 'tab1examine') {
+              this.createExamineData()
+            } else {
+              this.createExamineData3()
+            }
+          }
+        }
+      }
+    },
+    createExamineData() {
+      console.log('点击了设备主管审核确认1')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['examineTemp'].validate(valid => {
+        if (valid) {
+          this.postDataPramas = {}
+          this.postDataPramas.name = 'contractCharge'
+          this.postDataPramas.parammaps = {}
+          this.postDataPramas.parammaps.id = this.tab1.changeRecord.examine.temp.id
+          if (this.tab1.changeRecord.examine.temp.statueSH === 1) {
+            this.postDataPramas.parammaps.statue = 5
+          } else {
+            this.postDataPramas.parammaps.statue = 4
+          }
+          this.postDataPramas.parammaps.empId	 = Cookies.get('employeid')
+          this.postDataPramas.parammaps.workflowNote = this.tab1.changeRecord.examine.temp.workflowNote
+          PostDataByName(this.postDataPramas).then(response => {
+            console.log('设备主管审核确认发送参数', this.postDataPramas)
+            if (response.msg !== 'fail') {
+              this.tab1.changeRecord.examine.dialogFormVisible = false
+              this.tab1.changeRecord.see.dialogFormVisible = false
+              this.tab1.changeRecord.isStatueReason = false
+              this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
+              this.getTab1List3()
+              this.getTab1List()
+              this.getPendingList()
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+    // 审核2
+    handleTab1Examine3(row) {
+      console.log(' 变更记录-审核3')
+      if (row == undefined) {
+        this.tab1.changeRecord.examine.temp = this.tab1.changeRecord.see.temp
+        this.$set(this.tab1.changeRecord.see.temp, 'statueSH', 1)
+        this.$set(this.tab1.changeRecord.see.temp, 'workflowNote', '')
+      } else {
+        this.tab1.changeRecord.examine.temp = Object.assign({}, row)
+        this.$set(this.tab1.changeRecord.examine.temp, 'statueSH', 1)
+        this.$set(this.tab1.changeRecord.examine.temp, 'workflowNote', '')
+      }
+      this.dialogStatus = 'tab1examine3'
+      this.tab1.changeRecord.examine.dialogFormVisible = true
+      this.tab1.changeRecord.examine.isReason = false
+      this.keyupSubmit()
+    },
+    createExamineData3() {
+      console.log('点击了设备中心审核确认3')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['examineTemp'].validate(valid => {
+        if (valid) {
+          this.postDataPramas = {}
+          this.postDataPramas.common = { 'returnmap': '0' }
+          this.postDataPramas.data = []
+          if (this.tab1.changeRecord.examine.temp.statueSH == 1) {
+            this.postDataPramas.data[0] = { 'name': 'contractCharge1', 'type': 'e', 'parammaps': {
+              statue: 7,
+              empId: Cookies.get('employeid'),
+              workflowNote: this.tab1.changeRecord.examine.temp.workflowNote,
+              id: this.tab1.changeRecord.examine.temp.id
+            }}
+            if (this.tab1.changeRecord.examine.temp.SHtype == 1 || this.tab1.changeRecord.examine.temp.SHtype == 2) {
+              this.postDataPramas.data[1] = { 'name': 'updateContractEnable', 'type': 'e', 'parammaps': {
+                id: this.tab1.changeRecord.examine.temp.id
+              }}
+            } else if (this.tab1.changeRecord.examine.temp.SHtype == 3) {
+              this.postDataPramas.data[1] = { 'name': 'updatecontractdate', 'type': 'e', 'parammaps': {
+                pastureId: this.tab1.changeRecord.examine.temp.pastureId,
+                providerId: this.tab1.changeRecord.examine.temp.providerId,
+                stopTimeHis: this.tab1.changeRecord.examine.temp.stopTimeHis,
+                flag: this.tab1.changeRecord.examine.temp.flag,
+                isZeroStock: this.tab1.changeRecord.examine.temp.isZeroStock,
+                statue: this.tab1.changeRecord.examine.temp.statue,
+                startTime: this.tab1.changeRecord.examine.temp.startTime,
+                stopTime: this.tab1.changeRecord.examine.temp.stopTime,
+                id: this.tab1.changeRecord.examine.temp.id
+              }}
+            }
+            this.postDataPramas.data[2] = {
+              'name': 'updateBigcontractIsToSap',
+              'type': 'e',
+              'parammaps': {
+                'contractCode': this.contractCodese
+              }
+            }
+          } else {
+            this.postDataPramas.data[0] = { 'name': 'contractCharge1', 'type': 'e', 'parammaps': {
+              statue: 8,
+              empId: Cookies.get('employeid'),
+              workflowNote: this.tab1.changeRecord.examine.temp.workflowNote,
+              id: this.tab1.changeRecord.examine.temp.id
+            }}
+          }
+          ExecDataByConfig(this.postDataPramas).then(response => {
+            console.log('新增保存发送参数', this.postDataPramas)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              if (this.postDataPramas.data[0].parammaps.statue == 7) {
+                if (this.tab1.changeRecord.examine.temp.SHtype == 3) {
+                  this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = this.tab1.changeRecord.examine.temp.stopTimeHis
+                } else {
+                  this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = this.tab1.changeRecord.examine.temp.stopTime
+                }
+              } else {
+                this.tab1.changeRecord.getdataListParm.parammaps.stopTime1 = this.tab1.detailsSpareParts.detailsList.stopTime
+              }
+              this.tab1.changeRecord.examine.dialogFormVisible = false
+              this.tab1.changeRecord.see.dialogFormVisible = false
+              this.tab1.changeRecord.examine.isStatueReason = false
+              this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+              this.getTab1List3()
+              this.getTab1List()
+              this.getPendingList()
+            }
+          })
+        }
+      })
+    },
+    handleTab1Delete3(row) {
+      console.log('变更记录-删除')
+      console.log('点击了删除')
+      MessageBox.confirm('确认删除此条信息?', {
+        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+      }).then(() => {
+        this.postDataPramas = {}
+        this.postDataPramas.common = { 'returnmap': '0' }
+        this.postDataPramas.data = []
+        this.postDataPramas.data[0] = { 'name': 'deleteBigContract', 'type': 'e', 'parammaps': {
+          id: row.id
+        }}
+        this.postDataPramas.data[1] = { 'name': 'deleteContract', 'type': 'e', 'parammaps': {
+          bigId: row.id
+        }}
+        ExecDataByConfig(this.postDataPramas).then(response => {
+          this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
+          this.getTab1List3()
+          this.getPendingList()
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消删除' })
+      })
+    },
+
+    // 合同明细
+    getTab2List() {
+      this.tab2.listLoading = true
+      if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
+        this.tab2.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
+        this.tab2.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
+      } else {
+        this.tab2.getdataListParm.parammaps.startTime = ''
+        this.tab2.getdataListParm.parammaps.stopTime = ''
+      }
+      GetDataByName(this.tab2.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          this.tab2.list = response.data.list
+          this.tab2.pageNum = response.data.pageNum
+          this.tab2.pageSize = response.data.pageSize
+          if (response.data.total) {
+            this.tab2.total = response.data.total
+          }
+        } else {
+          this.tab2.list = []
+        }
+        setTimeout(() => {
+          this.tab2.listLoading = false
+        }, 300)
+      })
+    },
+    handleTab2Filter() {
+      this.listLoading2 = true
+      if (this.tab2.getdataListParm.parammaps.inputDatetime === null) {
+        this.tab2.getdataListParm.parammaps.inputDatetime = ''
+      }
+      this.tab2.getdataListParm.offset = 1
+      this.getTab2List()
+    },
+    handleTab2Export() {
+      this.$alert('合同明细正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
+      this.isPercentage = true
+      this.percentage = 1
+      var timer = setInterval(() => {
+        this.percentage += 5
+        if (this.percentage > 95) {
+          this.percentage = 99
+          clearInterval(timer)
+        }
+        this.percentage = this.percentage
+      }, 1000)
+      if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
+        this.tab2.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
+        this.tab2.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
+      } else {
+        this.tab2.getdataListParm.parammaps.startTime = ''
+        this.tab2.getdataListParm.parammaps.stopTime = ''
+      }
+      this.tab2.getdataListParm.pagecount = ''
+      GetDataByName(this.tab2.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            if (response.data.list[i].isZeroStock == 0) {
+              response.data.list[i].isZeroStock = '否'
+            } else {
+              response.data.list[i].isZeroStock = '是'
+            }
+          }
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+        } else {
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+        }
+        this.tab2.getdataListParm.pagecount = 10
+        this.$nextTick(() => {
+          const ExcelDatas = [
+            {
+              tHeader: ['牧场', '合同编号', '合同状态', '供应商', '合同开始日期', '合同截止日期', '零库存', '备件编号', '备件名称', '规格', '备件品牌', '计量单位', '计划量', '单价', '备注', '录入人', '录入日期'],
+              filterVal: ['pastureName', 'contractCode', 'statue', 'providerName', 'startTime', 'stopTime', 'isZeroStock', 'partCode', 'partName', 'specification', 'brand', 'unit', 'planAmount', 'price', 'remark', 'creatorMan', 'creatorTime'],
+              tableDatas: response.data.list,
+              sheetName: '合同明细'
+            }
+          ]
+          json2excel(ExcelDatas, '合同明细', true, 'xlsx')
+        })
+      })
+    },
+    sapUpload() {
+      if (this.selectList.length == 0) {
+        this.$notify({ title: '失败', message: '请勾选数据!', type: 'error', duration: 2000 })
+        return false
+      }
+      const url = 'authdata/contract/push'
+      const ids = []
+      this.selectList.forEach((i) => {
+        ids.push(i.id)
+        console.log(i, '===')
+      })
+      const data = {
+        pastureId: parseInt(Cookies.get('pastureid')),
+        providerId: this.tab1.detailsSpareParts.detailsList.providerId,
+        contractIdList: ids
+      }
+      postJson(url, data).then(response => {
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
+        } else {
+          this.$notify({ title: '上传失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+  /deep/ .el-badge__content.is-fixed{
+    z-index: 1;
+  }
+  .el-notification__content {
+    white-space: pre-line !important;
+  }
+</style>
+<style lang="scss">
+  .el-notification__content {
+      white-space: pre-line !important;
+    }
+</style>

+ 38 - 38
src/views/custom/custom/index.vue

@@ -71,9 +71,9 @@
       :cell-style="cellStyle"
       class="elTable"
       :cell-class-name="tableCellClassName"
+      :max-height="myHeight"
       @cell-click="cellClick"
       @sort-change="tableSort1"
-      :max-height="myHeight"
     >
       <!-- table表格 -->
       <el-table-column label="序号" align="center" type="index" width="50px">
@@ -304,9 +304,9 @@
                 :cell-style="cellStyle"
                 class="elTable"
                 :cell-class-name="tableCellClassName"
+                :max-height="myHeight"
                 @cell-click="cellClick"
                 @sort-change="tableSort2"
-                :max-height="myHeight"
               >
                 <el-table-column label="序号" width="100px" align="center" type="index">
                   <template slot-scope="scope">
@@ -345,9 +345,9 @@
                 :cell-style="cellStyle"
                 class="elTable"
                 :cell-class-name="tableCellClassName"
+                :max-height="myHeight"
                 @cell-click="cellClick"
                 @sort-change="tableSort2"
-                :max-height="myHeight"
               >
                 <el-table-column label="序号" width="100px" align="center" type="index">
                   <template slot-scope="scope">
@@ -362,7 +362,7 @@
                 <el-table-column label="出库数量" sortable prop="checkoutNumber" min-width="60px" align="center" />
                 <el-table-column label="单价" sortable prop="price" min-width="60px" align="center" />
                 <el-table-column label="总价" sortable prop="sumPrice" min-width="60px" align="center" />
-                <el-table-column   prop="sterilisation" label="冲销状态" min-width="80px" align="center">
+                <el-table-column prop="sterilisation" label="冲销状态" min-width="80px" align="center">
                   <template slot-scope="scope">
                     <span v-if="scope.row.sterilisation == 1">已冲销</span>
                     <span v-else-if="scope.row.sterilisation == 2">部分冲销</span>
@@ -392,9 +392,9 @@
                 :cell-style="cellStyle"
                 class="elTable"
                 :cell-class-name="tableCellClassName"
+                :max-height="myHeight"
                 @cell-click="cellClick"
                 @sort-change="tableSort2"
-                :max-height="myHeight"
               >
                 <el-table-column label="序号" width="100px" align="center" type="index">
                   <template slot-scope="scope">
@@ -430,9 +430,9 @@
                 :cell-style="cellStyle"
                 class="elTable"
                 :cell-class-name="tableCellClassName"
+                :max-height="myHeight"
                 @cell-click="cellClick"
                 @sort-change="tableSort2"
-                :max-height="myHeight"
               >
                 <el-table-column label="序号" width="100px" align="center" type="index">
                   <template slot-scope="scope">
@@ -468,9 +468,9 @@
                 :cell-style="cellStyle"
                 class="elTable"
                 :cell-class-name="tableCellClassName"
+                :max-height="myHeight"
                 @cell-click="cellClick"
                 @sort-change="tableSort2"
-                :max-height="myHeight"
               >
                 <el-table-column label="序号" width="100px" align="center" type="index">
                   <template slot-scope="scope">
@@ -578,7 +578,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      pastureid:Cookies.get('pastureid'),
+      pastureid: Cookies.get('pastureid'),
       disabled: true,
       activeName: 'first',
       color: '#409EFF',
@@ -711,9 +711,9 @@ export default {
       //   }
       // },
       // ------------------------------------------
-      subscriptionStatusList:[{id:0,name:'正常'},{id:1,name:'暂估'},{id:3,name:'赠品'}],//申购状态
+      subscriptionStatusList: [{ id: 0, name: '正常' }, { id: 1, name: '暂估' }, { id: 3, name: '赠品' }], // 申购状态
       customList: [{ id: 0, name: '全部库存' }, { id: 1, name: '库存不为零' }],
-      isCustomTemplate: [], isCustomImport: [], isCustomExport: [], isCustomSee: [],isCustomChange:[],
+      isCustomTemplate: [], isCustomImport: [], isCustomExport: [], isCustomSee: [], isCustomChange: [],
       findAllProvider: [],
       findAllAssetType: [],
       findAllPasture: [],
@@ -727,7 +727,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] }
+        { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       requestBrand: {
         name: 'getBrandList',
@@ -768,7 +769,7 @@ export default {
           reportery: 1,
           specification: '',
           location: '',
-          purchase_type:''
+          purchase_type: ''
         }
       },
       list: [],
@@ -839,7 +840,7 @@ export default {
       nodeKey: 'id',
       defaultCheckedKeys: [],
       placeholder: '请选择备件类别',
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
   computed: {
@@ -916,7 +917,6 @@ export default {
       const CustomChange = 'customs:custom:change'
       const isCustomChange = checkButtons(this.$store.state.user.buttons, CustomChange)
       this.isCustomChange = isCustomChange
-
     },
     getTypeList() {
       // this.listLoading = true
@@ -931,22 +931,22 @@ export default {
       })
     },
     get_select_list() {
-      let roles = JSON.parse(sessionStorage.getItem('roles'))
+      const roles = JSON.parse(sessionStorage.getItem('roles'))
       let is_manage = false
-      for(let i=0;i<roles.length;i++){
-        if(roles[i].id == 11 || roles[i].id == 31){
+      for (let i = 0; i < roles.length; i++) {
+        if (roles[i].id == 11 || roles[i].id == 31) {
           is_manage = true
         }
       }
-      if(is_manage == true){
+      if (is_manage == true) {
         this.requestParams[2].parammaps.id = '18'
-      }else{
+      } else {
         this.requestParams[2].parammaps.id = Cookies.get('pastureid')
       }
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProviderByCt.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.findAllCategory = response.data.findAllCategory.list
@@ -959,9 +959,9 @@ export default {
         this.getdataListParm.parammaps.pastureName = this.$route.query.pastureName
       }
       GetDataByName(this.getdataListParm).then(response => {
-		if(response.data.list !== null){
-			console.log('table数据', response.data.list)
-			for (let i = 0; i < response.data.list.length; i++) {
+        if (response.data.list !== null) {
+          console.log('table数据', response.data.list)
+          for (let i = 0; i < response.data.list.length; i++) {
 			  if (response.data.list[i].price !== undefined) {
 			    this.$set(response.data.list[i], 'price', parseFloat(response.data.list[i].price))
 			  }
@@ -974,15 +974,15 @@ export default {
 			  if (response.data.list[i].minRepertory !== undefined) {
 			    this.$set(response.data.list[i], 'minRepertory', parseFloat(response.data.list[i].minRepertory))
 			  }
-			}
-			this.list = response.data.list
-			this.pageNum = response.data.pageNum
-			this.pageSize = response.data.pageSize
-		}else{
-			this.list = []
-			this.pageNum = 0
-			this.pageSize = 0
-		}
+          }
+          this.list = response.data.list
+          this.pageNum = response.data.pageNum
+          this.pageSize = response.data.pageSize
+        } else {
+          this.list = []
+          this.pageNum = 0
+          this.pageSize = 0
+        }
         this.total = response.data.total
         setTimeout(() => {
           this.listLoading = false
@@ -1171,11 +1171,11 @@ export default {
           import('@/vendor/Export2Excel').then(excel => {
             console.log(response.data.list)
 
-            response.data.list.forEach(function(item,index){
-              if(item.isZeroStock == 0){
-                item.isZeroStock = "否"
+            response.data.list.forEach(function(item, index) {
+              if (item.isZeroStock == 0) {
+                item.isZeroStock = '否'
               } else {
-                item.isZeroStock = "是"
+                item.isZeroStock = '是'
               }
             })
             const list1 = response.data.list
@@ -1190,9 +1190,9 @@ export default {
             }
             // const list1 = this.downList
             const tHeader = [
-              '牧场', '备件名称', '备件编号', '规格', '供应商', '单位', '品牌', '单价', '当前库存', '在库天数','闲置备件','最小库存', '最大库存', '位置', '合同状态', '零库存']
+              '牧场', '备件名称', '备件编号', '规格', '供应商', '单位', '品牌', '单价', '当前库存', '在库天数', '闲置备件', '最小库存', '最大库存', '位置', '合同状态', '零库存']
             const filterVal = [
-              'pastureName', 'partName', 'partCode', 'specification', 'providerName', 'unit', 'brand', 'price', 'reportery', 'daysInStorage','xzparts','minRepertory', 'maxRepertory', 'location', 'statue', 'isZeroStock']
+              'pastureName', 'partName', 'partCode', 'specification', 'providerName', 'unit', 'brand', 'price', 'reportery', 'daysInStorage', 'xzparts', 'minRepertory', 'maxRepertory', 'location', 'statue', 'isZeroStock']
             const data1 = this.formatJsonTemp(filterVal, list1)
 
             excel.export_json_to_excel({

+ 4 - 3
src/views/custom/inventory/index.vue

@@ -447,7 +447,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       // 新增
       isCustomAdd: [],
       // 导入
@@ -608,7 +608,8 @@ export default {
           pagecount: 0,
           params: ['资产状态']
         },
-        { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] }
+        { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
 
       temp: {
@@ -819,7 +820,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list//  response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.findAllProvider = response.data.findAllProvider.list

+ 3 - 2
src/views/custom/outRecord/index.vue

@@ -370,7 +370,8 @@ export default {
         { name: 'getDictByName', offset: 0, pagecount: 0, params: ['耗用类别-父'] },
         { name: 'getDictByName1', offset: 0, pagecount: 0, params: ['耗用类别-子'] },
         { name: 'getDictByName2', offset: 0, pagecount: 0, params: ['审核状态'] },
-        { name: 'getDictByName3', offset: 0, pagecount: 0, params: ['旧品回收状态'] }
+        { name: 'getDictByName3', offset: 0, pagecount: 0, params: ['旧品回收状态'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       stockAAA: {
         stockA: '',
@@ -480,7 +481,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture =response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list

+ 113 - 143
src/views/custom/outStock/index.vue

@@ -7,7 +7,7 @@
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <el-tab-pane label="备件出库" name="first">
         <!-- <div class="el-icon-info" style="font-size: 30px;float: right;color: #009C69;" @click="handleDescription" /> -->
-        <div class="el-icon-info" style="font-size: 30px;float: right;color: #409EFF;" @click="handleDescription"/>
+        <div class="el-icon-info" style="font-size: 30px;float: right;color: #409EFF;" @click="handleDescription" />
         <div class="filter-container">
           <el-select v-model="getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="changePastureName">
             <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
@@ -49,7 +49,7 @@
             <!-- <el-button class="filter-item" style="margin-left: 10px;" type="danger" icon="el-icon-upload2" @click="handleDownloadEas">导出EAS</el-button> -->
             <!-- <el-button class="filter-item" style="margin-left: 10px;" type="danger" icon="el-icon-upload2" @click="handleDownloadEas1">导出EAS</el-button> -->
             <!-- <el-button v-if="isEasSynchronization" class="filter-item" type="primary" style="float: right;" @click="handleEAS">EAS同步</el-button> -->
-            <el-button v-if="isOutsap"  class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
+            <el-button v-if="isOutsap" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
           </div>
         </div>
         <el-table
@@ -64,12 +64,12 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"
+          :max-height="myHeight"
           @sort-change="tableSort"
           @selection-change="change_table_selection"
           @current-change="handleCurrentChange"
-          :max-height="myHeight"
         >
-        <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
+          <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
           <el-table-column label="序号" align="center" type="index" width="50px">
             <template slot-scope="scope">
               <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
@@ -107,25 +107,25 @@
               <span>{{ scope.row.easStatus }}</span><br>
             </template>
           </el-table-column> -->
-          <el-table-column  prop="ProofCode" label="sap编码" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span>{{scope.row.ProofCode}}</span>
-              </template>
-            </el-table-column>
-          <el-table-column   prop="ProofCode" label="sap上传状态" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.ProofCode">已上传</span>
-                <span v-else>未上传</span>
-
-              </template>
-            </el-table-column>
-            <el-table-column   prop="sterilisation" label="冲销状态" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.sterilisation == 1">已冲销</span>
-                <span v-else-if="scope.row.sterilisation == 2">部分冲销</span>
-                <span v-else>未冲销</span>
-              </template>
-            </el-table-column>
+          <el-table-column prop="ProofCode" label="sap编码" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.ProofCode }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="ProofCode" label="sap上传状态" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span v-if="scope.row.ProofCode">已上传</span>
+              <span v-else>未上传</span>
+
+            </template>
+          </el-table-column>
+          <el-table-column prop="sterilisation" label="冲销状态" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span v-if="scope.row.sterilisation == 1">已冲销</span>
+              <span v-else-if="scope.row.sterilisation == 2">部分冲销</span>
+              <span v-else>未冲销</span>
+            </template>
+          </el-table-column>
 
           <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
             <template slot-scope="{row}">
@@ -184,8 +184,8 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"
-          @sort-change="tableSort"
           :max-height="myHeight"
+          @sort-change="tableSort"
         >
           <el-table-column label="序号" align="center" type="index" width="50px">
             <template slot-scope="scope">
@@ -298,7 +298,7 @@
       </el-tab-pane>
     </el-tabs>
     <!-- 弹出层新增or修改 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" v-if ="dialogFormVisible" :close-on-click-modal="false" width="90%">
+    <el-dialog v-if="dialogFormVisible" :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
       <div class="app-add">
         <el-form
           ref="createTemp"
@@ -794,7 +794,7 @@
                 </el-radio-group>
               </el-form-item>
             </el-col>
-           <!-- <el-col :span="8" v-if="seeTemp.useType == 6">
+            <!-- <el-col :span="8" v-if="seeTemp.useType == 6">
               <el-form-item v-if="oddCodeAllo" label="青贮单号:" prop="greenFodderNumber">
                 <el-input ref="oddCode" v-model="seeTemp.greenFodderNumber" disabled />
               </el-form-item>
@@ -955,20 +955,18 @@
             </template>
           </el-table-column>
 
-
           <el-table-column :key="19" label="备注" prop="sumPrice" align="center" min-width="80">
             <template slot-scope="scope">
               <span>{{ scope.row.note }}</span>
             </template>
           </el-table-column>
 
-          <el-table-column    prop="dflag" label="冲销状态" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.dflag == 1">已冲销</span>
-                <span v-else>未冲销</span>
-              </template>
-            </el-table-column>
-
+          <el-table-column prop="dflag" label="冲销状态" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span v-if="scope.row.dflag == 1">已冲销</span>
+              <span v-else>未冲销</span>
+            </template>
+          </el-table-column>
 
         </el-table>
         <!-- <pagination
@@ -1026,8 +1024,8 @@
     </el-dialog>
 
     <el-dialog :title="textMap[description.dialogStatus]" :destroy-on-close="true" :visible.sync="description.dialogFormVisible" :close-on-click-modal="false" width="70%">
-        <b style="line-height: 28px;">常见问题1:出库保存报错</b>
-        <br>
+      <b style="line-height: 28px;">常见问题1:出库保存报错</b>
+      <br>
       <div class="app-description dialogMinHeight">
         <div class="content">
           报错原因1: 请求超时
@@ -1047,7 +1045,7 @@
 
 <script>
 // 引入
-import { GetDataByName, GetDataByNames, ExecDataByConfig, checkButtons, GetAccount, transData, PostDataByName, EasSync,SapUse  } from '@/api/common'
+import { GetDataByName, GetDataByNames, ExecDataByConfig, checkButtons, GetAccount, transData, PostDataByName, EasSync, SapUse } from '@/api/common'
 import waves from '@/directive/waves' // waves directive
 import { parseTime, sortChange } from '@/utils/index.js'
 // eslint-disable-next-line no-unused-vars
@@ -1069,16 +1067,15 @@ export default {
   },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 250,
-      isSap:1,
-      isSrm:1,
+      myHeight: document.documentElement.clientHeight - 85 - 250,
+      isSap: 1,
+      isSrm: 1,
       selectList: [],
-      currentRow:{},
+      currentRow: {},
       totalImportInfo: 0,
       listLoadingImportInfo: true,
       listImportInfo: [],
 
-
       isOutsap: [],
       // isReceiveImport: [],
       // isRetreatMuban: [],
@@ -1137,7 +1134,7 @@ export default {
       dialogPvVisible: false,
       // 校验规则
       // -----------------------------------------
-      isOutStockAdd: [], isReceiveTemplate: [], isOutStockImport: [], isOutStockExport: [], isOutStockSee: [], isOutStockDelete: [], isOutStockMethod1: [], isOutStockMethod2: [], isOutStockMethod3: [],isOutStockMethod4:[],isOutStockMethod5:[],
+      isOutStockAdd: [], isReceiveTemplate: [], isOutStockImport: [], isOutStockExport: [], isOutStockSee: [], isOutStockDelete: [], isOutStockMethod1: [], isOutStockMethod2: [], isOutStockMethod3: [], isOutStockMethod4: [], isOutStockMethod5: [],
       isEasSynchronization: [], isManualSynchronization: [], isCloseSynchronization: [], isIgnoreSynchronization: [],
       rules: {},
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
@@ -1155,7 +1152,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['耗用类别-父'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['耗用类别-父'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -1204,7 +1202,7 @@ export default {
           useForm: '',
           useType: '',
           easStatus: '',
-          sapStatus:''
+          sapStatus: ''
         }
       },
       list: [],
@@ -1261,8 +1259,8 @@ export default {
         receiveTime: parseTime(new Date(), '{y}-{m}-{d}'),
         applicatId: Cookies.get('employeid'),
         departmentId: Cookies.get('departmentid'),
-        greenFodderNumber:'',
-        note:''
+        greenFodderNumber: '',
+        note: ''
       },
       requestSparePart: {
         name: 'getPartsListCK',
@@ -1338,7 +1336,7 @@ export default {
       // EAS同步
       easStatus: {
         easStatusList: [{ name: '同步成功', id: '1' }, { name: '同步失败', id: '0' }, { name: '关闭同步', id: '2' }],
-        sapStatusList: [ { name: '所有', id: '0' }, { name: '已上传', id: '1' }, { name: '未上传', id: '2' }],
+        sapStatusList: [{ name: '所有', id: '0' }, { name: '已上传', id: '1' }, { name: '未上传', id: '2' }],
         dialogStatus: '',
         dialogFormVisible: false,
         tableKey: 0,
@@ -1359,7 +1357,7 @@ export default {
       description: {
         dialogFormVisible: false,
         dialogStatus: ''
-      },
+      }
     }
   },
   computed: {
@@ -1396,21 +1394,17 @@ export default {
 
     listAdd: {
       deep: true,
-      handler: function (item) {
-
-          this.listAdd.forEach(function(i){
-            if(parseInt(i.checkoutNumber) > parseInt(i.amount)){
-              i.checkoutNumber = i.amount
-            }
-            if(parseInt(i.checkoutNumber) > parseInt(i.reportery)){
-              i.checkoutNumber = i.reportery
-            }
-
-          })
-
-
+      handler: function(item) {
+        this.listAdd.forEach(function(i) {
+          if (parseInt(i.checkoutNumber) > parseInt(i.amount)) {
+            i.checkoutNumber = i.amount
+          }
+          if (parseInt(i.checkoutNumber) > parseInt(i.reportery)) {
+            i.checkoutNumber = i.reportery
+          }
+        })
       }
-    },
+    }
 
   },
   created() {
@@ -1437,71 +1431,59 @@ export default {
     },
 
     handleCurrentChange(val) {
-        this.currentRow = val;
-        console.log("currentRow",this.currentRow)
+      this.currentRow = val
+      console.log('currentRow', this.currentRow)
     },
 
-    checkboxInit(row,index){
+    checkboxInit(row, index) {
       // console.log(row)
-      if(row.ProofCode){
+      if (row.ProofCode) {
         return 0
       } else {
-
         var data1 = new Date(row.creatTime)
         var data2 = new Date('2022-10-25')
-        if(data1 > data2){ return 1 } else {return 0}
-
+        if (data1 > data2) { return 1 } else { return 0 }
       }
     },
 
-    //监听 - 表格 - 勾选
+    // 监听 - 表格 - 勾选
     change_table_selection(val) {
       this.selectList = val
       console.log('勾选数据selectList', this.selectList)
     },
 
-    sapUpload(){
+    sapUpload() {
       const that = this
-      console.log("currentRow ProofCode",this.currentRow.ProofCode)
+      console.log('currentRow ProofCode', this.currentRow.ProofCode)
       var send_data = this.selectList
 
-      if(send_data.length == 0){
-        that.$notify({ title: '失败', message: '请勾选数据!'  , type: 'error', duration: 2000 })
+      if (send_data.length == 0) {
+        that.$notify({ title: '失败', message: '请勾选数据!', type: 'error', duration: 2000 })
         return false
       }
 
-
       console.log(that.isSap)
 
-      if(that.isSap == 1){
-
-         that.isSap = 0
-         SapUse(send_data).then(response => {
-              console.log('response', response)
-
-              if (response.msg !== 'fail') {
-                that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
-                that.selectList = []
-                that.get_table_data()
-
-                } else {
-                  that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
-                }
-            })
-
+      if (that.isSap == 1) {
+        that.isSap = 0
+        SapUse(send_data).then(response => {
+          console.log('response', response)
 
+          if (response.msg !== 'fail') {
+            that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
+            that.selectList = []
+            that.get_table_data()
+          } else {
+            that.$notify({ title: '失败', message: '上传失败', type: 'error', duration: 2000 })
+          }
+        })
       } else {
-
-        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击'  , type: 'error', duration: 2000 })
+        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击', type: 'error', duration: 2000 })
       }
 
       setTimeout(() => {
-              that.isSap = 1
-            }, 3000)
-
-
-
-
+        that.isSap = 1
+      }, 3000)
 
       // if(this.currentRow.ProofCode){
       //    console.log("currentRow ProofCode 这个值说明已经上传了,不用上传")
@@ -1531,12 +1513,9 @@ export default {
       //       })
 
       // }
-
     },
 
-
     get_auto_buttons() {
-
       const Outsap = 'customs:outStock:sap'
       const isOutsap = checkButtons(this.$store.state.user.buttons, OutStockAdd)
       this.isOutsap = isOutsap
@@ -1633,7 +1612,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture =response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list
         this.getDepartDownList()
@@ -1911,7 +1890,7 @@ export default {
         // 调拨数量/出库数量显示
         this.allo = true
         this.No4 = false
-      }else if(val === 5){
+      } else if (val === 5) {
         // 报废出库
         this.No1 = false
         this.No2 = true
@@ -1924,7 +1903,7 @@ export default {
         this.No4 = true
         // 调拨数量/出库数量
         this.allo = false
-      }else if(val === 6){
+      } else if (val === 6) {
         // 报废出库
         this.No1 = false
         this.No2 = true
@@ -1953,9 +1932,8 @@ export default {
       this.getParmCreateAdd.parammaps.id = item.id
       this.getParmCreateAdd.parammaps.pastureId = Cookies.get('pastureid')
 
-
       // this.createTemp.departmentId = item.departmentId
-      this.$set(this.createTemp, "departmentId", item.departmentId)
+      this.$set(this.createTemp, 'departmentId', item.departmentId)
 
       this.createTemp.bid = item.id
       this.createTemp.applicatId = item.empId
@@ -2301,13 +2279,13 @@ export default {
             note: this.createTemp.note
           }}
 
-          if(this.createTemp.oddCode == ""){
+          if (this.createTemp.oddCode == '') {
             this.$notify({
-                title: '保存失败',
-                message: '领用单号不得为空',
-                type: 'warning',
-                duration: 2000
-              })
+              title: '保存失败',
+              message: '领用单号不得为空',
+              type: 'warning',
+              duration: 2000
+            })
             return false
           }
           this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
@@ -2499,13 +2477,13 @@ export default {
             note: this.createTemp.note
           }}
 
-          if(this.createTemp.oddCode == ""){
+          if (this.createTemp.oddCode == '') {
             this.$notify({
-                title: '保存失败',
-                message: '领用单号不得为空',
-                type: 'warning',
-                duration: 2000
-              })
+              title: '保存失败',
+              message: '领用单号不得为空',
+              type: 'warning',
+              duration: 2000
+            })
             return false
           }
           this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
@@ -2561,8 +2539,8 @@ export default {
             }
           })
           return true
-        }else if(this.createTemp.useType === 5){
-          console.log('baofei',this.createTemp.oddCode)
+        } else if (this.createTemp.useType === 5) {
+          console.log('baofei', this.createTemp.oddCode)
           // 报废出库
           this.postDataPramas.common = { 'returnmap': '0' }
           this.postDataPramas.data = []
@@ -2610,13 +2588,13 @@ export default {
             note: this.createTemp.note
           }}
 
-          if(this.createTemp.oddCode == ""){
+          if (this.createTemp.oddCode == '') {
             this.$notify({
-                title: '保存失败',
-                message: '领用单号不得为空',
-                type: 'warning',
-                duration: 2000
-              })
+              title: '保存失败',
+              message: '领用单号不得为空',
+              type: 'warning',
+              duration: 2000
+            })
             return false
           }
 
@@ -2672,7 +2650,7 @@ export default {
             }
           })
           return true
-        }else if(this.createTemp.useType === 6){
+        } else if (this.createTemp.useType === 6) {
           // 青贮出库
           this.postDataPramas.common = { 'returnmap': '0' }
           this.postDataPramas.data = []
@@ -2718,7 +2696,7 @@ export default {
             receiveTime: this.createTemp.receiveTime,
             empId: this.createTemp.empId,
             note: this.createTemp.note,
-            greenFodderNumber:this.createTemp.greenFodderNumber
+            greenFodderNumber: this.createTemp.greenFodderNumber
           }}
 
           // if(this.createTemp.oddCode == ""){
@@ -2890,21 +2868,16 @@ export default {
       GetAccount(this.requestParam).then(response => {
         this.$nextTick(() => {
           import('@/vendor/Export2Excel').then(excel => {
-
-
             if (response.data.list !== null) {
               for (let i = 0; i < response.data.list.length; i++) {
-
-                if(response.data.list[i].sterilisation == 1){
-                  this.$set(response.data.list[i], 'sterilisation', "已冲销")
+                if (response.data.list[i].sterilisation == 1) {
+                  this.$set(response.data.list[i], 'sterilisation', '已冲销')
                 } else {
-                  this.$set(response.data.list[i], 'sterilisation', "未冲销")
+                  this.$set(response.data.list[i], 'sterilisation', '未冲销')
                 }
               }
             }
 
-
-
             const list1 = response.data.list
             if (response.data.list !== '') {
               this.percentage = 99
@@ -2913,13 +2886,10 @@ export default {
               }, 2000)
             }
 
-
-
-
             const tHeader = [
-              '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号','资产品牌', '费用类型', '领用部门', '领用人', '备注', '冲销状态']
+              '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '资产品牌', '费用类型', '领用部门', '领用人', '备注', '冲销状态']
             const filterVal = [
-              'pastureName', 'useForm', 'creatTime', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'checkoutNumber', 'price', 'sumPrice', 'warehoseCode', 'providerName', 'eqName', 'eqCode', 'eqBrand','useTypeV', 'departmentName', 'appliname', 'note', 'sterilisation'
+              'pastureName', 'useForm', 'creatTime', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'checkoutNumber', 'price', 'sumPrice', 'warehoseCode', 'providerName', 'eqName', 'eqCode', 'eqBrand', 'useTypeV', 'departmentName', 'appliname', 'note', 'sterilisation'
             ]
             const data1 = this.formatJson(filterVal, list1)
             excel.export_json_to_excel({ header: tHeader, data: data1, filename: this.requestParam.parammaps.formType, autoWidth: true, bookType: 'xlsx' })

+ 9 - 8
src/views/custom/outStock/index1.vue

@@ -58,8 +58,8 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"
-          @sort-change="tableSort"
           :max-height="myHeight"
+          @sort-change="tableSort"
         >
           <el-table-column label="序号" align="center" type="index" width="50px">
             <template slot-scope="scope">
@@ -155,8 +155,8 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"
-          @sort-change="tableSort"
           :max-height="myHeight"
+          @sort-change="tableSort"
         >
           <el-table-column label="序号" align="center" type="index" width="50px">
             <template slot-scope="scope">
@@ -989,7 +989,7 @@ export default {
   },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 250,
+      myHeight: document.documentElement.clientHeight - 85 - 250,
       totalImportInfo: 0,
       listLoadingImportInfo: true,
       listImportInfo: [],
@@ -1050,7 +1050,7 @@ export default {
       dialogPvVisible: false,
       // 校验规则
       // -----------------------------------------
-      isOutStockAdd: [], isReceiveTemplate: [], isOutStockImport: [], isOutStockExport: [], isOutStockSee: [], isOutStockDelete: [], isOutStockMethod1: [], isOutStockMethod2: [], isOutStockMethod3: [],isOutStockMethod4:[],
+      isOutStockAdd: [], isReceiveTemplate: [], isOutStockImport: [], isOutStockExport: [], isOutStockSee: [], isOutStockDelete: [], isOutStockMethod1: [], isOutStockMethod2: [], isOutStockMethod3: [], isOutStockMethod4: [],
       isEasSynchronization: [], isManualSynchronization: [], isCloseSynchronization: [], isIgnoreSynchronization: [],
       rules: {},
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
@@ -1068,7 +1068,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['耗用类别-父'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['耗用类别-父'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -1406,7 +1407,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list
         this.getDepartDownList()
@@ -1680,7 +1681,7 @@ export default {
         // 调拨数量/出库数量显示
         this.allo = true
         this.No4 = false
-      }else if(val === 5){
+      } else if (val === 5) {
         // 报废出库
         this.No1 = false
         this.No2 = true
@@ -2293,7 +2294,7 @@ export default {
             }
           })
           return true
-        }else if(this.createTemp.useType === 5){
+        } else if (this.createTemp.useType === 5) {
           // 报废出库
           this.postDataPramas.common = { 'returnmap': '0' }
           this.postDataPramas.data = []

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 659 - 661
src/views/custom/purchase/index.vue


+ 44 - 44
src/views/custom/purchase/index1.vue

@@ -236,8 +236,8 @@
             <el-date-picker ref="inputDatetime4" v-model="getdataListParm4.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
             <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search4">搜索</el-button>
 
-            
-            
+
+
           </div>
           <el-table
             :key="tableKey4"
@@ -250,12 +250,12 @@
             style="width: 100%;"
             :row-style="rowStyle"
             :cell-style="cellStyle"
-            class="elTable table-fixed" 
+            class="elTable table-fixed"
             @sort-change="tableSort"
             @current-change="handleCurrentChange"
             :max-height="myHeight"
           >
-         
+
             <el-table-column label="序号" align="center" type="index" width="50px">
               <template slot-scope="scope">
                 <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
@@ -283,7 +283,7 @@
               </template>
             </el-table-column>
             <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
-           
+
             <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
               <template slot-scope="{row}">
                 <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see4(row)">查看</el-button>
@@ -329,7 +329,7 @@
                 :cell-style="cellStyle"
                 class="elTable table-fixed"
               >
-             
+
                 <el-table-column label="序号" align="center" type="index" width="50px" />
                 <el-table-column label="采购单号" min-width="110px" align="center">
                   <template slot-scope="scope">
@@ -1262,10 +1262,10 @@ export default {
     // }
 
 
-   
 
 
-      
+
+
   },
 
   methods: {
@@ -1364,7 +1364,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllEmploye = response.data.findAllEmploye.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture =response.data.getPastureRoleList.list // response.data.findAllPasture.list
       })
     },
     providerSearch(queryString, cb) {
@@ -1587,11 +1587,11 @@ export default {
       var departmentNameMap = {}
 
 
-      
 
 
 
-  
+
+
 
       // // eslint-disable-next-line no-redeclare
       // for (var i = 0; i < this.list1.length; i++) {
@@ -1949,7 +1949,7 @@ export default {
     sapUpload(){
 
 
-      const that = this 
+      const that = this
       console.log("currentRow",this.currentRow.sapstatus)
 
      var send_data = this.selectList
@@ -1967,19 +1967,19 @@ export default {
          that.isSap = 0
          SapOrder(send_data).then(response => {
               console.log('response', response)
-                
+
                if (response.msg !== 'fail') {
                 that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
                 that.selectList = []
                 that.get_table_data2()
-                 
+
                 } else {
                   that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
                 }
-               
+
             })
- 
-            
+
+
       } else {
 
         that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击'  , type: 'error', duration: 2000 })
@@ -1991,37 +1991,37 @@ export default {
 
 
 
-           
-    
-  
+
+
+
       // if(this.currentRow.sapstatus){
-   
+
       //   if(this.currentRow.sapstatus != 0){
       //     const sapArr = this.currentRow.sapbuyeCode.split(",")
       //     console.log("sapArr",sapArr)
       //     sapArr.forEach(function(item){
       //       console.log("sapArr item",item)
       //       var send_data = {
-         
+
       //             "code":item,
       //             "pastureid":Cookies.get('pastureid')
-              
+
       //       }
 
       //       SapOrder(send_data).then(response => {
       //         console.log('response', response)
-                
+
       //          if (response.msg !== 'fail') {
       //           that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
       //           that.get_table_data()
-                 
+
       //           } else {
       //             that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
       //           }
-               
+
       //       })
-        
-        
+
+
 
 
       //     })
@@ -2046,9 +2046,9 @@ export default {
 
     srmUpload(){
 
-      const that = this 
+      const that = this
       console.log("currentRow",this.currentRow.srmstatus)
-    
+
       console.log('勾选数据selectList', this.selectList)
 
       var send_data = this.selectList
@@ -2067,21 +2067,21 @@ export default {
          that.isSrm = 0
          SrmOrder(send_data).then(response => {
               console.log('response', response)
-                
+
                if (response.msg !== 'fail') {
                 that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
                 that.selectList = []
                 that.get_table_data2()
-                
-                 
+
+
                 } else {
                   that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
                 }
-               
+
             })
 
- 
-            
+
+
       } else {
 
         that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击'  , type: 'error', duration: 2000 })
@@ -2094,7 +2094,7 @@ export default {
 
 
 
-   
+
       // if(this.currentRow.srmstatus){
       //   if(this.currentRow.srmstatus != 0){
       //     const srmArr = this.currentRow.srmbuyeCode.split(",")
@@ -2102,24 +2102,24 @@ export default {
       //     srmArr.forEach(function(item){
       //       console.log("srmArr item",item)
       //       var send_data = {
-         
+
       //             "code":item,
       //             "pastureid":Cookies.get('pastureid')
       //       }
       //       SrmOrder(send_data).then(response => {
       //         console.log('response', response)
-                
+
       //          if (response.msg !== 'fail') {
       //           that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
       //           that.get_table_data()
-                 
+
       //           } else {
       //             that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
       //           }
-               
+
       //       })
-        
-        
+
+
 
 
       //     })
@@ -2129,7 +2129,7 @@ export default {
 
 
     },
-    
+
 
     closeData() {
       this.isokDisable = true

+ 94 - 142
src/views/custom/purchase/index2.vue

@@ -9,10 +9,10 @@
         <div class="purchaseDistributionSheet">
 
           <div class="filter-container">
-            <el-select v-model="getdataListParm1.parammaps.departmentId" style="width: 140px;" placeholder="部门" class="filter-item" @change = "change_dept">
+            <el-select v-model="getdataListParm1.parammaps.departmentId" style="width: 140px;" placeholder="部门" class="filter-item" @change="change_dept">
               <el-option v-for="item in deptNameList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
-            
+
           </div>
 
           <el-table
@@ -27,9 +27,9 @@
             highlight-current-row
             style="width: 100%;"
             class="elTable table-fixed"
+            :max-height="myHeight"
             @cell-click="cellClick"
             @sort-change="tableSort"
-            :max-height="myHeight"
           >
             <el-table-column label="序号" align="center" type="index" width="50px">
               <template slot-scope="scope">
@@ -244,8 +244,6 @@
             <el-date-picker ref="inputDatetime4" v-model="getdataListParm4.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
             <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search4">搜索</el-button>
 
-            
-            
           </div>
           <el-table
             :key="tableKey4"
@@ -258,12 +256,12 @@
             style="width: 100%;"
             :row-style="rowStyle"
             :cell-style="cellStyle"
-            class="elTable table-fixed" 
+            class="elTable table-fixed"
+            :max-height="myHeight"
             @sort-change="tableSort"
             @current-change="handleCurrentChange"
-            :max-height="myHeight"
           >
-         
+
             <el-table-column label="序号" align="center" type="index" width="50px">
               <template slot-scope="scope">
                 <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
@@ -291,7 +289,7 @@
               </template>
             </el-table-column>
             <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
-           
+
             <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
               <template slot-scope="{row}">
                 <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see4(row)">查看</el-button>
@@ -338,7 +336,7 @@
                 class="elTable table-fixed"
                 :max-height="myHeight"
               >
-             
+
                 <el-table-column label="序号" align="center" type="index" width="50px" />
                 <el-table-column label="采购单号" min-width="110px" align="center">
                   <template slot-scope="scope">
@@ -604,8 +602,8 @@
             <el-autocomplete v-model="getdataListParm2.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
             <el-date-picker ref="inputDatetime2" v-model="getdataListParm2.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
             <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
-            <el-button v-waves v-if="isPurchaseSap" class="filter-item" type="primary" @click="sapUpload">SAP上传</el-button>
-            <el-button v-waves  v-if="isPurchaseSrm" class="filter-item" type="primary" @click="srmUpload">SRM上传</el-button>
+            <el-button v-if="isPurchaseSap" v-waves class="filter-item" type="primary" @click="sapUpload">SAP上传</el-button>
+            <el-button v-if="isPurchaseSrm" v-waves class="filter-item" type="primary" @click="srmUpload">SRM上传</el-button>
           </div>
           <el-table
             :key="tableKey2"
@@ -619,11 +617,11 @@
             :row-style="rowStyle"
             :cell-style="cellStyle"
             class="elTable table-fixed"
+            :max-height="myHeight"
             @sort-change="tableSort"
             @selection-change="change_table_selection"
-            :max-height="myHeight"
           >
-          <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
+            <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
             <el-table-column label="序号" align="center" type="index" width="50px">
               <template slot-scope="scope">
                 <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
@@ -652,20 +650,26 @@
             <el-table-column label="提交日期" sortable prop="buyerDate" min-width="110px" align="center" />
             <el-table-column label="最近到货日期" sortable prop="DoneDate" min-width="110px" align="center" />
             <el-table-column label="单据状态" min-width="80px" align="center" :formatter="statu" />
-            <el-table-column  prop="sapNumber" label="sap编码" min-width="80px" align="center">
+            <el-table-column prop="sapNumber" label="sap编码" min-width="80px" align="center">
               <template slot-scope="scope">
-                <span>{{scope.row.sapNumber}}</span>
+                <span>{{ scope.row.sapNumber }}</span>
               </template>
             </el-table-column>
-            <el-table-column   prop
-            <el-table-column   prop="sapstatus" label="sap上传状态" min-width="80px" align="center">
+            <el-table-column
+              prop
+              <el-table-column
+              prop="sapstatus"
+              label="sap上传状态"
+              min-width="80px"
+              align="center"
+            >
               <template slot-scope="scope">
                 <span v-show="scope.row.sapstatus == 1">上传失败</span>
                 <span v-show="scope.row.sapstatus == -1">未上传</span>
                 <span v-show="scope.row.sapstatus == 0">上传成功</span>
               </template>
             </el-table-column>
-            <el-table-column   prop="srmstatus" label="srm上传状态" min-width="80px" align="center">
+            <el-table-column prop="srmstatus" label="srm上传状态" min-width="80px" align="center">
               <template slot-scope="scope">
                 <span v-show="scope.row.srmstatus == 1">上传失败</span>
                 <span v-show="scope.row.srmstatus == -1">未上传</span>
@@ -877,8 +881,8 @@
             :row-style="rowStyle"
             :cell-style="cellStyle"
             class="elTable table-fixed"
-            @sort-change="tableSort"
             :max-height="myHeight"
+            @sort-change="tableSort"
           >
             <el-table-column label="序号" align="center" type="index" width="50px">
               <template slot-scope="scope">
@@ -976,7 +980,7 @@
 
 <script>
 // 引入
-import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, failproccess, checkButtons, GetAccount,SapOrder,SrmOrder } from '@/api/common'
+import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, failproccess, checkButtons, GetAccount, SapOrder, SrmOrder } from '@/api/common'
 import waves from '@/directive/waves' // waves directive
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination
 import Cookies from 'js-cookie'
@@ -997,12 +1001,12 @@ export default {
   },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 150,
-      isSap:1,
-      isSrm:1,
+      myHeight: document.documentElement.clientHeight - 85 - 150,
+      isSap: 1,
+      isSrm: 1,
       selectList: [],
 
-      isPurchaseSap: [],isPurchaseSrm: [],
+      isPurchaseSap: [], isPurchaseSrm: [],
       isPurchaseSee: [], isPurchaseClose: [], isPurchaseExport: [], isDistributionSheet: [], isDistributionManagement: [], isExamineDM: [],
       stripe: true,
       activeName: 'first',
@@ -1084,7 +1088,7 @@ export default {
         returntype: 'Map',
         parammaps: {
           pastureId: Cookies.get('pastureid'),
-          departmentId:0,
+          departmentId: 0
         }
       },
       getdataListPart: {
@@ -1095,7 +1099,7 @@ export default {
         returntype: 'Map',
         parammaps: {
           id: Cookies.get('pastureid'),
-          departmentId:0,
+          departmentId: 0
         }
       },
       partData: [],
@@ -1213,7 +1217,7 @@ export default {
 
       active: 3,
 
-      currentRow:{},
+      currentRow: {},
 
       dialogStatusUpdate4: '',
       dialogFormVisibleUpdate4: false,
@@ -1280,7 +1284,7 @@ export default {
 
   methods: {
 
-    change_dept(e){
+    change_dept(e) {
       console.log(e)
       this.getdataListParm1.parammaps.departmentId = e
       this.getdataListPart.parammaps.departmentId = e
@@ -1381,8 +1385,8 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllEmploye = response.data.findAllEmploye.list
-        this.findAllPasture = response.data.findAllPasture.list
-        this.deptNameList =  response.data.getDepartmentNY.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
+        this.deptNameList = response.data.getDepartmentNY.list
         console.log(this.deptNameList)
       })
     },
@@ -1519,7 +1523,7 @@ export default {
         var groups1 = {}
         array.forEach(function(o) {
           var group2 = JSON.stringify(f(o))
-          console.log("group2",group2)
+          console.log('group2', group2)
           groups1[group2] = groups1[group2] || []
           groups1[group2].push(o)
         })
@@ -1532,10 +1536,6 @@ export default {
       })
       console.log('表格数据根据供应商分划', sorted1)
 
-
-
-
-
       for (var i = 0; i < sorted1.length; i++) {
         var b = 0
         var c = 0
@@ -1603,9 +1603,6 @@ export default {
       var providerNameMap = {}
       var providerNameDest = []
 
-
-  
-
       // eslint-disable-next-line no-redeclare
       for (var i = 0; i < this.list1.length; i++) {
         console.log(this.list1[i])
@@ -1684,10 +1681,6 @@ export default {
       // console.log(JSON.stringify(this.listConfirmationSheet))
       console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
 
-
-
-
-
       var SumArray = []
 
       this.listConfirmationSheet.forEach((item, index) => {
@@ -1950,159 +1943,125 @@ export default {
     },
 
     handleCurrentChange(val) {
-        this.currentRow = val;
-        console.log("currentRow",this.currentRow)
-  },
-
-    sapUpload(){
-
+      this.currentRow = val
+      console.log('currentRow', this.currentRow)
+    },
 
-      const that = this 
-      console.log("currentRow",this.currentRow.sapstatus)
+    sapUpload() {
+      const that = this
+      console.log('currentRow', this.currentRow.sapstatus)
 
-     var send_data = this.selectList
+      var send_data = this.selectList
 
-     if(send_data.length == 0){
-        that.$notify({ title: '失败', message: '请勾选数据!'  , type: 'error', duration: 2000 })
+      if (send_data.length == 0) {
+        that.$notify({ title: '失败', message: '请勾选数据!', type: 'error', duration: 2000 })
         return false
       }
 
-
       console.log(that.isSap)
 
-      if(that.isSap == 1){
-
-         that.isSap = 0
-         SapOrder(send_data).then(response => {
-              console.log('response', response)
-                
-               if (response.msg !== 'fail') {
-                that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
-                that.selectList = []
-                that.get_table_data2()
-                 
-                } else {
-                  that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
-                }
-               
-            })
- 
-            
-      } else {
+      if (that.isSap == 1) {
+        that.isSap = 0
+        SapOrder(send_data).then(response => {
+          console.log('response', response)
 
-        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击'  , type: 'error', duration: 2000 })
+          if (response.msg !== 'fail') {
+            that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
+            that.selectList = []
+            that.get_table_data2()
+          } else {
+            that.$notify({ title: '失败', message: '上传失败', type: 'error', duration: 2000 })
+          }
+        })
+      } else {
+        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击', type: 'error', duration: 2000 })
       }
 
       setTimeout(() => {
-              that.isSap = 1
-            }, 3000)
-
-
+        that.isSap = 1
+      }, 3000)
 
-           
-    
-  
       // if(this.currentRow.sapstatus){
-   
+
       //   if(this.currentRow.sapstatus != 0){
       //     const sapArr = this.currentRow.sapbuyeCode.split(",")
       //     console.log("sapArr",sapArr)
       //     sapArr.forEach(function(item){
       //       console.log("sapArr item",item)
       //       var send_data = {
-         
+
       //             "code":item,
       //             "pastureid":Cookies.get('pastureid')
-              
+
       //       }
 
       //       SapOrder(send_data).then(response => {
       //         console.log('response', response)
-                
+
       //          if (response.msg !== 'fail') {
       //           that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
       //           that.get_table_data()
-                 
+
       //           } else {
       //             that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
       //           }
-               
-      //       })
-        
-        
 
+      //       })
 
       //     })
       //   }
       // }
-
     },
 
-
-    checkboxInit(row,index){
+    checkboxInit(row, index) {
       console.log(row)
       var data1 = new Date(row.buyerDate)
       var data2 = new Date('2022-10-25')
-      if(data1 > data2){ return 1 } else {return 0}
+      if (data1 > data2) { return 1 } else { return 0 }
     },
 
-    //监听 - 表格 - 勾选
+    // 监听 - 表格 - 勾选
     change_table_selection(val) {
       this.selectList = val
       console.log('勾选数据selectList', this.selectList)
     },
 
-    srmUpload(){
+    srmUpload() {
+      const that = this
+      console.log('currentRow', this.currentRow.srmstatus)
 
-      const that = this 
-      console.log("currentRow",this.currentRow.srmstatus)
-    
       console.log('勾选数据selectList', this.selectList)
 
       var send_data = this.selectList
 
-
-      if(send_data.length == 0){
-        that.$notify({ title: '失败', message: '请勾选数据!'  , type: 'error', duration: 2000 })
+      if (send_data.length == 0) {
+        that.$notify({ title: '失败', message: '请勾选数据!', type: 'error', duration: 2000 })
         return false
       }
 
-
       console.log(that.isSrm)
 
-      if(that.isSrm == 1){
-
-         that.isSrm = 0
-         SrmOrder(send_data).then(response => {
-              console.log('response', response)
-                
-               if (response.msg !== 'fail') {
-                that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
-                that.selectList = []
-                that.get_table_data2()
-                
-                 
-                } else {
-                  that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
-                }
-               
-            })
+      if (that.isSrm == 1) {
+        that.isSrm = 0
+        SrmOrder(send_data).then(response => {
+          console.log('response', response)
 
- 
-            
+          if (response.msg !== 'fail') {
+            that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
+            that.selectList = []
+            that.get_table_data2()
+          } else {
+            that.$notify({ title: '失败', message: '上传失败', type: 'error', duration: 2000 })
+          }
+        })
       } else {
-
-        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击'  , type: 'error', duration: 2000 })
+        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击', type: 'error', duration: 2000 })
       }
 
       setTimeout(() => {
-              that.isSrm = 1
-            }, 3000)
-
-
-
+        that.isSrm = 1
+      }, 3000)
 
-   
       // if(this.currentRow.srmstatus){
       //   if(this.currentRow.srmstatus != 0){
       //     const srmArr = this.currentRow.srmbuyeCode.split(",")
@@ -2110,34 +2069,27 @@ export default {
       //     srmArr.forEach(function(item){
       //       console.log("srmArr item",item)
       //       var send_data = {
-         
+
       //             "code":item,
       //             "pastureid":Cookies.get('pastureid')
       //       }
       //       SrmOrder(send_data).then(response => {
       //         console.log('response', response)
-                
+
       //          if (response.msg !== 'fail') {
       //           that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
       //           that.get_table_data()
-                 
+
       //           } else {
       //             that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
       //           }
-               
-      //       })
-        
-        
 
+      //       })
 
       //     })
       //   }
       // }
-
-
-
     },
-    
 
     closeData() {
       this.isokDisable = true

+ 12 - 26
src/views/custom/receive/index.vue

@@ -545,12 +545,13 @@ export default {
   },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 250,
+      myHeight: document.documentElement.clientHeight - 85 - 250,
       findAllPasture: [], findAllDepart: [], findAllEmploye: [], createDepartList: [], edit: 0,
       requestParams: [
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -571,7 +572,7 @@ export default {
       textMap: { see: '查看详情', create: '新增', examine: '审核', examine2: '审核', examine3: '审核', update: '编辑' },
       statues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
       applystatueList: [{ id: '0', name: '正常' }, { id: '1', name: '已关闭' }],
-      collarType: [{ id: '0', name: '非维保' }, { id: '1', name: '维修' }, { id: '2', name: '保养' },{ id: '3', name: '委外维修' }],
+      collarType: [{ id: '0', name: '非维保' }, { id: '1', name: '维修' }, { id: '2', name: '保养' }, { id: '3', name: '委外维修' }],
       radioAll: '全部',
       getdataListParm: {
         name: 'getBigpartapplyList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
@@ -644,29 +645,14 @@ export default {
 
     listAdd: {
       deep: true,
-      handler: function (item) {
-
-
-
-
-          this.listAdd.forEach(function(i){
-
-            if(parseInt(i.amount) > parseFloat(i.reportery)){
-              i.amount = i.reportery
-            }
-
-          })
-
-
-
-
-
-
+      handler: function(item) {
+        this.listAdd.forEach(function(i) {
+          if (parseInt(i.amount) > parseFloat(i.reportery)) {
+            i.amount = i.reportery
+          }
+        })
       }
-    },
-
-
-
+    }
 
   },
 
@@ -1318,7 +1304,7 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDepartDownList()
       })

+ 11 - 25
src/views/custom/receive/index1.vue

@@ -544,12 +544,13 @@ export default {
   },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 250,
+      myHeight: document.documentElement.clientHeight - 85 - 250,
       findAllPasture: [], findAllDepart: [], findAllEmploye: [], createDepartList: [], edit: 0,
       requestParams: [
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -643,29 +644,14 @@ export default {
 
     listAdd: {
       deep: true,
-      handler: function (item) {
-
-
-
-
-          this.listAdd.forEach(function(i){
-
-            if(parseInt(i.amount) > parseFloat(i.reportery)){
-              i.amount = i.reportery
-            }
-
-          })
-
-
-
-
-
-
+      handler: function(item) {
+        this.listAdd.forEach(function(i) {
+          if (parseInt(i.amount) > parseFloat(i.reportery)) {
+            i.amount = i.reportery
+          }
+        })
       }
-    },
-
-
-
+    }
 
   },
 
@@ -1317,7 +1303,7 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDepartDownList()
       })

+ 3 - 2
src/views/custom/record/index.vue

@@ -336,7 +336,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       requestParamDelete: {
 
@@ -539,7 +540,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list

+ 5 - 4
src/views/custom/refuse/index.vue

@@ -28,8 +28,8 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
-      @sort-change="tableSort"
       :max-height="myHeight"
+      @sort-change="tableSort"
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
@@ -307,7 +307,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       isOld: [],
       isOrNo: '0',
       tableKey: 0,
@@ -363,7 +363,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['旧品状态'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['旧品状态'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
 
       temp: {
@@ -468,7 +469,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list

+ 62 - 75
src/views/custom/retreat/index.vue

@@ -20,7 +20,7 @@
             <el-button v-if="isRetreatAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
             <el-button v-if="isEasSynchronization" class="filter-item" type="primary" style="float: right;" @click="handleEAS">EAS同步</el-button>
 
-            <el-button   class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
+            <el-button class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
           </div>
         </div>
 
@@ -39,7 +39,7 @@
           @selection-change="change_table_selection"
           @current-change="handleCurrentChange"
         >
-        <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
+          <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
           <el-table-column label="序号" align="center" type="index" width="50px">
             <template slot-scope="scope">
               <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
@@ -71,18 +71,18 @@
               <span>{{ scope.row.easStatus }}</span>
             </template>
           </el-table-column> -->
-          <el-table-column  prop="ProofCode" label="sap编码" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span>{{scope.row.ProofCode}}</span>
-              </template>
-            </el-table-column>
-          <el-table-column   prop="ProofCode" label="sap上传状态" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.ProofCode">已上传</span>
-                <span v-else>未上传</span>
-            
-              </template>
-            </el-table-column>
+          <el-table-column prop="ProofCode" label="sap编码" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.ProofCode }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="ProofCode" label="sap上传状态" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span v-if="scope.row.ProofCode">已上传</span>
+              <span v-else>未上传</span>
+
+            </template>
+          </el-table-column>
           <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
             <template slot-scope="{row}">
               <el-button v-if="isRetreatSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
@@ -590,7 +590,7 @@
 
 <script>
 // / 引入
-import { GetDataByName, GetDataByNames, ExecDataByConfig, GetAccount, PostDataByName, EasSync, checkButtons,SapQuit } from '@/api/common'
+import { GetDataByName, GetDataByNames, ExecDataByConfig, GetAccount, PostDataByName, EasSync, checkButtons, SapQuit } from '@/api/common'
 import waves from '@/directive/waves' // waves directive
 import { parseTime, sortChange, json2excel } from '@/utils/index.js'
 // eslint-disable-next-line no-unused-vars
@@ -599,8 +599,8 @@ import Pagination from '@/components/Pagination' // secondary package based on e
 import { MessageBox } from 'element-ui'
 import Cookies from 'js-cookie'
 export default {
-  isSap:1,
-      isSrm:1,
+  isSap: 1,
+  isSrm: 1,
   selectList: [],
   name: 'Retreat',
   components: { Pagination },
@@ -615,7 +615,7 @@ export default {
     return {
       buttons: [],
 
-      currentRow:{},
+      currentRow: {},
       isRetreatsap: [],
       isRetreatSee: [], isRetreatExport: [], isRetreatAdd: [], isRetreatDelate: [],
       isEasSynchronization: [], isManualSynchronization: [], isCloseSynchronization: [], isIgnoreSynchronization: [],
@@ -628,7 +628,8 @@ export default {
         { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       pickerOptions: {
         disabledDate(time) {
@@ -785,15 +786,14 @@ export default {
   watch: {
     listAdd: {
       deep: true,
-      handler: function (item) {
-          this.listAdd.forEach(function(i){
-            if(parseInt(i.quitNumber) > (parseInt(i.checkoutNumber)-parseInt(i.quitNumberC))){
-              i.quitNumber = parseInt(i.checkoutNumber)-parseInt(i.quitNumberC)
-            }
-                
-          })  
+      handler: function(item) {
+        this.listAdd.forEach(function(i) {
+          if (parseInt(i.quitNumber) > (parseInt(i.checkoutNumber) - parseInt(i.quitNumberC))) {
+            i.quitNumber = parseInt(i.checkoutNumber) - parseInt(i.quitNumberC)
+          }
+        })
       }
-    },
+    }
   },
   created() {
     const that = this
@@ -818,7 +818,6 @@ export default {
       const isRetreatAdd = checkButtons(this.$store.state.user.buttons, RetreatAdd)
       this.isRetreatAdd = isRetreatAdd
 
-
       const Retreatsap = 'customs:Retreat:sap'
       const isRetreatsap = checkButtons(this.$store.state.user.buttons, Retreatsap)
       this.isRetreatsap = isRetreatsap
@@ -978,72 +977,61 @@ export default {
     },
 
     handleCurrentChange(val) {
-        this.currentRow = val;
-        console.log("currentRow",this.currentRow)
+      this.currentRow = val
+      console.log('currentRow', this.currentRow)
     },
 
-    checkboxInit(row,index){
+    checkboxInit(row, index) {
       // console.log(row)
-      if(row.ProofCode){ 
-        return 0 
+      if (row.ProofCode) {
+        return 0
       } else {
-
         var data1 = new Date(row.creatTime)
         var data2 = new Date('2022-10-25')
-        if(data1 > data2){ return 1 } else {return 0}
- 
+        if (data1 > data2) { return 1 } else { return 0 }
       }
-
- 
     },
-    //监听 - 表格 - 勾选
+    // 监听 - 表格 - 勾选
     change_table_selection(val) {
       this.selectList = val
       console.log('勾选数据selectList', this.selectList)
     },
 
-    sapUpload(){
-      const that = this 
-      console.log("currentRow ProofCode",this.currentRow.ProofCode)
+    sapUpload() {
+      const that = this
+      console.log('currentRow ProofCode', this.currentRow.ProofCode)
       var send_data = this.selectList
 
-      if(send_data.length == 0){
-        that.$notify({ title: '失败', message: '请勾选数据!'  , type: 'error', duration: 2000 })
+      if (send_data.length == 0) {
+        that.$notify({ title: '失败', message: '请勾选数据!', type: 'error', duration: 2000 })
         return false
       }
 
-
       console.log(that.isSap)
 
-      if(that.isSap == 1){
+      if (that.isSap == 1) {
+        that.isSap = 0
 
-         that.isSap = 0
-      
-         SapQuit(send_data).then(response => {
-              console.log('response', response)
-                
-              if (response.msg !== 'fail') {
-                that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
+        SapQuit(send_data).then(response => {
+          console.log('response', response)
 
-                that.selectList = []
-                that.get_table_data()
-                
-                } else {
-                  that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
-                }
-            })
-            
-      } else {
+          if (response.msg !== 'fail') {
+            that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
 
-        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击'  , type: 'error', duration: 2000 })
+            that.selectList = []
+            that.get_table_data()
+          } else {
+            that.$notify({ title: '失败', message: '上传失败', type: 'error', duration: 2000 })
+          }
+        })
+      } else {
+        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击', type: 'error', duration: 2000 })
       }
 
       setTimeout(() => {
-              that.isSap = 1
-            }, 3000)
-
+        that.isSap = 1
+      }, 3000)
 
-      
       //  if(true){
       // if(this.currentRow.ProofCode){
       //    console.log("currentRow ProofCode 这个值说明已经上传了,不用上传")
@@ -1051,30 +1039,29 @@ export default {
       // } else {
       //   console.log("currentRow ProofCode没有这个值")
       //   console.log("currentRow ProofCode",this.currentRow.ProofCode)
-      //     const useForm = this.currentRow.useForm 
-      //     const creatTime = this.currentRow.creatTime 
+      //     const useForm = this.currentRow.useForm
+      //     const creatTime = this.currentRow.creatTime
       //     console.log("useForm",useForm)
       //       var send_data = {
       //             "useForm":useForm,
       //             "quitDate":creatTime,
       //             "pastureid":Cookies.get('pastureid')
-              
+
       //       }
       //       SapQuit(send_data).then(response => {
       //         console.log('response', response)
-                
+
       //         if (response.msg !== 'fail') {
       //           that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
 
       //           that.get_table_data()
-                
+
       //           } else {
       //             that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
       //           }
       //       })
- 
-    //  }
 
+      //  }
     },
 
     handleBlurSpareNumber() {
@@ -1396,7 +1383,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
       })

+ 72 - 104
src/views/custom/returngoods/index.vue

@@ -29,8 +29,8 @@
               </el-badge>
               <el-radio-button label="已处理" />
             </el-radio-group>
-            <el-button v-if="isEasSynchronization" class="filter-item" type="primary"  @click="handleEAS">EAS同步</el-button>
-            <el-button v-if="isRetrunsap"  class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
+            <el-button v-if="isEasSynchronization" class="filter-item" type="primary" @click="handleEAS">EAS同步</el-button>
+            <el-button v-if="isRetrunsap" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
           </div>
         </div>
 
@@ -46,11 +46,11 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"
+          :max-height="myHeight"
           @selection-change="change_table_selection"
           @current-change="handleCurrentChange"
-          :max-height="myHeight"
         >
-        <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
+          <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
           <el-table-column label="序号" align="center" type="index" width="50px">
             <template slot-scope="scope">
               <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
@@ -78,18 +78,18 @@
               <span>{{ scope.row.easStatus }}</span>
             </template>
           </el-table-column> -->
-          <el-table-column  prop="ProofCode" label="sap编码" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span>{{scope.row.ProofCode}}</span>
-              </template>
-            </el-table-column>
-          <el-table-column   prop="ProofCode" label="sap上传状态" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.ProofCode">已上传</span>
-                <span v-else>未上传</span>
+          <el-table-column prop="ProofCode" label="sap编码" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.ProofCode }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="ProofCode" label="sap上传状态" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span v-if="scope.row.ProofCode">已上传</span>
+              <span v-else>未上传</span>
 
-              </template>
-            </el-table-column>
+            </template>
+          </el-table-column>
           <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
             <template slot-scope="{row}">
               <el-button v-if="isReturngoodsSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
@@ -138,8 +138,8 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"
-          @sort-change="tableSort"
           :max-height="myHeight"
+          @sort-change="tableSort"
         >
           <el-table-column label="序号" align="center" type="index" width="50px">
             <template slot-scope="scope">
@@ -281,20 +281,17 @@
             <el-col :span="8">
               <el-form-item label="退货方式:" prop="laidType">
                 <el-radio-group v-model="createTemp.laidType" @change="changeStorageType">
-                  <el-radio   v-model="createTemp.laidType" :label="0"  >寄售退货</el-radio>
-                  <el-radio   v-model="createTemp.laidType" :label="1"  >自购件退货</el-radio>
+                  <el-radio v-model="createTemp.laidType" :label="0">寄售退货</el-radio>
+                  <el-radio v-model="createTemp.laidType" :label="1">自购件退货</el-radio>
 
                 </el-radio-group>
               </el-form-item>
             </el-col>
 
-
           </el-row>
 
-
-
-          <el-row  v-if="No1">
-            <el-col :span="15" >
+          <el-row v-if="No1">
+            <el-col :span="15">
               <el-form-item label="备件:" prop="partCode">
                 <el-autocomplete
                   v-model="createTemp.partCode"
@@ -318,7 +315,7 @@
             </el-col>
           </el-row>
           <el-row v-if="No2">
-            <el-col :span="15" >
+            <el-col :span="15">
               <el-form-item label="采购单号:" prop="buyeCode">
                 <el-autocomplete ref="buyeCode" v-model="createTemp.buyeCode" value-key="name" class="inline-input" :fetch-suggestions="buyeCodeSearch" placeholder="请输入采购单号" style="width:550px" @select="handleSelectBuyeCode">
                   <template slot-scope="{ item }">
@@ -386,15 +383,14 @@
           </el-table-column>
           <el-table-column label="退货数量" min-width="120px" align="center" valign="middle">
             <template slot-scope="scope">
-              <el-form :model="scope.row" :rules="rules" v-show="No1">
+              <el-form v-show="No1" :model="scope.row" :rules="rules">
                 <el-form-item prop="refundNumber">
-                  <el-input v-model="scope.row.refundNumber" style="margin-top:15px" @blur="blurRefundNumber"  />
+                  <el-input v-model="scope.row.refundNumber" style="margin-top:15px" @blur="blurRefundNumber" />
                 </el-form-item>
               </el-form>
               <span v-show="No2">{{ scope.row.refundNumber }}</span>
             </template>
 
-
           </el-table-column>
           <el-table-column label="单价" min-width="110px" align="center" valign="middle">
             <template slot-scope="scope">
@@ -534,12 +530,12 @@
             </template>
           </el-table-column>
           <el-table-column prop="dflag" label="冲销状态" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span v-if="scope.row.dflag == 1">已冲销</span>
-                <span v-else-if="scope.row.dflag == 2">部分冲销</span>
-                <span v-else>未冲销</span>
-              </template>
-            </el-table-column>
+            <template slot-scope="scope">
+              <span v-if="scope.row.dflag == 1">已冲销</span>
+              <span v-else-if="scope.row.dflag == 2">部分冲销</span>
+              <span v-else>未冲销</span>
+            </template>
+          </el-table-column>
         </el-table>
         <el-form ref="seeTemp" :rules="rules" :model="seeTemp" label-position="right" label-width="100px" style="width: 90%;margin:0 auto;">
           <el-row>
@@ -670,12 +666,12 @@ export default {
   },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 250,
-      isSap:1,
-      isSrm:1,
+      myHeight: document.documentElement.clientHeight - 85 - 250,
+      isSap: 1,
+      isSrm: 1,
       selectList: [],
       isRetrunsap: [],
-      currentRow:{},
+      currentRow: {},
       // 权限
       isReturngoodsAdd: [], isReturngoodsTemplate: [], isReturngoodsImport: [], isReturngoodsExport: [], isReturngoodsSee: [], isReturngoodsDelete: [], isReturngoodsExamineZG: [], isReturngoodsExamineCG: [], isReturngoodsUpdate: [],
       isEasSynchronization: [], isManualSynchronization: [], isCloseSynchronization: [], isIgnoreSynchronization: [],
@@ -688,7 +684,8 @@ export default {
         { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       pickerOptions: {
         disabledDate(time) {
@@ -705,7 +702,7 @@ export default {
       },
       rules: {
         // useForm: [{ required: true, message: '必填', trigger: 'blur' }],
-         //  providerId: [{ required: true, message: '必填', trigger: 'blur' }]
+        //  providerId: [{ required: true, message: '必填', trigger: 'blur' }]
       },
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
@@ -862,11 +859,10 @@ export default {
         total: 0,
         getdataListParm: {
           name: 'getBigPartrefundWebListNO', page: 1, offset: 1, getTotal: 'total3', pagecount: 10, returntype: 'Map',
-          parammaps: {pastureId: Cookies.get('pastureid')}
+          parammaps: { pastureId: Cookies.get('pastureid') }
         }
       },
 
-
       orderCode: {},
       requestBuyeCode: {
         name: 'getbigrefunddetailCode',
@@ -884,8 +880,7 @@ export default {
         parammaps: {}
       },
       No1: true,
-      No2: false,
-
+      No2: false
 
     }
   },
@@ -898,22 +893,17 @@ export default {
 
     listAdd: {
       deep: true,
-      handler: function (item) {
-
-          this.listAdd.forEach(function(i){
-            if(parseInt(i.refundNumber) > parseInt(i.reportery)){
-              i.refundNumber = i.reportery
-            }
-
-          })
-
-
+      handler: function(item) {
+        this.listAdd.forEach(function(i) {
+          if (parseInt(i.refundNumber) > parseInt(i.reportery)) {
+            i.refundNumber = i.reportery
+          }
+        })
       }
-    },
+    }
 
   },
 
-
   created() {
     const that = this
     GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
@@ -933,11 +923,9 @@ export default {
       if (val === 0) { // No1寄售备件 No2 采购
         this.No2 = false
         this.No1 = true
-
       } else if (val === 1) {
         this.No2 = true
         this.No1 = false
-
       }
 
       this.listAdd = []
@@ -958,9 +946,8 @@ export default {
           cb(response.data.list)
         })
       } else {
-
         this.requestBuyeCode.parammaps['buyeCode'] = queryString
-        this.requestBuyeCode.parammaps['providerId'] = ""
+        this.requestBuyeCode.parammaps['providerId'] = ''
         GetDataByName(this.requestBuyeCode).then(response => {
           console.log('采购单号模糊查询搜索data', response.data.list)
           if (response.data.list === null) {
@@ -1014,7 +1001,6 @@ export default {
       this.$forceUpdate()
     },
 
-
     tableSort(column) {
       if (this.activeName == 'first') {
         sortChange(column, this.listSee)
@@ -1023,9 +1009,6 @@ export default {
       }
     },
     get_auto_buttons() {
-
-
-
       const Retrunsap = 'customs:returngoods:sap'
       const isRetrunsap = checkButtons(this.$store.state.user.buttons, Retrunsap)
       this.isRetrunsap = isRetrunsap
@@ -1239,72 +1222,59 @@ export default {
     },
 
     handleCurrentChange(val) {
-        this.currentRow = val;
-        console.log("currentRow",this.currentRow)
+      this.currentRow = val
+      console.log('currentRow', this.currentRow)
     },
 
-    checkboxInit(row,index){
+    checkboxInit(row, index) {
       // console.log(row)
-      if(row.ProofCode){
+      if (row.ProofCode) {
         return 0
       } else {
-
         var data1 = new Date(row.createTime1)
         var data2 = new Date('2022-10-25')
-        if(data1 > data2){ return 1 } else {return 0}
-
+        if (data1 > data2) { return 1 } else { return 0 }
       }
-
-
     },
 
-    //监听 - 表格 - 勾选
+    // 监听 - 表格 - 勾选
     change_table_selection(val) {
       this.selectList = val
       console.log('勾选数据selectList', this.selectList)
     },
 
-    sapUpload(){
+    sapUpload() {
       const that = this
-      console.log("currentRow ProofCode",this.currentRow.ProofCode)
+      console.log('currentRow ProofCode', this.currentRow.ProofCode)
       var send_data = this.selectList
 
-      if(send_data.length == 0){
-        that.$notify({ title: '失败', message: '请勾选数据!'  , type: 'error', duration: 2000 })
+      if (send_data.length == 0) {
+        that.$notify({ title: '失败', message: '请勾选数据!', type: 'error', duration: 2000 })
         return false
       }
 
-
       console.log(that.isSap)
 
-      if(that.isSap == 1){
-
-         that.isSap = 0
-         SapRef(send_data).then(response => {
-              console.log('response', response)
-
-              if (response.msg !== 'fail') {
-                that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
-                that.selectList = []
-                that.get_table_data()
-
-                } else {
-                  that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
-                }
-            })
-
+      if (that.isSap == 1) {
+        that.isSap = 0
+        SapRef(send_data).then(response => {
+          console.log('response', response)
 
+          if (response.msg !== 'fail') {
+            that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
+            that.selectList = []
+            that.get_table_data()
+          } else {
+            that.$notify({ title: '失败', message: '上传失败', type: 'error', duration: 2000 })
+          }
+        })
       } else {
-
-        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击'  , type: 'error', duration: 2000 })
+        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击', type: 'error', duration: 2000 })
       }
 
       setTimeout(() => {
-              that.isSap = 1
-            }, 3000)
-
-
-
+        that.isSap = 1
+      }, 3000)
 
       //  if(true){
       // if(this.currentRow.ProofCode){
@@ -1335,10 +1305,8 @@ export default {
       //       })
 
       // }
-
     },
 
-
     form_add() {
       this.resetCreateTemp()
       this.createTemp.useForm = ''
@@ -1758,7 +1726,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
       })

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 2457
src/views/custom/storage/index.vue


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 789 - 797
src/views/custom/subscribe/index.vue


+ 97 - 99
src/views/custom/writeoff/index.vue

@@ -1,18 +1,18 @@
 <template>
   <div class="app-container">
     <div class="filter-container">
-      <el-select v-model="table1.getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;"  >
+      <el-select v-model="table1.getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;">
         <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
       </el-select>
       <el-select v-model="table1.getdataListParm.parammaps.writeoffType" style="width: 140px;" placeholder="冲销类型" class="filter-item" @change="change_type">
         <el-option v-for="item in writeoffList" :key="item.id" :label="item.name" :value="item.name" />
       </el-select>
-      <el-input  v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="设备管理平台单号" style="width: 200px;" class="filter-item" />
-       <!-- <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="入库单号" style="width: 200px;" class="filter-item" />
+      <el-input v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="设备管理平台单号" style="width: 200px;" class="filter-item" />
+      <!-- <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="入库单号" style="width: 200px;" class="filter-item" />
       <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件出库'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="出库单号" style="width: 200px;" class="filter-item" />
       <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件退库'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="退库单号" style="width: 200px;" class="filter-item" />
       <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件退货'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="退货单号" style="width: 200px;" class="filter-item" />  -->
-      <el-select v-model="table1.getdataListParm.parammaps.hasTicket" style="width: 180px;" clearable placeholder="是否已开票" class="filter-item" v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库' || table1.getdataListParm.parammaps.writeoffType == '备件退货'">
+      <el-select v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库' || table1.getdataListParm.parammaps.writeoffType == '备件退货'" v-model="table1.getdataListParm.parammaps.hasTicket" style="width: 180px;" clearable placeholder="是否已开票" class="filter-item">
         <el-option v-for="item in invoicedReturnDocList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
       <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
@@ -102,7 +102,7 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="物料凭证年度:" prop="proofYear">
-                <el-input ref="proofYear" v-model="create.temp.proofYear" disabled  placeholder="" />
+                <el-input ref="proofYear" v-model="create.temp.proofYear" disabled placeholder="" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -120,8 +120,8 @@
           :cell-style="cellStyle"
           class="elTable"
           @selection-change="handleSelectionChange"
-          >
-          <el-table-column type="selection"  width="55" />
+        >
+          <el-table-column type="selection" width="55" />
           <el-table-column label="行号" align="center" prop="rowNumber" width="50px" />
           <el-table-column label="备件编号" prop="partCode" align="center" min-width="90" />
           <el-table-column label="备件名称" prop="partName" align="center" min-width="90" />
@@ -134,7 +134,7 @@
           <el-table-column label="总价" prop="totalPrice" align="center" min-width="90" />
         </el-table>
         <div slot="footer" class="dialog-footer" style="bottom:10px">
-          <el-button type="primary" v-if="dialogStatus=='create'" :disabled="isokDisable" @click="add_dialog_save()">保存并关闭</el-button>
+          <el-button v-if="dialogStatus=='create'" type="primary" :disabled="isokDisable" @click="add_dialog_save()">保存并关闭</el-button>
           <el-button @click="dialogFormVisible = false;get_table_data()">取消并关闭</el-button>
         </div>
       </div>
@@ -144,7 +144,7 @@
 
 <script>
 // / 引入
-import { GetDataByName, GetDataByNames,postJson, PostDataByName, ExecDataByConfig, checkButtons, failproccess } from '@/api/common'
+import { GetDataByName, GetDataByNames, postJson, PostDataByName, ExecDataByConfig, checkButtons, failproccess } from '@/api/common'
 import { parseTime } from '@/utils/index.js'
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination
 import { MessageBox } from 'element-ui'
@@ -154,23 +154,24 @@ export default {
   components: { Pagination },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       findAllPasture: [],
       requestParams: [
         { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'getPastureList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: {}},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
-      writeoffList:[
-        {id:1,name:'备件入库'},
-        {id:2,name:'备件退货'},
-        {id:3,name:'备件出库'},
+      writeoffList: [
+        { id: 1, name: '备件入库' },
+        { id: 2, name: '备件退货' },
+        { id: 3, name: '备件出库' }
         // {id:4,name:'备件退库'}
-      ], //冲销类型
-      invoicedReturnDocList:[{id:0,name:'否'},{id:1,name:'是'}],//是否已开票退货单
-      materialVoucherNoList:[{id:0,name:'11111'},{id:1,name:'2222'}],//物料凭证号
+      ], // 冲销类型
+      invoicedReturnDocList: [{ id: 0, name: '否' }, { id: 1, name: '是' }], // 是否已开票退货单
+      materialVoucherNoList: [{ id: 0, name: '11111' }, { id: 1, name: '2222' }], // 物料凭证号
       // table1:{
       //   getdataListParm: {
       //     name: 'getBigPartTransferList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
@@ -182,18 +183,18 @@ export default {
       //   },
       //   tableKey: 0, listLoading: false, total: 0, list: [],pageNum:0, pageSize:0
       // },
-      table1:{
+      table1: {
         getdataListParm: {
           name: 'getLaidProofList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
           parammaps: {
 
             pastureName: Cookies.get('pasturename'),
-            writeoffType:'备件入库',
-            orderNumber:'',
-            hasTicket:''
+            writeoffType: '备件入库',
+            orderNumber: '',
+            hasTicket: ''
           }
         },
-        tableKey: 0, listLoading: false, total: 0, list: [],pageNum:0, pageSize:0
+        tableKey: 0, listLoading: false, total: 0, list: [], pageNum: 0, pageSize: 0
       },
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
@@ -202,10 +203,10 @@ export default {
       textMap: { create: '新增', see: '查看' },
       rules: {
         orderNumber: [{ required: true, message: '必填', trigger: 'blur' }],
-        NumberType: [{ required: true, message: '必填', trigger: 'blur' }],
+        NumberType: [{ required: true, message: '必填', trigger: 'blur' }]
       },
       create: {
-        temp:{ applyDate: parseTime(new Date(), '{y}-{m}-{d}')},
+        temp: { applyDate: parseTime(new Date(), '{y}-{m}-{d}') },
         getdataListParm: {
           name: 'getPartTransferbybigid',
           returntype: 'Map',
@@ -214,9 +215,9 @@ export default {
         getdataListParm2: {
           name: 'getPartlaidByBigid',
           returntype: 'Map',
-          parammaps: {bigid:"",hasTicket:1}
+          parammaps: { bigid: '', hasTicket: 1 }
         },
-        tableKey: 0, listLoading: false, total: 0, list: [], pageNum:0, pageSize:0
+        tableKey: 0, listLoading: false, total: 0, list: [], pageNum: 0, pageSize: 0
       },
       isokDisable: false,
       pickerOptions: {
@@ -224,9 +225,9 @@ export default {
           return time.getTime() > Date.now()// 当天之前的时间可选
         }
       },
-      isWriteoffAdd:[],
-      isWriteoffSee:[],
-      isWriteoffDel:[]
+      isWriteoffAdd: [],
+      isWriteoffSee: [],
+      isWriteoffDel: []
     }
   },
 
@@ -245,7 +246,7 @@ export default {
       // 新增
       const WriteoffAdd = 'customs:writeoff:add'
       const isWriteoffAdd = checkButtons(this.$store.state.user.buttons, WriteoffAdd)
-      this.isWriteoffAdd= isWriteoffAdd
+      this.isWriteoffAdd = isWriteoffAdd
       // 查看
       const WriteoffSee = 'customs:writeoff:see'
       const isWriteoffSee = checkButtons(this.$store.state.user.buttons, WriteoffSee)
@@ -259,12 +260,12 @@ export default {
     get_table_data() {
       this.table1.listLoading = true
       GetDataByName(this.table1.getdataListParm).then(response => {
-        if(response.data.list){
+        if (response.data.list) {
           console.log('table数据', response.data.list)
           this.table1.list = response.data.list
           this.table1.pageNum = response.data.pageNum
           this.table1.pageSize = response.data.pageSize
-        }else{
+        } else {
           this.table1.list = []
           this.table1.pageNum = 0
           this.table1.pageSize = 0
@@ -286,54 +287,54 @@ export default {
     form_add() {
       this.dialogStatus = 'create'
       this.dialogFormVisible = true
-      this.create.temp = {'materialCode':'','proofYear':'','chargeDate':'','orderNumber':'','hasTicket':'','orderNumberId':'','NumberType':'','rowsNumber':[]}
+      this.create.temp = { 'materialCode': '', 'proofYear': '', 'chargeDate': '', 'orderNumber': '', 'hasTicket': '', 'orderNumberId': '', 'NumberType': '', 'rowsNumber': [] }
       this.create.list = []
     },
-    changeWriteoff(item){
+    changeWriteoff(item) {
       this.getTableFormList()
     },
-    blurOrderNumber(){
+    blurOrderNumber() {
       this.getTableFormList()
     },
-    getTableFormList(){
-      let url = 'authdata/sap/proof/detail'
-      let data = {
-        OrderNumber:this.create.temp.orderNumber,
-        NumberType:this.create.temp.NumberType
+    getTableFormList() {
+      const url = 'authdata/sap/proof/detail'
+      const data = {
+        OrderNumber: this.create.temp.orderNumber,
+        NumberType: this.create.temp.NumberType
       }
-      if(this.create.temp.orderNumber == ''){
+      if (this.create.temp.orderNumber == '') {
         this.$message({ title: '', message: '设备管理平台单号不能为空', type: 'warning', duration: 2000 })
         return
       }
-      if(this.create.temp.NumberType == ''){
+      if (this.create.temp.NumberType == '') {
         this.$message({ title: '', message: '冲销类型不能为空', type: 'warning', duration: 2000 })
         return
       }
-      postJson(url,data).then(response => {
-       console.log(response.msg,'response===')
-       if(response.msg !== 'fail' ){
-          if(response.data){
+      postJson(url, data).then(response => {
+        console.log(response.msg, 'response===')
+        if (response.msg !== 'fail') {
+          if (response.data) {
             this.create.temp = response.data
             this.create.temp.rowsNumber = []
-            if(response.data.parts){
+            if (response.data.parts) {
               this.create.list = response.data.parts
-            }else{
+            } else {
               this.create.list = []
             }
-          }else{
+          } else {
             this.create.list = []
             this.create.temp = {}
           }
-       }else{
+        } else {
           this.$notify({ title: '失败', message: response.message, type: 'warning', duration: 2000 })
-       }
-      }).catch((res)=>{
+        }
+      }).catch((res) => {
         // this.$message({ title: '', message: re, type: 'warning', duration: 2000 })
       })
     },
     handleSelectionChange(val) {
       this.create.temp.rowsNumber = []
-      for(let i=0;i<val.length;i++){
+      for (let i = 0; i < val.length; i++) {
         this.create.temp.rowsNumber.push(val[i].rowNumber)
       }
       console.log(this.create.temp.rowsNumber)
@@ -346,41 +347,37 @@ export default {
 
       // var rowsNumberArr = []
 
-
       // this.create.list.forEach(function(item){
       //   rowsNumberArr.push(item.rowNumber)
       // })
 
       // console.log('rowsNumberArr',rowsNumberArr)
 
-
-
       this.$refs['create'].validate(valid => {
         if (valid) {
           // console.log('新增保存',this.create.temp.rowsNumber)
-          let url = "authdata/sap/proof/off"
-          let data = {
-            materialCode:this.create.temp.materialCode,
-            proofYear:this.create.temp.proofYear,
-            chargeDate:this.create.temp.chargeDate,
-            orderNumber:this.create.temp.orderNumber,
-            hasTicket:this.create.temp.hasTicket,
-            rowsNumber:this.create.temp.rowsNumber,//[]
-            orderNumberId:this.create.temp.orderNumberId,
-            NumberType:this.create.temp.NumberType
+          const url = 'authdata/sap/proof/off'
+          const data = {
+            materialCode: this.create.temp.materialCode,
+            proofYear: this.create.temp.proofYear,
+            chargeDate: this.create.temp.chargeDate,
+            orderNumber: this.create.temp.orderNumber,
+            hasTicket: this.create.temp.hasTicket,
+            rowsNumber: this.create.temp.rowsNumber, // []
+            orderNumberId: this.create.temp.orderNumberId,
+            NumberType: this.create.temp.NumberType
 
           }
 
-
-          if(this.create.temp.rowsNumber.length == 0){
-            this.$message({  message: '请选择需要冲销的备件', type: 'warning', duration: 2000 })
+          if (this.create.temp.rowsNumber.length == 0) {
+            this.$message({ message: '请选择需要冲销的备件', type: 'warning', duration: 2000 })
             return
           }
-          postJson(url,data).then(response => {
-            if(response.msg !== 'fail'){
+          postJson(url, data).then(response => {
+            if (response.msg !== 'fail') {
               this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
               this.dialogFormVisible = false
-            }else{
+            } else {
               this.$notify({ title: '失败', message: response.message, type: 'warning', duration: 2000 })
             }
           })
@@ -388,22 +385,24 @@ export default {
       })
     },
 
-
     change_type(item) {
       console.log(item)
-      if(item == "备件入库"){
+      if (item == '备件入库') {
         this.table1.getdataListParm.name = 'getLaidProofList'
         this.table1.getdataListParm.parammaps.writeoffType = '备件入库'
-       }
-      if(item == "备件出库"){ this.table1.getdataListParm.name = 'getReturnProofList'
-      this.table1.getdataListParm.parammaps.writeoffType = '备件出库'
-    }
-      if(item == "备件退库"){ this.table1.getdataListParm.name = 'getQuitProofList'
-      this.table1.getdataListParm.parammaps.writeoffType = '备件退库'
-    }
-      if(item == "备件退货"){ this.table1.getdataListParm.name = 'getUseProofList'
-      this.table1.getdataListParm.parammaps.writeoffType = '备件退货'
-    }
+      }
+      if (item == '备件出库') {
+        this.table1.getdataListParm.name = 'getReturnProofList'
+        this.table1.getdataListParm.parammaps.writeoffType = '备件出库'
+      }
+      if (item == '备件退库') {
+        this.table1.getdataListParm.name = 'getQuitProofList'
+        this.table1.getdataListParm.parammaps.writeoffType = '备件退库'
+      }
+      if (item == '备件退货') {
+        this.table1.getdataListParm.name = 'getUseProofList'
+        this.table1.getdataListParm.parammaps.writeoffType = '备件退货'
+      }
     },
 
     // 查看
@@ -412,37 +411,36 @@ export default {
 
       this.create.temp = Object.assign({}, row)
 
-      console.log('row',row)
-
+      console.log('row', row)
 
       // this.create.getdataListParm.parammaps.id = this.create.temp.id
       // {id:1,name:'备件入库'},{id:2,name:'备件退货'},{id:3,name:'备件出库'},{id:4,name:'备件退库'}
-      if(row.NumberType == 1){
+      if (row.NumberType == 1) {
         this.create.getdataListParm2.name = 'getPartlaidByBigid'
       }
-      if(row.NumberType == 4){
+      if (row.NumberType == 4) {
         this.create.getdataListParm2.name = 'getPartquitByBigid'
       }
-      if(row.NumberType == 2){
+      if (row.NumberType == 2) {
         this.create.getdataListParm2.name = 'getPartrefundByBigid'
       }
-      if(row.NumberType == 3){
+      if (row.NumberType == 3) {
         this.create.getdataListParm2.name = 'getPartuseByBigid'
       }
 
       this.create.getdataListParm2.parammaps.bigid = row.id
       this.getDialogList2()
       // this.getDialogList()
-       this.dialogFormVisible = true
+      this.dialogFormVisible = true
     },
 
     getDialogList2() {
       GetDataByName(this.create.getdataListParm2).then(response => {
-        if(response.data.list){
+        if (response.data.list) {
           this.create.list = response.data.list
           this.create.pageNum = response.data.pageNum
           this.create.pageSize = response.data.pageSize
-        }else{
+        } else {
           this.create.list = []
           this.create.pageNum = 0
           this.create.pageSize = 0
@@ -457,11 +455,11 @@ export default {
     },
     getDialogList() {
       GetDataByName(this.create.getdataListParm).then(response => {
-        if(response.data.list){
+        if (response.data.list) {
           this.create.list = response.data.list
           this.create.pageNum = response.data.pageNum
           this.create.pageSize = response.data.pageSize
-        }else{
+        } else {
           this.create.list = []
           this.create.pageNum = 0
           this.create.pageSize = 0
@@ -478,20 +476,20 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllPasture2 = response.data.getPastureList.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
       })
     },
 
-    handleDelate(row){
+    handleDelate(row) {
       MessageBox.confirm('确认删除此条信息?', {
         confirmButtonText: '确认',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-      console.log('删除')
+        console.log('删除')
       }).catch(() => {
         this.$message({ type: 'info', message: '已取消删除' })
       })

+ 101 - 100
src/views/custom/writeoff/index1.vue

@@ -4,12 +4,12 @@
       <el-select v-model="table1.getdataListParm.parammaps.writeoffType" style="width: 140px;" placeholder="冲销类型" class="filter-item" @change="change_type">
         <el-option v-for="item in writeoffList" :key="item.id" :label="item.name" :value="item.name" />
       </el-select>
-      <el-input  v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="设备管理平台单号" style="width: 200px;" class="filter-item" />
-       <!-- <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="入库单号" style="width: 200px;" class="filter-item" />
+      <el-input v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="设备管理平台单号" style="width: 200px;" class="filter-item" />
+      <!-- <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="入库单号" style="width: 200px;" class="filter-item" />
       <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件出库'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="出库单号" style="width: 200px;" class="filter-item" />
       <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件退库'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="退库单号" style="width: 200px;" class="filter-item" />
       <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件退货'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="退货单号" style="width: 200px;" class="filter-item" />  -->
-      <el-select v-model="table1.getdataListParm.parammaps.hasTicket" style="width: 180px;" clearable placeholder="是否已开票" class="filter-item" v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库' || table1.getdataListParm.parammaps.writeoffType == '备件退货'">
+      <el-select v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库' || table1.getdataListParm.parammaps.writeoffType == '备件退货'" v-model="table1.getdataListParm.parammaps.hasTicket" style="width: 180px;" clearable placeholder="是否已开票" class="filter-item">
         <el-option v-for="item in invoicedReturnDocList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
       <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
@@ -40,14 +40,14 @@
       <el-table-column label="物料凭证年度" min-width="150px" align="center" prop="proofYear" />
       <el-table-column label="凭证中的过账信息" min-width="150px" align="center" prop="chargeDate" />
       <el-table-column label="设备管理平台单号" min-width="150px" align="center" prop="orderNumber" />
- 
-      <el-table-column label="是否已开票" min-width="150px" align="center" show-overflow-tooltip v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库' || table1.getdataListParm.parammaps.writeoffType == '备件退货'" >
-            <template slot-scope="scope">
-              <span v-if="scope.row.hasTicket == 1">是</span>
-              <span v-if="scope.row.hasTicket == 0">否</span>
-              <span v-if="scope.row.hasTicket == ''"> </span>
-            </template>
-          </el-table-column>
+
+      <el-table-column v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库' || table1.getdataListParm.parammaps.writeoffType == '备件退货'" label="是否已开票" min-width="150px" align="center" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span v-if="scope.row.hasTicket == 1">是</span>
+          <span v-if="scope.row.hasTicket == 0">否</span>
+          <span v-if="scope.row.hasTicket == ''" />
+        </template>
+      </el-table-column>
       <el-table-column label="设备管理平台行号" min-width="150px" align="center" prop="rowNumber" />
       <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
         <template slot-scope="{row}">
@@ -97,7 +97,7 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="物料凭证年度:" prop="proofYear">
-                <el-input ref="proofYear" v-model="create.temp.proofYear" disabled  placeholder="" />
+                <el-input ref="proofYear" v-model="create.temp.proofYear" disabled placeholder="" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -114,9 +114,9 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable"
-           @selection-change="handleSelectionChange"
-          >
-          <el-table-column type="selection"  width="55" />
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column type="selection" width="55" />
           <el-table-column label="行号" align="center" prop="rowNumber" width="50px" />
           <el-table-column label="备件编号" prop="partCode" align="center" min-width="90" />
           <el-table-column label="备件名称" prop="partName" align="center" min-width="90" />
@@ -129,7 +129,7 @@
           <el-table-column label="总价" prop="totalPrice" align="center" min-width="90" />
         </el-table>
         <div slot="footer" class="dialog-footer" style="bottom:10px">
-          <el-button type="primary" v-if="dialogStatus=='create'" :disabled="isokDisable" @click="add_dialog_save()">保存并关闭</el-button>
+          <el-button v-if="dialogStatus=='create'" type="primary" :disabled="isokDisable" @click="add_dialog_save()">保存并关闭</el-button>
           <el-button @click="dialogFormVisible = false;get_table_data()">取消并关闭</el-button>
         </div>
       </div>
@@ -139,7 +139,7 @@
 
 <script>
 // / 引入
-import { GetDataByName, GetDataByNames,postJson, PostDataByName, ExecDataByConfig, checkButtons, failproccess } from '@/api/common'
+import { GetDataByName, GetDataByNames, postJson, PostDataByName, ExecDataByConfig, checkButtons, failproccess } from '@/api/common'
 import { parseTime } from '@/utils/index.js'
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination
 import { MessageBox } from 'element-ui'
@@ -149,7 +149,7 @@ export default {
   components: { Pagination },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       requestParams: [
         { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
@@ -157,9 +157,9 @@ export default {
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
       ],
-      writeoffList:[{id:1,name:'备件入库'},{id:2,name:'备件退货'},{id:3,name:'备件出库'},{id:4,name:'备件退库'}], //冲销类型
-      invoicedReturnDocList:[{id:0,name:'否'},{id:1,name:'是'}],//是否已开票退货单
-      materialVoucherNoList:[{id:0,name:'11111'},{id:1,name:'2222'}],//物料凭证号
+      writeoffList: [{ id: 1, name: '备件入库' }, { id: 2, name: '备件退货' }, { id: 3, name: '备件出库' }, { id: 4, name: '备件退库' }], // 冲销类型
+      invoicedReturnDocList: [{ id: 0, name: '否' }, { id: 1, name: '是' }], // 是否已开票退货单
+      materialVoucherNoList: [{ id: 0, name: '11111' }, { id: 1, name: '2222' }], // 物料凭证号
       // table1:{
       //   getdataListParm: {
       //     name: 'getBigPartTransferList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
@@ -171,17 +171,17 @@ export default {
       //   },
       //   tableKey: 0, listLoading: false, total: 0, list: [],pageNum:0, pageSize:0
       // },
-      table1:{
+      table1: {
         getdataListParm: {
           name: 'getLaidProofList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
           parammaps: {
             pastureName: Cookies.get('pasturename'),
-            writeoffType:'备件入库',
-            orderNumber:'',
-            hasTicket:''
+            writeoffType: '备件入库',
+            orderNumber: '',
+            hasTicket: ''
           }
         },
-        tableKey: 0, listLoading: false, total: 0, list: [],pageNum:0, pageSize:0
+        tableKey: 0, listLoading: false, total: 0, list: [], pageNum: 0, pageSize: 0
       },
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
@@ -190,10 +190,10 @@ export default {
       textMap: { create: '新增', see: '查看' },
       rules: {
         orderNumber: [{ required: true, message: '必填', trigger: 'blur' }],
-        NumberType: [{ required: true, message: '必填', trigger: 'blur' }],
+        NumberType: [{ required: true, message: '必填', trigger: 'blur' }]
       },
       create: {
-        temp:{ applyDate: parseTime(new Date(), '{y}-{m}-{d}')},
+        temp: { applyDate: parseTime(new Date(), '{y}-{m}-{d}') },
         getdataListParm: {
           name: 'getPartTransferbybigid',
           returntype: 'Map',
@@ -202,9 +202,9 @@ export default {
         getdataListParm2: {
           name: 'getPartlaidByBigid',
           returntype: 'Map',
-          parammaps: {bigid:""}
+          parammaps: { bigid: '' }
         },
-        tableKey: 0, listLoading: false, total: 0, list: [], pageNum:0, pageSize:0
+        tableKey: 0, listLoading: false, total: 0, list: [], pageNum: 0, pageSize: 0
       },
       isokDisable: false,
       pickerOptions: {
@@ -212,9 +212,9 @@ export default {
           return time.getTime() > Date.now()// 当天之前的时间可选
         }
       },
-      isWriteoffAdd:[],
-      isWriteoffSee:[],
-      isWriteoffDel:[]
+      isWriteoffAdd: [],
+      isWriteoffSee: [],
+      isWriteoffDel: []
     }
   },
 
@@ -233,7 +233,7 @@ export default {
       // 新增
       const WriteoffAdd = 'customs:writeoff:add'
       const isWriteoffAdd = checkButtons(this.$store.state.user.buttons, WriteoffAdd)
-      this.isWriteoffAdd= isWriteoffAdd
+      this.isWriteoffAdd = isWriteoffAdd
       // 查看
       const WriteoffSee = 'customs:writeoff:see'
       const isWriteoffSee = checkButtons(this.$store.state.user.buttons, WriteoffSee)
@@ -247,12 +247,12 @@ export default {
     get_table_data() {
       this.table1.listLoading = true
       GetDataByName(this.table1.getdataListParm).then(response => {
-        if(response.data.list){
+        if (response.data.list) {
           console.log('table数据', response.data.list)
           this.table1.list = response.data.list
           this.table1.pageNum = response.data.pageNum
           this.table1.pageSize = response.data.pageSize
-        }else{
+        } else {
           this.table1.list = []
           this.table1.pageNum = 0
           this.table1.pageSize = 0
@@ -274,54 +274,54 @@ export default {
     form_add() {
       this.dialogStatus = 'create'
       this.dialogFormVisible = true
-      this.create.temp = {'materialCode':'','proofYear':'','chargeDate':'','orderNumber':'','hasTicket':'','orderNumberId':'','NumberType':'','rowsNumber':[]}
+      this.create.temp = { 'materialCode': '', 'proofYear': '', 'chargeDate': '', 'orderNumber': '', 'hasTicket': '', 'orderNumberId': '', 'NumberType': '', 'rowsNumber': [] }
       this.create.list = []
     },
-    changeWriteoff(item){
+    changeWriteoff(item) {
       this.getTableFormList()
     },
-    blurOrderNumber(){
+    blurOrderNumber() {
       this.getTableFormList()
     },
-    getTableFormList(){
-      let url = 'authdata/sap/proof/detail'
-      let data = {
-        OrderNumber:this.create.temp.orderNumber,
-        NumberType:this.create.temp.NumberType
+    getTableFormList() {
+      const url = 'authdata/sap/proof/detail'
+      const data = {
+        OrderNumber: this.create.temp.orderNumber,
+        NumberType: this.create.temp.NumberType
       }
-      if(this.create.temp.orderNumber == ''){
+      if (this.create.temp.orderNumber == '') {
         this.$message({ title: '', message: '设备管理平台单号不能为空', type: 'warning', duration: 2000 })
         return
       }
-      if(this.create.temp.NumberType == ''){
+      if (this.create.temp.NumberType == '') {
         this.$message({ title: '', message: '冲销类型不能为空', type: 'warning', duration: 2000 })
         return
       }
-      postJson(url,data).then(response => {
-       console.log(response.msg,'response===')
-       if(response.msg !== 'fail' ){
-          if(response.data){
+      postJson(url, data).then(response => {
+        console.log(response.msg, 'response===')
+        if (response.msg !== 'fail') {
+          if (response.data) {
             this.create.temp = response.data
             this.create.temp.rowsNumber = []
-            if(response.data.parts){
+            if (response.data.parts) {
               this.create.list = response.data.parts
-            }else{
+            } else {
               this.create.list = []
             }
-          }else{
+          } else {
             this.create.list = []
             this.create.temp = {}
           }
-       }else{
+        } else {
           this.$notify({ title: '失败', message: response.message, type: 'warning', duration: 2000 })
-       }
-      }).catch((res)=>{
+        }
+      }).catch((res) => {
         // this.$message({ title: '', message: re, type: 'warning', duration: 2000 })
       })
     },
     handleSelectionChange(val) {
       this.create.temp.rowsNumber = []
-      for(let i=0;i<val.length;i++){
+      for (let i = 0; i < val.length; i++) {
         this.create.temp.rowsNumber.push(val[i].rowNumber)
       }
       console.log(this.create.temp.rowsNumber)
@@ -333,28 +333,28 @@ export default {
       }, 1000)
       this.$refs['create'].validate(valid => {
         if (valid) {
-          console.log('新增保存',this.create.temp.rowsNumber)
-          let url = "authdata/sap/proof/off"
-          let data = {
-            materialCode:this.create.temp.materialCode,
-            proofYear:this.create.temp.proofYear,
-            chargeDate:this.create.temp.chargeDate,
-            orderNumber:this.create.temp.orderNumber,
-            hasTicket:this.create.temp.hasTicket,
-            rowsNumber:this.create.temp.rowsNumber,//[]
-            orderNumberId:this.create.temp.orderNumberId,
-            NumberType:this.create.temp.NumberType
+          console.log('新增保存', this.create.temp.rowsNumber)
+          const url = 'authdata/sap/proof/off'
+          const data = {
+            materialCode: this.create.temp.materialCode,
+            proofYear: this.create.temp.proofYear,
+            chargeDate: this.create.temp.chargeDate,
+            orderNumber: this.create.temp.orderNumber,
+            hasTicket: this.create.temp.hasTicket,
+            rowsNumber: this.create.temp.rowsNumber, // []
+            orderNumberId: this.create.temp.orderNumberId,
+            NumberType: this.create.temp.NumberType
 
           }
-          if(this.create.temp.rowsNumber.length == 0){
-            this.$message({  message: '请选择需要冲销的备件', type: 'warning', duration: 2000 })
+          if (this.create.temp.rowsNumber.length == 0) {
+            this.$message({ message: '请选择需要冲销的备件', type: 'warning', duration: 2000 })
             return
           }
-          postJson(url,data).then(response => {
-            if(response.msg !== 'fail'){
+          postJson(url, data).then(response => {
+            if (response.msg !== 'fail') {
               this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
               this.dialogFormVisible = false
-            }else{
+            } else {
               this.$notify({ title: '失败', message: response.message, type: 'warning', duration: 2000 })
             }
           })
@@ -362,61 +362,62 @@ export default {
       })
     },
 
-
     change_type(item) {
       console.log(item)
-      if(item == "备件入库"){ 
+      if (item == '备件入库') {
         this.table1.getdataListParm.name = 'getLaidProofList'
         this.table1.getdataListParm.parammaps.writeoffType = '备件入库'
-       }
-      if(item == "备件出库"){ this.table1.getdataListParm.name = 'getReturnProofList'
-      this.table1.getdataListParm.parammaps.writeoffType = '备件出库' 
-    }
-      if(item == "备件退库"){ this.table1.getdataListParm.name = 'getQuitProofList' 
-      this.table1.getdataListParm.parammaps.writeoffType = '备件退库' 
-    }
-      if(item == "备件退货"){ this.table1.getdataListParm.name = 'getUseProofList' 
-      this.table1.getdataListParm.parammaps.writeoffType = '备件退货' 
-    }
+      }
+      if (item == '备件出库') {
+        this.table1.getdataListParm.name = 'getReturnProofList'
+        this.table1.getdataListParm.parammaps.writeoffType = '备件出库'
+      }
+      if (item == '备件退库') {
+        this.table1.getdataListParm.name = 'getQuitProofList'
+        this.table1.getdataListParm.parammaps.writeoffType = '备件退库'
+      }
+      if (item == '备件退货') {
+        this.table1.getdataListParm.name = 'getUseProofList'
+        this.table1.getdataListParm.parammaps.writeoffType = '备件退货'
+      }
     },
 
     // 查看
     form_see(row) {
       this.dialogStatus = 'see'
-      
+
       this.create.temp = Object.assign({}, row)
-     
-      console.log('row',row)
 
+      console.log('row', row)
 
       // this.create.getdataListParm.parammaps.id = this.create.temp.id
       // {id:1,name:'备件入库'},{id:2,name:'备件退货'},{id:3,name:'备件出库'},{id:4,name:'备件退库'}
-      if(row.NumberType == 1){
+      if (row.NumberType == 1) {
         this.create.getdataListParm2.name = 'getPartlaidByBigid'
       }
-      if(row.NumberType == 4){
+      if (row.NumberType == 4) {
         this.create.getdataListParm2.name = 'getPartquitByBigid'
       }
-      if(row.NumberType == 2){
+      if (row.NumberType == 2) {
         this.create.getdataListParm2.name = 'getPartrefundByBigid'
       }
-      if(row.NumberType == 3){
+      if (row.NumberType == 3) {
         this.create.getdataListParm2.name = 'getPartuseByBigid'
       }
 
       this.create.getdataListParm2.parammaps.bigid = row.id
       this.getDialogList2()
       // this.getDialogList()
-       this.dialogFormVisible = true
+      this.dialogFormVisible = true
     },
 
     getDialogList2() {
       GetDataByName(this.create.getdataListParm2).then(response => {
-        if(response.data.list){
+        if (response.data.list) {
           this.create.list = response.data.list
           this.create.pageNum = response.data.pageNum
           this.create.pageSize = response.data.pageSize
-        }else{
+        } else {
           this.create.list = []
           this.create.pageNum = 0
           this.create.pageSize = 0
@@ -431,11 +432,11 @@ export default {
     },
     getDialogList() {
       GetDataByName(this.create.getdataListParm).then(response => {
-        if(response.data.list){
+        if (response.data.list) {
           this.create.list = response.data.list
           this.create.pageNum = response.data.pageNum
           this.create.pageSize = response.data.pageSize
-        }else{
+        } else {
           this.create.list = []
           this.create.pageNum = 0
           this.create.pageSize = 0
@@ -452,20 +453,20 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllPasture2 = response.data.getPastureList.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
       })
     },
 
-    handleDelate(row){
+    handleDelate(row) {
       MessageBox.confirm('确认删除此条信息?', {
         confirmButtonText: '确认',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-      console.log('删除')
+        console.log('删除')
       }).catch(() => {
         this.$message({ type: 'info', message: '已取消删除' })
       })

+ 107 - 108
src/views/custom/writeoff/index2.vue

@@ -7,12 +7,12 @@
       <el-select v-model="table1.getdataListParm.parammaps.writeoffType" style="width: 140px;" placeholder="冲销类型" class="filter-item" @change="change_type">
         <el-option v-for="item in writeoffList" :key="item.id" :label="item.name" :value="item.name" />
       </el-select>
-      <el-input  v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="设备管理平台单号" style="width: 200px;" class="filter-item" />
-       <!-- <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="入库单号" style="width: 200px;" class="filter-item" />
+      <el-input v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="设备管理平台单号" style="width: 200px;" class="filter-item" />
+      <!-- <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="入库单号" style="width: 200px;" class="filter-item" />
       <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件出库'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="出库单号" style="width: 200px;" class="filter-item" />
       <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件退库'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="退库单号" style="width: 200px;" class="filter-item" />
 index copy      <el-input v-if="table1.getdataListParm.parammaps.writeoffType == '备件退货'" v-model="table1.getdataListParm.parammaps.orderNumber" placeholder="退货单号" style="width: 200px;" class="filter-item" />  -->
-      <el-select v-model="table1.getdataListParm.parammaps.hasTicket" style="width: 180px;" clearable placeholder="是否已开票" class="filter-item" v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库' || table1.getdataListParm.parammaps.writeoffType == '备件退货'">
+      <el-select v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库' || table1.getdataListParm.parammaps.writeoffType == '备件退货'" v-model="table1.getdataListParm.parammaps.hasTicket" style="width: 180px;" clearable placeholder="是否已开票" class="filter-item">
         <el-option v-for="item in invoicedReturnDocList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
       <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
@@ -44,14 +44,14 @@ index copy      <el-input v-if="table1.getdataListParm.parammaps.writeoffType ==
       <el-table-column label="物料凭证年度" min-width="150px" align="center" prop="proofYear" />
       <el-table-column label="凭证中的过账信息" min-width="150px" align="center" prop="chargeDate" />
       <el-table-column label="设备管理平台单号" min-width="150px" align="center" prop="orderNumber" />
- 
-      <el-table-column label="是否已开票" min-width="150px" align="center" show-overflow-tooltip v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库' || table1.getdataListParm.parammaps.writeoffType == '备件退货'" >
-            <template slot-scope="scope">
-              <span v-if="scope.row.hasTicket == 1">是</span>
-              <span v-if="scope.row.hasTicket == 0">否</span>
-              <span v-if="scope.row.hasTicket == ''"> </span>
-            </template>
-          </el-table-column>
+
+      <el-table-column v-if="table1.getdataListParm.parammaps.writeoffType == '备件入库' || table1.getdataListParm.parammaps.writeoffType == '备件退货'" label="是否已开票" min-width="150px" align="center" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span v-if="scope.row.hasTicket == 1">是</span>
+          <span v-if="scope.row.hasTicket == 0">否</span>
+          <span v-if="scope.row.hasTicket == ''" />
+        </template>
+      </el-table-column>
       <el-table-column label="设备管理平台行号" min-width="150px" align="center" prop="rowNumber" />
       <el-table-column label="状态" min-width="150px" align="center" prop="status" />
       <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
@@ -102,7 +102,7 @@ index copy      <el-input v-if="table1.getdataListParm.parammaps.writeoffType ==
             </el-col>
             <el-col :span="8">
               <el-form-item label="物料凭证年度:" prop="proofYear">
-                <el-input ref="proofYear" v-model="create.temp.proofYear" disabled  placeholder="" />
+                <el-input ref="proofYear" v-model="create.temp.proofYear" disabled placeholder="" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -119,8 +119,8 @@ index copy      <el-input v-if="table1.getdataListParm.parammaps.writeoffType ==
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable"
-          >
-      
+        >
+
           <el-table-column label="行号" align="center" prop="rowNumber" width="50px" />
           <el-table-column label="备件编号" prop="partCode" align="center" min-width="90" />
           <el-table-column label="备件名称" prop="partName" align="center" min-width="90" />
@@ -133,7 +133,7 @@ index copy      <el-input v-if="table1.getdataListParm.parammaps.writeoffType ==
           <el-table-column label="总价" prop="totalPrice" align="center" min-width="90" />
         </el-table>
         <div slot="footer" class="dialog-footer" style="bottom:10px">
-          <el-button type="primary" v-if="dialogStatus=='create'" :disabled="isokDisable" @click="add_dialog_save()">保存并关闭</el-button>
+          <el-button v-if="dialogStatus=='create'" type="primary" :disabled="isokDisable" @click="add_dialog_save()">保存并关闭</el-button>
           <el-button @click="dialogFormVisible = false;get_table_data()">取消并关闭</el-button>
         </div>
       </div>
@@ -143,7 +143,7 @@ index copy      <el-input v-if="table1.getdataListParm.parammaps.writeoffType ==
 
 <script>
 // / 引入
-import { GetDataByName, GetDataByNames,postJson, PostDataByName, ExecDataByConfig, checkButtons, failproccess } from '@/api/common'
+import { GetDataByName, GetDataByNames, postJson, PostDataByName, ExecDataByConfig, checkButtons, failproccess } from '@/api/common'
 import { parseTime } from '@/utils/index.js'
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination
 import { MessageBox } from 'element-ui'
@@ -153,23 +153,24 @@ export default {
   components: { Pagination },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       findAllPasture: [],
       requestParams: [
         { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'getPastureList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: {}},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
-      writeoffList:[
-        {id:1,name:'备件入库'},
+      writeoffList: [
+        { id: 1, name: '备件入库' },
         // {id:2,name:'备件退货'},
-        {id:3,name:'备件出库'},
+        { id: 3, name: '备件出库' }
         // {id:4,name:'备件退库'}
-      ], //冲销类型
-      invoicedReturnDocList:[{id:0,name:'否'},{id:1,name:'是'}],//是否已开票退货单
-      materialVoucherNoList:[{id:0,name:'11111'},{id:1,name:'2222'}],//物料凭证号
+      ], // 冲销类型
+      invoicedReturnDocList: [{ id: 0, name: '否' }, { id: 1, name: '是' }], // 是否已开票退货单
+      materialVoucherNoList: [{ id: 0, name: '11111' }, { id: 1, name: '2222' }], // 物料凭证号
       // table1:{
       //   getdataListParm: {
       //     name: 'getBigPartTransferList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
@@ -181,18 +182,18 @@ export default {
       //   },
       //   tableKey: 0, listLoading: false, total: 0, list: [],pageNum:0, pageSize:0
       // },
-      table1:{
+      table1: {
         getdataListParm: {
           name: 'getLaidProofList', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
           parammaps: {
-            
+
             pastureName: Cookies.get('pasturename'),
-            writeoffType:'备件入库',
-            orderNumber:'',
-            hasTicket:''
+            writeoffType: '备件入库',
+            orderNumber: '',
+            hasTicket: ''
           }
         },
-        tableKey: 0, listLoading: false, total: 0, list: [],pageNum:0, pageSize:0
+        tableKey: 0, listLoading: false, total: 0, list: [], pageNum: 0, pageSize: 0
       },
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
@@ -201,10 +202,10 @@ export default {
       textMap: { create: '新增', see: '查看' },
       rules: {
         orderNumber: [{ required: true, message: '必填', trigger: 'blur' }],
-        NumberType: [{ required: true, message: '必填', trigger: 'blur' }],
+        NumberType: [{ required: true, message: '必填', trigger: 'blur' }]
       },
       create: {
-        temp:{ applyDate: parseTime(new Date(), '{y}-{m}-{d}')},
+        temp: { applyDate: parseTime(new Date(), '{y}-{m}-{d}') },
         getdataListParm: {
           name: 'getPartTransferbybigid',
           returntype: 'Map',
@@ -213,9 +214,9 @@ export default {
         getdataListParm2: {
           name: 'getPartlaidByBigid',
           returntype: 'Map',
-          parammaps: {bigid:""}
+          parammaps: { bigid: '' }
         },
-        tableKey: 0, listLoading: false, total: 0, list: [], pageNum:0, pageSize:0
+        tableKey: 0, listLoading: false, total: 0, list: [], pageNum: 0, pageSize: 0
       },
       isokDisable: false,
       pickerOptions: {
@@ -223,9 +224,9 @@ export default {
           return time.getTime() > Date.now()// 当天之前的时间可选
         }
       },
-      isWriteoffAdd:[],
-      isWriteoffSee:[],
-      isWriteoffDel:[]
+      isWriteoffAdd: [],
+      isWriteoffSee: [],
+      isWriteoffDel: []
     }
   },
 
@@ -244,7 +245,7 @@ export default {
       // 新增
       const WriteoffAdd = 'customs:writeoff:add'
       const isWriteoffAdd = checkButtons(this.$store.state.user.buttons, WriteoffAdd)
-      this.isWriteoffAdd= isWriteoffAdd
+      this.isWriteoffAdd = isWriteoffAdd
       // 查看
       const WriteoffSee = 'customs:writeoff:see'
       const isWriteoffSee = checkButtons(this.$store.state.user.buttons, WriteoffSee)
@@ -258,12 +259,12 @@ export default {
     get_table_data() {
       this.table1.listLoading = true
       GetDataByName(this.table1.getdataListParm).then(response => {
-        if(response.data.list){
+        if (response.data.list) {
           console.log('table数据', response.data.list)
           this.table1.list = response.data.list
           this.table1.pageNum = response.data.pageNum
           this.table1.pageSize = response.data.pageSize
-        }else{
+        } else {
           this.table1.list = []
           this.table1.pageNum = 0
           this.table1.pageSize = 0
@@ -285,52 +286,52 @@ export default {
     form_add() {
       this.dialogStatus = 'create'
       this.dialogFormVisible = true
-      this.create.temp = {'materialCode':'','proofYear':'','chargeDate':'','orderNumber':'','hasTicket':'','orderNumberId':'','NumberType':'','rowsNumber':[]}
+      this.create.temp = { 'materialCode': '', 'proofYear': '', 'chargeDate': '', 'orderNumber': '', 'hasTicket': '', 'orderNumberId': '', 'NumberType': '', 'rowsNumber': [] }
       this.create.list = []
     },
-    changeWriteoff(item){
+    changeWriteoff(item) {
       this.getTableFormList()
     },
-    blurOrderNumber(){
+    blurOrderNumber() {
       this.getTableFormList()
     },
-    getTableFormList(){
-      let url = 'authdata/sap/proof/detail'
-      let data = {
-        OrderNumber:this.create.temp.orderNumber,
-        NumberType:this.create.temp.NumberType
+    getTableFormList() {
+      const url = 'authdata/sap/proof/detail'
+      const data = {
+        OrderNumber: this.create.temp.orderNumber,
+        NumberType: this.create.temp.NumberType
       }
-      if(this.create.temp.orderNumber == ''){
+      if (this.create.temp.orderNumber == '') {
         this.$message({ title: '', message: '设备管理平台单号不能为空', type: 'warning', duration: 2000 })
         return
       }
-      if(this.create.temp.NumberType == ''){
+      if (this.create.temp.NumberType == '') {
         this.$message({ title: '', message: '冲销类型不能为空', type: 'warning', duration: 2000 })
         return
       }
-      postJson(url,data).then(response => {
-       console.log(response.msg,'response===')
-       if(response.msg !== 'fail' ){
-          if(response.data){
+      postJson(url, data).then(response => {
+        console.log(response.msg, 'response===')
+        if (response.msg !== 'fail') {
+          if (response.data) {
             this.create.temp = response.data
             this.create.temp.rowsNumber = []
-            if(response.data.parts){
+            if (response.data.parts) {
               this.create.list = response.data.parts
-            }else{
+            } else {
               this.create.list = []
             }
-          }else{
+          } else {
             this.create.list = []
             this.create.temp = {}
           }
-       }else{
+        } else {
           this.$notify({ title: '失败', message: response.message, type: 'warning', duration: 2000 })
-       }
-      }).catch((res)=>{
+        }
+      }).catch((res) => {
         // this.$message({ title: '', message: re, type: 'warning', duration: 2000 })
       })
     },
-   
+
     add_dialog_save() {
       this.isokDisable = true
       setTimeout(() => {
@@ -338,40 +339,37 @@ export default {
       }, 1000)
 
       var rowsNumberArr = []
- 
 
-      this.create.list.forEach(function(item){
+      this.create.list.forEach(function(item) {
         rowsNumberArr.push(item.rowNumber)
       })
 
-      console.log('rowsNumberArr',rowsNumberArr)
-
-
+      console.log('rowsNumberArr', rowsNumberArr)
 
       this.$refs['create'].validate(valid => {
         if (valid) {
           // console.log('新增保存',this.create.temp.rowsNumber)
-          let url = "authdata/sap/proof/off"
-          let data = {
-            materialCode:this.create.temp.materialCode,
-            proofYear:this.create.temp.proofYear,
-            chargeDate:this.create.temp.chargeDate,
-            orderNumber:this.create.temp.orderNumber,
-            hasTicket:this.create.temp.hasTicket,
-            rowsNumber:rowsNumberArr,//[]
-            orderNumberId:this.create.temp.orderNumberId,
-            NumberType:this.create.temp.NumberType
+          const url = 'authdata/sap/proof/off'
+          const data = {
+            materialCode: this.create.temp.materialCode,
+            proofYear: this.create.temp.proofYear,
+            chargeDate: this.create.temp.chargeDate,
+            orderNumber: this.create.temp.orderNumber,
+            hasTicket: this.create.temp.hasTicket,
+            rowsNumber: rowsNumberArr, // []
+            orderNumberId: this.create.temp.orderNumberId,
+            NumberType: this.create.temp.NumberType
 
           }
-          if(rowsNumberArr.length == 0){
-            this.$message({  message: '暂无冲销的备件,请稍等……', type: 'warning', duration: 2000 })
+          if (rowsNumberArr.length == 0) {
+            this.$message({ message: '暂无冲销的备件,请稍等……', type: 'warning', duration: 2000 })
             return
           }
-          postJson(url,data).then(response => {
-            if(response.msg !== 'fail'){
+          postJson(url, data).then(response => {
+            if (response.msg !== 'fail') {
               this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
               this.dialogFormVisible = false
-            }else{
+            } else {
               this.$notify({ title: '失败', message: response.message, type: 'warning', duration: 2000 })
             }
           })
@@ -379,61 +377,62 @@ export default {
       })
     },
 
-
     change_type(item) {
       console.log(item)
-      if(item == "备件入库"){ 
+      if (item == '备件入库') {
         this.table1.getdataListParm.name = 'getLaidProofList'
         this.table1.getdataListParm.parammaps.writeoffType = '备件入库'
-       }
-      if(item == "备件出库"){ this.table1.getdataListParm.name = 'getReturnProofList'
-      this.table1.getdataListParm.parammaps.writeoffType = '备件出库' 
-    }
-      if(item == "备件退库"){ this.table1.getdataListParm.name = 'getQuitProofList' 
-      this.table1.getdataListParm.parammaps.writeoffType = '备件退库' 
-    }
-      if(item == "备件退货"){ this.table1.getdataListParm.name = 'getUseProofList' 
-      this.table1.getdataListParm.parammaps.writeoffType = '备件退货' 
-    }
+      }
+      if (item == '备件出库') {
+        this.table1.getdataListParm.name = 'getReturnProofList'
+        this.table1.getdataListParm.parammaps.writeoffType = '备件出库'
+      }
+      if (item == '备件退库') {
+        this.table1.getdataListParm.name = 'getQuitProofList'
+        this.table1.getdataListParm.parammaps.writeoffType = '备件退库'
+      }
+      if (item == '备件退货') {
+        this.table1.getdataListParm.name = 'getUseProofList'
+        this.table1.getdataListParm.parammaps.writeoffType = '备件退货'
+      }
     },
 
     // 查看
     form_see(row) {
       this.dialogStatus = 'see'
-      
+
       this.create.temp = Object.assign({}, row)
-     
-      console.log('row',row)
 
+      console.log('row', row)
 
       // this.create.getdataListParm.parammaps.id = this.create.temp.id
       // {id:1,name:'备件入库'},{id:2,name:'备件退货'},{id:3,name:'备件出库'},{id:4,name:'备件退库'}
-      if(row.NumberType == 1){
+      if (row.NumberType == 1) {
         this.create.getdataListParm2.name = 'getPartlaidByBigid'
       }
-      if(row.NumberType == 4){
+      if (row.NumberType == 4) {
         this.create.getdataListParm2.name = 'getPartquitByBigid'
       }
-      if(row.NumberType == 2){
+      if (row.NumberType == 2) {
         this.create.getdataListParm2.name = 'getPartrefundByBigid'
       }
-      if(row.NumberType == 3){
+      if (row.NumberType == 3) {
         this.create.getdataListParm2.name = 'getPartuseByBigid'
       }
 
       this.create.getdataListParm2.parammaps.bigid = row.id
       this.getDialogList2()
       // this.getDialogList()
-       this.dialogFormVisible = true
+      this.dialogFormVisible = true
     },
 
     getDialogList2() {
       GetDataByName(this.create.getdataListParm2).then(response => {
-        if(response.data.list){
+        if (response.data.list) {
           this.create.list = response.data.list
           this.create.pageNum = response.data.pageNum
           this.create.pageSize = response.data.pageSize
-        }else{
+        } else {
           this.create.list = []
           this.create.pageNum = 0
           this.create.pageSize = 0
@@ -448,11 +447,11 @@ export default {
     },
     getDialogList() {
       GetDataByName(this.create.getdataListParm).then(response => {
-        if(response.data.list){
+        if (response.data.list) {
           this.create.list = response.data.list
           this.create.pageNum = response.data.pageNum
           this.create.pageSize = response.data.pageSize
-        }else{
+        } else {
           this.create.list = []
           this.create.pageNum = 0
           this.create.pageSize = 0
@@ -469,20 +468,20 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllPasture2 = response.data.getPastureList.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
       })
     },
 
-    handleDelate(row){
+    handleDelate(row) {
       MessageBox.confirm('确认删除此条信息?', {
         confirmButtonText: '确认',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-      console.log('删除')
+        console.log('删除')
       }).catch(() => {
         this.$message({ type: 'info', message: '已取消删除' })
       })

+ 4 - 3
src/views/electro/electroData/index.vue

@@ -403,7 +403,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       tableKey: 0,
       list: null,
       total: 0,
@@ -443,7 +443,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
 
       temp: {
@@ -532,7 +533,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list

+ 21 - 35
src/views/evaluationVerification/assessment/index.vue

@@ -11,11 +11,10 @@
         </el-select>
         <el-date-picker ref="inputDatetime" v-model="getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
 
-        <el-select ref="statue" v-model="judgetypeARR" style="width:300px" class="filter-item" clearable  multiple >
-             <el-option v-for="item in getAssessmentList" :key="item.statue" :label="item.statue" :value="item.statue" />
+        <el-select ref="statue" v-model="judgetypeARR" style="width:300px" class="filter-item" clearable multiple>
+          <el-option v-for="item in getAssessmentList" :key="item.statue" :label="item.statue" :value="item.statue" />
         </el-select>
 
-
         <el-input
           v-model="getdataListParm.parammaps.empName"
           placeholder="评估人"
@@ -24,12 +23,9 @@
           class="filter-item"
         />
 
-
-
-
         <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
 
-        <el-button  class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
+        <el-button class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
 
       </div>
       <div class="app-btn">
@@ -389,7 +385,7 @@ import waves from '@/directive/waves'
 import Cookies from 'js-cookie'
 import Pagination from '@/components/Pagination'
 import { MessageBox } from 'element-ui'
-import { parseTime, sortChange, json2excel  } from '@/utils/index.js'
+import { parseTime, sortChange, json2excel } from '@/utils/index.js'
 import { getToken } from '@/utils/auth'
 import table2excel from 'js-table2excel'
 
@@ -399,7 +395,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       findAllPasture: [],
@@ -408,12 +404,13 @@ export default {
       requestParams: [
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'getAssessmentList', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'getAssessmentList', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       isokDisable: false,
       List1: true,
       List2: false, // 评估检查管理
-      getAssessmentList:[],
+      getAssessmentList: [],
       rules: {
         statue: [{ required: true, message: '必填', trigger: 'blur' }]
       },
@@ -427,7 +424,7 @@ export default {
         parammaps: {
           pastureName: Cookies.get('pasturename'),
           judgetype: '',
-          empName:'',
+          empName: '',
           startTime: '',
           stopTime: '',
           inputDatetime: ''
@@ -556,9 +553,9 @@ export default {
   methods: {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
-        this.getAssessmentList =  response.data.getAssessmentList.list
+        this.getAssessmentList = response.data.getAssessmentList.list
       })
     },
     get_table_data() {
@@ -574,11 +571,10 @@ export default {
 
       console.log(this.getdataListParm.parammaps, '------------------')
 
-
-      if(this.judgetypeARR.length !== 0){
-        this.getdataListParm.parammaps.judgetype = this.judgetypeARR.join(",")
-      }else{
-        this.getdataListParm.parammaps.judgetype = ""
+      if (this.judgetypeARR.length !== 0) {
+        this.getdataListParm.parammaps.judgetype = this.judgetypeARR.join(',')
+      } else {
+        this.getdataListParm.parammaps.judgetype = ''
       }
       GetDataByName(this.getdataListParm).then(response => {
         this.list = response.data.list
@@ -1137,7 +1133,6 @@ export default {
       })
     },
 
-
     handleDownload() {
       console.log('点击了导出')
       this.$alert('评估验证信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
@@ -1152,16 +1147,16 @@ export default {
         this.percentage = this.percentage
       }, 1000)
 
-      var send_data =   {
-        name: 'getjudgeListByExcel',   page: 1,  offset: 1,  pagecount: 0,
+      var send_data = {
+        name: 'getjudgeListByExcel', page: 1, offset: 1, pagecount: 0,
         returntype: 'Map',
         parammaps: {
-          formType:'评估验证信息',
+          formType: '评估验证信息',
           pastureName: this.getdataListParm.parammaps.pastureName,
-          judgetype:this.getdataListParm.parammaps.judgetype,
-          startTime:this.getdataListParm.parammaps.startTime,
+          judgetype: this.getdataListParm.parammaps.judgetype,
+          startTime: this.getdataListParm.parammaps.startTime,
           stopTime: this.getdataListParm.parammaps.stopTime,
-          empName: this.getdataListParm.parammaps.empName,
+          empName: this.getdataListParm.parammaps.empName
 
         }
       }
@@ -1232,18 +1227,9 @@ export default {
           const excelName = '评估验证'
           table2excel(column, data, excelName)
         }
-
       })
-
-
-
-
     },
 
-
-
-
-
     handleInspectionStandard() {
       console.log('点击了检查标准管理')
       // table1隐藏/table2显示

+ 2 - 1
src/views/evaluationVerification/assessment/index1.vue

@@ -384,7 +384,8 @@ export default {
       inspectionResultsList: [{ id: 1, name: 1 }, { id: 2, name: 2 }, { id: 3, name: 3 }, { id: 4, name: 4 }, { id: 5, name: 5 }],
       requestParams: [
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       isokDisable: false,
       List1: true,

+ 2 - 1
src/views/form/index.vue

@@ -51,7 +51,8 @@ export default {
       },
       width: '',
       requestParams: [
-        { name: 'getcustompicbycustomid', offset: 0, pagecount: 0, params: [1] }
+        { name: 'getcustompicbycustomid', offset: 0, pagecount: 0, params: [1] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       requestParam: {
         name: 'deletecustompic',

+ 50 - 61
src/views/maintenance/maintain/index.vue

@@ -84,7 +84,7 @@
       </el-table-column>
       <el-table-column label="保养人" min-width="100px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.upkeepPerson}}</span>
+          <span>{{ scope.row.upkeepPerson }}</span>
         </template>
       </el-table-column>
       <el-table-column label="保养日期" sortable prop="plantime" min-width="80px" align="center" />
@@ -100,12 +100,12 @@
         </template>
       </el-table-column>
       <el-table-column label="审核状态" min-width="80px" align="center" :formatter="SHStatue" />
-		<el-table-column prop="img" label="保养过程" width="180" align="center">
+      <el-table-column prop="img" label="保养过程" width="180" align="center">
         <template slot-scope="scope">
           <!-- <el-link @click="preview(scope.row)" v-if="scope.row.videoTxt == '已录制'">{{ scope.row.videoTxt }} </el-link> -->
-           <a style="border-bottom: 1px solid #333;" @click="preview(scope.row)" v-if="scope.row.videoTxt == '已录制'">{{ scope.row.videoTxt }}</a>
-          <el-link  v-if="scope.row.videoTxt == '未录制'">未录制 </el-link>
-          <el-link  v-if="scope.row.videoTxt == '已录制未上传'">已录制未上传 </el-link>
+          <a v-if="scope.row.videoTxt == '已录制'" style="border-bottom: 1px solid #333;" @click="preview(scope.row)">{{ scope.row.videoTxt }}</a>
+          <el-link v-if="scope.row.videoTxt == '未录制'">未录制 </el-link>
+          <el-link v-if="scope.row.videoTxt == '已录制未上传'">已录制未上传 </el-link>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" min-width="300" class-name="small-padding fixed-width" fixed="right">
@@ -131,7 +131,7 @@
     </el-table>
     <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
     <!-- 查看 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false"  v-if ="dialogFormVisible_See" width="90%">
+    <el-dialog v-if="dialogFormVisible_See" :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false" width="90%">
       <div class="app-see">
         <div v-if="statue1" class="see">
           <el-form
@@ -943,7 +943,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 250,
+      myHeight: document.documentElement.clientHeight - 85 - 250,
       active: 0,
       activeList: [],
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
@@ -959,7 +959,9 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['保养模板执行动作'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['保养模板执行动作'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
+
       ],
       getDepartParam: {
         name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
@@ -1208,7 +1210,7 @@ export default {
     // },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list
         this.getDepartDownList()
@@ -1225,7 +1227,7 @@ export default {
       this.getDepartDownList()
     },
 
-    close_diago(){
+    close_diago() {
       console.log(11111111111111)
       this.dialogFormVisible_See = false
     },
@@ -1375,10 +1377,8 @@ export default {
         return '审核中'
       } else if (cellValue.SHStatue == 4) {
         return '未通过'
-
       } else if (cellValue.SHStatue == 8) {
         return '未通过'
-
       } else if (cellValue.SHStatue == 7) {
         return '已通过'
       }
@@ -1400,26 +1400,22 @@ export default {
       var reason = '未通过原因:' + this.seeTemp.workflowNote
       var scores = '评分:' + this.seeTemp.scores + '分'
       if (this.seeTemp.SHStatue === 1) {
-        this.activeList = [{ title: '保养人审核' }, { title: '机修审核' },   { title: '设备主管审核' }]
+        this.activeList = [{ title: '保养人审核' }, { title: '机修审核' }, { title: '设备主管审核' }]
         this.active = 0
-
       } else if (this.seeTemp.SHStatue === 2) {
-        this.activeList = [{ title: '保养人审核', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核' },  { title: '设备主管审核' }]
+        this.activeList = [{ title: '保养人审核', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核' }, { title: '设备主管审核' }]
         this.active = 1
-
       } else if (this.seeTemp.SHStatue === 3) {
         this.active = 2
-        this.activeList = [{ title: '保养人审核', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, status: '', reason: '', scores: scores },   { title: '设备主管审核' }]
+        this.activeList = [{ title: '保养人审核', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, status: '', reason: '', scores: scores }, { title: '设备主管审核' }]
       } else if (this.seeTemp.SHStatue === 4) {
         this.active = 2
         this.activeList = [{ title: '保养人审核', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, status: 'error', reason: reason }, { title: '设备主管审核' }]
-
-
       } else if (this.seeTemp.SHStatue === 7) {
-        this.activeList = [{ title: '保养人审核', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, status: '', reason: '', scores: scores },  { title: '设备主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }]
+        this.activeList = [{ title: '保养人审核', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, status: '', reason: '', scores: scores }, { title: '设备主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }]
         this.active = 3
       } else if (this.seeTemp.SHStatue === 8) {
-        this.activeList = [{ title: '保养人审核', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, status: '', reason: '', scores: scores },   { title: '设备主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }]
+        this.activeList = [{ title: '保养人审核', name: this.seeTemp.upkeepPerson, date: this.seeTemp.finishedTime, status: '', reason: '' }, { title: '机修审核', date: this.seeTemp.useChargeDate, name: this.seeTemp.useChargePerson, status: '', reason: '', scores: scores }, { title: '设备主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }]
         this.active = 3
       }
       this.dialogStatus = 'see'
@@ -1800,51 +1796,44 @@ export default {
           this.requestParam.parammaps.id = this.maintainCompleteTemp.id
           PostDataByName(this.requestParam).then((response) => {
             if (response.msg !== 'fail') {
-
-
-              //如果有设备记录仪的权限
-              if(this.maintainCompleteTemp.isVideoBtnShow == '1'){
+              // 如果有设备记录仪的权限
+              if (this.maintainCompleteTemp.isVideoBtnShow == '1') {
                 // 临时注释
-                  if (this.maintainCompleteTemp.videoTxt == '已录制') {
-                    this.requestParam2.name = 'upkeepChargDone'
-                    this.requestParam2.parammaps = {}
-                    this.requestParam2.parammaps.id = this.maintainCompleteTemp.id
-                    this.requestParam2.parammaps.statue = 7
-                    this.requestParam2.parammaps.orderStatue = 2
-                    this.requestParam2.parammaps.empId = Cookies.get('employeid')
-                    PostDataByName(this.requestParam2).then(response => {
-                      if (response.msg !== 'fail') {
-                        if (this.getdataListParm.parammaps.inputDatetime === null) {
-                          this.getdataListParm.parammaps.inputDatetime = ''
-                        }
-                        this.get_table_data()
-                        this.dialogFormVisible_maintainComplete = false
-                        this.dialogFormVisible_See = false
-                        this.getPendingList()
-                        this.$notify({ title: '成功', message: '成功', type: 'success', duration: 2000 })
-                      } else {
-                        failproccess(response, this.$notify)
+                if (this.maintainCompleteTemp.videoTxt == '已录制') {
+                  this.requestParam2.name = 'upkeepChargDone'
+                  this.requestParam2.parammaps = {}
+                  this.requestParam2.parammaps.id = this.maintainCompleteTemp.id
+                  this.requestParam2.parammaps.statue = 7
+                  this.requestParam2.parammaps.orderStatue = 2
+                  this.requestParam2.parammaps.empId = Cookies.get('employeid')
+                  PostDataByName(this.requestParam2).then(response => {
+                    if (response.msg !== 'fail') {
+                      if (this.getdataListParm.parammaps.inputDatetime === null) {
+                        this.getdataListParm.parammaps.inputDatetime = ''
                       }
-                    })
-                  }
+                      this.get_table_data()
+                      this.dialogFormVisible_maintainComplete = false
+                      this.dialogFormVisible_See = false
+                      this.getPendingList()
+                      this.$notify({ title: '成功', message: '成功', type: 'success', duration: 2000 })
+                    } else {
+                      failproccess(response, this.$notify)
+                    }
+                  })
+                }
               // 临时注释
-              }else{
-                //正常流程。没有记录仪权限
+              } else {
+                // 正常流程。没有记录仪权限
 
-                 if (this.getdataListParm.parammaps.inputDatetime === null) {
-                    this.getdataListParm.parammaps.inputDatetime = ''
-                  }
-                  this.dialogFormVisible_maintainComplete = false
-                  this.dialogFormVisible_See = false
-                  this.$notify({ title: '成功', message: '成功', type: 'success', duration: 2000 })
-                  this.get_table_data()
-                  this.getPendingList()
+                if (this.getdataListParm.parammaps.inputDatetime === null) {
+                  this.getdataListParm.parammaps.inputDatetime = ''
+                }
+                this.dialogFormVisible_maintainComplete = false
+                this.dialogFormVisible_See = false
+                this.$notify({ title: '成功', message: '成功', type: 'success', duration: 2000 })
+                this.get_table_data()
+                this.getPendingList()
               }
-
-
-
-
-
             } else {
               failproccess(response, this.$notify)
             }

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 558 - 653
src/views/maintenance/maintenancePlan/index.vue


+ 3 - 2
src/views/maintenance/repair/index.vue

@@ -1651,6 +1651,7 @@ export default {
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllProviderByCt', offset: 0, pagecount: 0, parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       orderStatues: [{ id: '0', name: '待接单' }, { id: '1', name: '维修中' }, { id: '2', name: '维修完成' }],
       SHStatues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
@@ -2196,11 +2197,11 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture =response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart1.list
         this.findAllEmploye = response.data.findAllEmploye.list
 
-        this.pastureNameList = response.data.findAllPasture.list
+        this.pastureNameList =response.data.getPastureRoleList.list// response.data.findAllPasture.list
         console.log("牧场下拉框", this.pastureNameList)
         this.employeNameList = response.data.findAllEmploye.list
         console.log("申请人下拉框", this.employeNameList)

+ 4 - 3
src/views/maintenance/spotCheck/index.vue

@@ -317,7 +317,7 @@ export default {
   directives: { waves },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       isSpotCheckAdd: [],
       isSpotCheckUpdate: [],
       isSpotCheckDelate: [],
@@ -389,7 +389,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
 
       postDataPramas: {
@@ -706,7 +707,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list //  response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list

+ 1567 - 1625
src/views/maintenance/subcontractingMainten/tabPage/tab1.vue

@@ -1,1625 +1,1567 @@
-<template>
-  <div class="app-container">
-    <div class="filter-container">
-
-      <el-select v-model="tableObj1.getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="change_pasture1">
-        <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.name" />
-      </el-select>
-
-      <el-select v-model="tableObj1.getdataListParm.parammaps.departmentId" clearable style="width: 140px;" placeholder="部门" class="filter-item">
-        <el-option v-for="item in departNameList1" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-
-      <el-input v-model="tableObj1.getdataListParm.parammaps.outsourcingCode" placeholder="委外维修单号" style="width: 200px;" class="filter-item" />
-
-      <el-select v-model="tableObj1.getdataListParm.parammaps.status" style="width: 140px;" clearable placeholder="审核状态" class="filter-item">
-        <el-option v-for="item in statuesNameList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-
-      <el-input v-model="tableObj1.getdataListParm.parammaps.eqName" placeholder="设备名称" style="width: 200px;" class="filter-item" />
-
-      <el-input v-model="tableObj1.getdataListParm.parammaps.eqCode" placeholder="设备内部编号" style="width: 200px;" class="filter-item" />
-
-      <el-input v-model="tableObj1.getdataListParm.parammaps.contractCode" placeholder="合同编号" style="width: 200px;" class="filter-item" />
-
-      <el-date-picker ref="inputDatetime" v-model="tableObj1.getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
-
-
-
-      <el-button  class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
-
-      <el-button v-if="istab1Add" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
-
-
-
-    </div>
-
-
-    <div class="elTable">
-      <el-table :max-height="myHeight" :key="tableObj1.tableKey"  v-loading="tableObj1.listLoading" element-loading-text="给我一点时间"  :data="tableObj1.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed"   >
-
-
-        <el-table-column label="序号" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (tableObj1.pageNum-1) * tableObj1.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
-
-        <el-table-column label="委外单号" min-width="120px" align="center" prop="outsourcingCode" />
-        <el-table-column label="牧场" min-width="120px" align="center" prop="pastureName" />
-        <el-table-column label="责任部门 " min-width="120px" align="center" prop="departmentName" />
-        <el-table-column label="合同" min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.contract ==1 ">有</span>
-            <span v-else>无</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="申请人" min-width="120px" align="center" prop="applicantName" />
-        <el-table-column label="日期" min-width="120px" align="center" prop="date" />
-        <el-table-column label="审核状态" min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.status == 0 ">审核中</span>
-            <span v-else-if="scope.row.status == 1 ">审核通过</span>
-            <span v-else>审核未通过</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" align="center" width="260" class-name="small-padding fixed-width" fixed="right">
-        <template slot-scope="{row}">
-          <el-button   type="primary" size="mini" @click="form_see(row)">查看</el-button>
-          <el-button v-if="istab1Edit && (row.status !== 0) && (row.status !== 1) "  type="success" size="mini" @click="form_edit(row)">编辑</el-button>
-          <el-button v-if="istab1Del && (row.status !== 1) "  type="danger" size="mini" @click="form_delete(row)">删除</el-button>
-
-          <el-button  v-if="istab1Shenhe1 && (row.status== 0) && (row.flowCompeleted == 1) "  style="display:inline-block" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
-
-          <el-button v-else style="display:none" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
-
-          <el-button   v-if="istab1Shenhe2 && (row.status== 0) && (row.flowCompeleted == 2 )" style="display:inline-block" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
-          <el-button v-else style="display:none" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
-
-          <el-button   v-if="istab1Shenhe3 && (row.status== 0) && (row.flowCompeleted == 4)" style="display:inline-block" type="success" size="mini" @click="form_examine3(row)">审核3</el-button>
-          <el-button v-else style="display:none" type="success" size="mini" @click="form_examine3(row)">审核3</el-button>
-
-          <el-button   v-if="istab1Shenhe4 && (row.status== 0) && (row.flowCompeleted == 6)  && (row.isAudit == 1)" style="display:inline-block" type="success" size="mini" @click="form_examine4(row)">审核4</el-button>
-          <el-button v-else style="display:none" type="success" size="mini" @click="form_examine4(row)">审核4</el-button>
-        </template>
-      </el-table-column>
-
-      </el-table>
-
-      <pagination v-show="tableObj1.total>0" :total="tableObj1.total" :page.sync="tableObj1.getdataListParm.offset" :limit.sync="tableObj1.getdataListParm.pagecount" @pagination="get_table_data1()" />
-    </div>
-
-
-    <!-- 弹出层新增or修改 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <div >
-        <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="100px" style="width: 100%;">
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="委外维修单号:" prop="outsourcingCode">
-                <el-input ref="outsourcingCode" v-model="createTemp.outsourcingCode" disabled   />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="牧场:" prop="pastureId" >
-                <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled=" dialogStatus==='see'" @change="change_pasture2" >
-                  <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-
-            <el-col :span="8">
-              <el-form-item label="责任部门:" prop="departmentId">
-                <el-select v-model="createTemp.departmentId" placeholder="责任部门" class="filter-item" style="width:100%" :disabled=" dialogStatus==='see'"  @change="change_depart2">
-                  <el-option v-for="item in departNameList2" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-
-            <el-col :span="8">
-              <el-form-item label="合同:" prop="contract">
-                <el-radio-group v-model="createTemp.contract" :disabled="dialogStatus==='see'"  @change="change_contract" >
-                  <el-radio   :label="0" :checked="createTemp.contract == 0">无合同</el-radio>
-                  <el-radio   :label="1" :checked="createTemp.contract == 1">有合同</el-radio>
-
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-
-            <el-col :span="8">
-              <el-form-item label="申请人:" prop="applicant">
-                <el-select v-model="createTemp.applicant" placeholder="申请人" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'"  >
-                  <el-option v-for="item in employeNameList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="日期:" prop="date">
-                <el-date-picker v-model="createTemp.date" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'"  />
-              </el-form-item>
-            </el-col>
-
-
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="16">
-              <el-form-item label="故障描述:" prop="description">
-                <el-input   v-model="createTemp.description" type="textarea" autosize :disabled="dialogStatus==='see'"  />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="报修单号:" prop="RUCode">
-                <el-input ref="RUCode" v-model="createTemp.RUCode" disabled   />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-
-
-
-          <el-table
-            :key="tableKey"
-            v-loading="listLoading"
-            element-loading-text="给我一点时间"
-            :data="listAddCont"
-            border
-            fit
-            highlight-current-row
-            style="width: 100%;margin-bottom:30px"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable"
-          >
-            <!-- table表格 -->
-            <el-table-column :key="1" label="序号" align="center" type="index" width="50px" />
-            <el-table-column :key="2" label="供应商" prop="providerName" align="center" min-width="80px">
-              <template slot-scope="scope">
-                <el-select v-model="scope.row.providerName" filterable placeholder="供应商" class="filter-item" style="width: 120px; margin-top:10px" v-if="dialogStatus ==='create'||dialogStatus ==='update'"  >
-                  <el-option v-for="item in providerNameList" :key="item.name" :label="item.name" :value="item.name" />
-                </el-select>
-                <span v-if="dialogStatus ==='see'">{{ scope.row.providerName }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column :key="3" v-if="createTemp.contract==0" label="金额" prop="amount" align="center" min-width="80px">
-              <template slot-scope="scope">
-                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                  <el-input v-model="scope.row.amount" style="margin-top:10px" />
-                </span>
-                <span v-if="dialogStatus ==='see'">{{ scope.row.amount }}</span>
-              </template>
-            </el-table-column>
-              <el-table-column  :key="4" label="设备名称" prop="eqName" align="center" min-width="250">
-                <template slot-scope="scope">
-                  <el-autocomplete     style="margin-top:10px"  :disabled="dialogStatus ==='see'"
-                    v-model="scope.row.eqName"
-                    class="inline-input"
-                    :fetch-suggestions="querySearchEqNameCont"
-                    value-key="eqName"
-                    placeholder="设备名称"
-                    @select="(value)=>
-                    {handleSelectEqNameCont(value, scope.row)}"
-                    @blur="(value)=>
-                    {blurSelectEqNameCont(value, scope.row)}"
-                  >
-                    <template slot-scope="{ item }">
-                      <span class="addr">{{ item.eqName }}</span>
-                      |<span class="addr">{{ item.eqCode }}</span>
-                    </template>
-                  </el-autocomplete>
-
-                </template>
-              </el-table-column>
-              <el-table-column  :key="5" label="设备内部编号" prop="eqCode" align="center" min-width="150">
-                <template slot-scope="scope">
-
-
-                  <el-autocomplete  style="margin-top:10px"
-                    v-model="scope.row.eqCode" :disabled="dialogStatus ==='see'"
-                    class="inline-input"
-                    :fetch-suggestions="querySearchCodeCont"
-                    value-key="eqCode"
-                    placeholder="设备内部编号"
-                    @select="(value)=>
-                    {handleSelectEqCodeCont(value, scope.row)}"
-                    @blur="(value)=>
-                    {blurSelectEqCodeCont(value, scope.row)}"
-                  />
-
-                </template>
-              </el-table-column>
-
-
-            <!-- <el-table-column label="设备名称" prop="eqName" min-width="80px" align="center">
-              <template slot-scope="scope">
-                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                  <el-input v-model="scope.row.eqName" style="margin-top:10px" />
-                </span>
-                <span v-if="dialogStatus ==='see'">{{ scope.row.eqName }}</span>
-              </template>
-            </el-table-column>
-
-
-            <el-table-column label="设备内部编号" prop="eqCode" align="center" min-width="80px">
-              <template slot-scope="scope">
-                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                  <el-input v-model="scope.row.eqCode" style="margin-top:10px" />
-                </span>
-                <span v-if="dialogStatus ==='see'">{{ scope.row.eqCode }}</span>
-              </template>
-            </el-table-column> -->
-            <el-table-column :key="6" label="费用类型" prop="typea" align="center" min-width="80px">
-              <template slot-scope="scope">
-
-                <el-select v-model="scope.row.typea" placeholder="费用类型" class="filter-item" style="width: 120px; margin-top:10px " v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                  <el-option v-for="item in costTypeList" :key="item.id" :label="item.name" :value="item.name" />
-                </el-select>
-                <span v-if="dialogStatus ==='see'">{{ scope.row.typea }}</span>
-              </template>
-            </el-table-column>
-            <!-- <el-table-column label="交付日期" prop="date" align="center" min-width="80px">
-              <template slot-scope="scope">
-                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-
-                  <el-date-picker v-model="scope.row.date"   style="margin-top:10px"   type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"   />
-                </span>
-                <span v-if="dialogStatus ==='see'">{{ scope.row.date }}</span>
-              </template>
-            </el-table-column> -->
-            <el-table-column :key="7" v-if="createTemp.contract == 1" label="合同编号" prop="contractCode" align="center" min-width="80px">
-              <template slot-scope="scope">
-                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                  <el-input v-model="scope.row.contractCode" style="margin-top:10px" />
-                </span>
-                <span v-if="dialogStatus ==='see'">{{ scope.row.contractCode }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column :key="8" label="备注" prop="remark" align="center" min-width="180px">
-              <template slot-scope="scope">
-                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                  <el-input v-model="scope.row.remark" style="margin-top:10px" />
-                </span>
-                <span v-if="dialogStatus ==='see'">{{ scope.row.remark }}</span>
-              </template>
-            </el-table-column>
-
-
-
-          </el-table>
-
-
-          <el-row :gutter="10" v-if="dialogStatus ==='see'  ">
-
-            <el-col>
-              <h3>流程进度</h3>
-              <el-steps :active="active" align-center finish-status="success">
-                <el-step
-                  v-for="(item,index) in activeList"
-                  :key="index"
-                  :title="item.title"
-                  :status="item.status"
-                >
-                  <template slot="description">
-                    <div class="step-row">
-                      <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
-                      <div>{{ item.reason }}</div>
-                    </div>
-                  </template>
-                </el-step>
-              </el-steps>
-            </el-col>
-          </el-row>
-
-
-
-
-        <div slot="footer" class="dialog-footer" style="bottom:10px">
-          <el-button type="primary" :disabled="isokDisable" v-if="dialogStatus !=='see'" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
-          <el-button @click="dialogFormVisible = false;get_table_data1()">取消并关闭</el-button>
-        </div>
-      </div>
-    </el-dialog>
-
-    <!-- 审核 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
-      <div class="app-examine">
-        <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
-        <el-form ref="examineTemp" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
-          <el-row style="width:88%;height:150px;margin:0 auto;">
-            <el-col :span="20">
-              <el-form-item>
-                <el-radio-group v-model="examineTemp.status" @change="change_statue">
-                  <el-radio :label="1" checked>通过</el-radio>
-                  <el-radio :label="2">不通过</el-radio>
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-            <el-col v-if="statueReason" :span="20">
-              <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
-            </el-col>
-          </el-row>
-        </el-form>
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button v-if="istab1Shenhe1 && (examineTemp.flowCompeleted == 1) "  type="primary" :disabled="isokDisable" @click="form_examine_save()">确认1</el-button>
-        <el-button v-if="istab1Shenhe2 && (examineTemp.flowCompeleted == 2)"  type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认2</el-button>
-        <el-button v-if="istab1Shenhe3 && (examineTemp.flowCompeleted == 4)"  type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认3</el-button>
-        <el-button v-if="istab1Shenhe4 && (examineTemp.flowCompeleted == 6)"  type="primary" :disabled="isokDisable" @click="form_examine_save4()">确认4</el-button>
-        <!-- <el-button v-if="dialogStatus==='examine22'" type="primary" :disabled="isokDisable" @click="form_examine_save22()">确认</el-button>
-        <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
-        <el-button v-if="dialogStatus==='examine33'" type="primary" :disabled="isokDisable" @click="form_examine_save33()">确认</el-button>
-        <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</el-button> -->
-        <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
-      </div>
-    </el-dialog>
-
-
-  </div>
-</template>
-
-<script>
-import echarts from 'echarts'
-require('echarts/theme/macarons')
-import { GetDataByNames, GetReportform, GetDataByName, PostDataByName, checkButtons, ExecDataByConfig} from '@/api/common'
-import Cookies from 'js-cookie'
-import { parseTime, json2excel } from '@/utils/index.js'
-import { MessageBox } from 'element-ui'
-import Pagination from '@/components/Pagination'
-export default {
-  name: 'Tab1',
-  components: { Pagination },
-  inject: ['reload'],
-  data() {
-    return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
-      //多个下拉框 - 请求内容
-      send_select_list: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllProviderByCt', offset: 0, pagecount: 0, parammaps: { 'id': Cookies.get('pastureid') }},
-
-      ],
-
-
-      //  下拉框 - 牧场
-      pastureNameList: [
-        // {id: "犊牛1", name: "犊牛1"},
-        // {id: "犊牛2", name: "犊牛2"},
-        // {id: "犊牛3", name: "犊牛3"}
-      ],
-
-      getDepartParam1: {
-        name: 'findAllDepart', offset: 0, pagecount: 0,
-        parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
-      },
-      employeNameList: [],
-      departNameList1: [],
-      getDepartParam2: {
-        name: 'findAllDepart', offset: 0, pagecount: 0,
-        parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
-      },
-      departNameList2: [],
-
-      statuesNameList: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
-      isokDisable: false,
-
-
-      tableObj1: {
-        getdataListParm: {
-          name: 'getBigoutsourcingList',
-          //请求的 page 无用参数  offset 第几页  pagecount 每页多少条
-          page: 1, offset: 1,pagecount: 10,returntype: 'Map',
-          parammaps: { pastureName: Cookies.get('pasturename'), outsourcingCode: '',departmentName: '',status: "",eqName: "",eqCode: "",contractCode: "",inputDatetime:"",startdate: "",enddate: ""}
-        },
-        tableKey: 0,listLoading: false,
-        //返回的 pageNum 第几页  pageSize 每页多少条 total 总条数
-        pageNum:'',pageSize:'',total: 0,
-        list: [
-
-        ]
-      },
-
-      getAddContListParam:  {
-        name: "getOutsourcingList",
-        page: 1,offset: 1,pagecount: 20,returntype: "Map",
-        parammaps: {"bigId": ""}
-      },
-
-      pickerOptions: {
-        disabledDate(time) {
-          return time.getTime() > Date.now()// 当天之前的时间可选
-        }
-      },
-
-      rules: {
-        outsourcingCode: [{ required: true, message: '必填', trigger: 'blur' }],
-        equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
-        departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
-        contract: [{ required: true, message: '必填', trigger: 'blur' }],
-        description: [{ required: true, message: '必填', trigger: 'blur' }],
-        // equipmentName: [{ required: true, message: '必填', trigger: 'blur' }]
-      },
-
-      tableKey: 0,
-      listLoading: true,
-      total: 0,
-      list: [],
-      dialogStatus: '',
-      dialogFormVisible: false,
-      dialogFormVisibleSee: false,
-      listLoadingSee: true,
-      listSee: [],
-      totalSee: 0,
-      seeTemp: {},
-      getdataListSee: {
-        name: 'getpartpurchaseBybig',
-        returntype: 'Map',
-        parammaps: {}
-      },
-      createTemp: {
-        pastureId: this.$store.state.user.pastureid,
-        departmentId: this.$store.state.user.departmentid,
-        employeId: this.$store.state.user.employeid,
-        date: parseTime(new Date(), '{y}-{m}-{d}'),
-        outsourcingCode: '',
-        applicant: '',
-        RUCode: '',
-        providerId: '',
-        departmentName: '',
-        description: '',
-        contract:1,
-      },
-
-      costTypeList:[
-        {id:'保养',name:'保养'},
-        {id:'维修',name:'维修'},
-        {id:'物耗',name:'物耗'},
-        {id:'土建',name:'土建'},
-        {id:'安全',name:'安全'},
-      ],
-
-      providerNameList:[
-
-      ],
-
-
-      getParmCreateNumber: {
-        name: 'autoCreatCode',
-        page: 0,
-        offset: 0,
-        pagecount: 0,
-        returntype: 'Map',
-        parammaps: {
-          pastureId: Cookies.get('pastureid'),
-          codeType: 'WW'
-        }
-      },
-
-      listAddCont:[
-         {providerName:"",providerId: "0",eqId: "0",contractId: "0",}
-      ],
-      activeList: [],
-      active: 1,
-
-
-
-      EqNameList: [],
-      requestEqName: {
-        name: 'geteqbyNameCode', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
-        parammaps: { pastureId: Cookies.get('pastureid') }
-      },
-      EqCodeList: [],
-
-      dialogFormVisible_Examine: false,
-      examineTemp: {
-            "status": 1,
-            "empid": "",
-            "flowCompeleted":"",
-            "workflowNote": "",
-            "id": ""
-      },
-      statueReason: false,
-      rowStyle: { maxHeight: 50 + 'px', height: 35 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      textMap: {
-        update: '编辑',
-        create: '新增',
-        see: '查看',
-        examine: '审核1',
-        examine22: '审核2',
-        examine2: '审核3',
-        examine33: '审核4',
-        examine3: '审核5'
-      },
-
-      istab1Add:[],
-      istab1Edit:[],
-      istab1Del:[],
-      istab1Shenhe1:[],
-      istab1Shenhe2:[],
-      istab1Shenhe4:[],
-      getParmCreateNumber2: {
-        name: 'autoCreatCode',
-        page: 0, offset: 0,  pagecount: 0,  returntype: 'Map',
-        parammaps: {
-          pastureId: Cookies.get('pastureid'),
-          codeType: 'WY'
-        }
-      },
-
-    }
-  },
-  created() {
-
-
-    this.get_select_list()
-    this.get_table_data1()
-    this.get_auto_buttons()
-  },
-  methods: {
-    //获取按钮权限
-    get_auto_buttons() {
-      const istab1Add = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:add')
-      this.istab1Add = istab1Add
-
-      const istab1Edit = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:edit')
-      this.istab1Edit = istab1Edit
-
-      const istab1Del = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:del')
-      this.istab1Del = istab1Del
-
-      const istab1Shenhe1 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe1')
-      this.istab1Shenhe1 = istab1Shenhe1
-
-      const istab1Shenhe2 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe2')
-      this.istab1Shenhe2 = istab1Shenhe2
-
-      const istab1Shenhe3 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe3')
-      this.istab1Shenhe3 = istab1Shenhe3
-
-      const istab1Shenhe4 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe4')
-      this.istab1Shenhe4 = istab1Shenhe4
-
-    },
-
-    querySearchEqNameCont(queryString, cb) {
-      console.log('备件名称/设备内部编号模糊查询输入值', queryString)
-      this.requestEqName.parammaps['eqName'] = queryString
-      GetDataByName(this.requestEqName).then(response => {
-        console.log('备件名称模糊查询搜索data', response.data.list)
-        this.EqNameList = response.data.list
-        cb(this.EqNameList)
-      })
-    },
-    handleSelectEqNameCont(item, row) {
-      console.log('备件名称/设备内部编号模糊查询选中值', item.eqName)
-      console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
-      this.$set(row, 'eqCode', item.eqCode)
-      this.$forceUpdate()
-    },
-    querySearchCodeCont(queryString, cb) {
-      console.log('备件名称/设备内部编号模糊查询输入值', queryString)
-      this.requestEqName.parammaps['eqCode'] = queryString
-      GetDataByName(this.requestEqName).then(response => {
-        console.log('备件名称模糊查询搜索data', response.data.list)
-        this.EqNameList = response.data.list
-        cb(this.EqNameList)
-      })
-    },
-    handleSelectEqCodeCont(item, row) {
-      console.log('备件名称/设备内部编号模糊查询选中值', item)
-      console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
-      this.$set(row, 'eqName', item.eqName)
-      this.$forceUpdate()
-    },
-    blurSelectEqNameCont(item, row) {
-      this.$set(row, 'eqName', '')
-      this.$set(row, 'eqCode', '')
-    },
-    blurSelectEqCodeCont(item, row) {
-      this.$set(row, 'eqName', '')
-      this.$set(row, 'eqCode', '')
-    },
-
-
-    get_select_list() {
-      GetDataByNames(this.send_select_list).then(response => {
-        this.pastureNameList = response.data.findAllPasture.list
-        console.log("牧场下拉框", this.pastureNameList)
-        this.employeNameList = response.data.findAllEmploye.list
-        console.log("申请人下拉框", this.employeNameList)
-        this.providerNameList = response.data.findAllProviderByCt.list
-
-        this.get_depart_list1()
-      })
-    },
-    change_pasture1(item) {
-      this.getDepartParam1.parammaps.pastureId = this.pastureNameList.find(obj => obj.name == item).id
-      this.tableObj1.getdataListParm.parammaps.departmentId = ''
-      this.get_depart_list1()
-    },
-    //部门List
-    get_depart_list1() {
-      GetDataByName(this.getDepartParam1).then(response => {
-        this.departNameList1 = response.data.list
-      })
-    },
-
-
-    change_pasture2(item) {
-      this.getDepartParam2.parammaps.pastureId = item
-      this.get_depart_list2()
-    },
-
-    get_depart_list2() {
-      GetDataByName(this.getDepartParam2).then(response => {
-        this.departNameList2 = response.data.list
-      })
-    },
-
-    change_depart2(item) {
-      this.createTemp.departmentName = this.departNameList2.find(obj => obj.id == item).name
-    },
-
-
-    get_table_data1() {
-      this.tableObj1.listLoading = false
-
-      if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
-        this.tableObj1.getdataListParm.parammaps.startdate = this.$refs['inputDatetime'].value[0]
-        this.tableObj1.getdataListParm.parammaps.enddate = this.$refs['inputDatetime'].value[1]
-
-
-      } else {
-        this.tableObj1.getdataListParm.parammaps.inputDatetime = ''
-        this.tableObj1.getdataListParm.parammaps.startdate = ''
-        this.tableObj1.getdataListParm.parammaps.enddate = ''
-      }
-
-      GetDataByName(this.tableObj1.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          this.tableObj1.list = response.data.list
-          this.tableObj1.pageNum = response.data.pageNum
-          this.tableObj1.pageSize = response.data.pageSize
-          this.tableObj1.total = response.data.total
-        } else {
-          this.tableObj1.list = [ ]
-        }
-
-        setTimeout(() => {
-          this.tableObj1.listLoading = false
-        }, 100)
-      })
-    },
-    form_search() {
-      console.log('查询')
-
-
-      this.get_table_data1()
-
-    },
-    change_contract(val) {
-      console.log(val)
-      if(val ==1){
-        this.createTemp.contract = 1
-      } else {
-        this.createTemp.contract = 0
-      }
-
-    },
-    form_add() {
-      this.reset_create()
-      this.getDepartParam2.parammaps.pastureId = this.createTemp.pastureId
-      this.get_depart_list2()
-      this.dialogStatus = 'create'
-      this.dialogFormVisible = true
-      this.listLoading = false
-      this.$nextTick(() => {
-        this.$refs['createTemp'].clearValidate()
-      })
-       //新增生成单号
-      this.get_create_num()
-    },
-
-    reset_create() {
-      this.createTemp.pastureId =  parseInt(Cookies.get('pastureid'))
-     this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
-
-
-     if(parseInt(Cookies.get('pastureid')) == 18){
-      this.createTemp.departmentId = ""
-     }
-     this.createTemp.departmentName = Cookies.get('departmentname')
-      this.createTemp.employeId = parseInt(Cookies.get('employeid'))
-      this.createTemp.date = parseTime(new Date(), '{y}-{m}-{d}')
-
-      this.createTemp.outsourcingCode = ''
-      this.createTemp.applicant = parseInt(Cookies.get('employeid'))
-      this.createTemp.providerId = ''
-      this.createTemp.contract = 1
-
-      this.createTemp.description = ''
-
-
-
-
-
-      this.listAddCont = [{providerName:"",providerId: "0",eqId: "0",contractId: "0",amount:"",contractCode:"",date:"",eqCode:"",eqName:"",remark:"",typea:"",}]
-
-    },
-
-    get_create_num() {
-      GetDataByName(this.getParmCreateNumber).then(response => {
-        this.$nextTick(() => {
-          console.log('新增单号', response.data.list[0].orderCode)
-          this.createTemp.outsourcingCode = response.data.list[0].orderCode
-          this.$forceUpdate()
-        })
-      })
-    },
-
-    add_dialog_save() {
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          console.log(this.listAddCont)
-          if (this.createTemp.outsourcingCode == '' || this.createTemp.outsourcingCode == null || this.createTemp.outsourcingCode == undefined) {
-            GetDataByName(this.getParmCreateNumber2).then(response => {
-              this.$nextTick(() => {
-                console.log('新增单号', response.data.list[0].orderCode)
-                this.createTemp.outsourcingCode = response.data.list[0].orderCode
-                this.$forceUpdate()
-                this.add_dialog_saveSave()
-              })
-            })
-          } else {
-            this.add_dialog_saveSave()
-          }
-        }
-      })
-    },
-
-
-    add_dialog_saveSave() {
-
-        for (var j = 0; j < this.listAddCont.length; j++) {
-          console.log(this.listAddCont[j].amount)
-          if(this.createTemp.contract == 1){
-            if(this.listAddCont[j].providerName == ''){
-              this.$message({ type: 'warning', message: '请检查供应商是否未填写', duration: 2000 })
-              return false
-            }
-          }
-          if(this.listAddCont[j].eqName == ''){
-            this.$message({ type: 'warning', message: '请检查设备名称是否未填写', duration: 2000 })
-            return false
-          }
-          if(this.listAddCont[j].eqCode == ''){
-            this.$message({ type: 'warning', message: '请检查设备内部编号是否未填写', duration: 2000 })
-            return false
-          }
-          if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
-            // this.$message({ type: 'warning', message: '请检查金额是否未填写', duration: 2000 })
-            // return false
-          } else {
-            // var rulesAmount = /^[1-9]\d*$/
-            // if (!rulesAmount.test(this.listAddCont[j].amount)) {
-            //   this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
-            //   return false
-            // }
-          }
-
-          if (this.createTemp.contract == 1){
-            if (this.listAddCont[j].contractCode == null || this.listAddCont[j].contractCode === '') {
-              this.$message({ type: 'warning', message: '请检查合同编号是否未填写', duration: 2000 })
-              return false
-            }
-          }
-
-
-
-
-        }
-        var amount = 0
-        if(this.createTemp.contract==0){
-          amount = "@insertSpotList.amount"
-        }else{
-          amount = 0
-        }
-        if(this.createTemp.contract == 0){
-          // 无合同
-          this.$set(this.createTemp,'status',0)
-        }else{
-          // 有合同
-          this.$set(this.createTemp,'status',1)
-        }
-        var send_data = {
-          "common": {  "returnmap": "0" },
-          "data": [
-            {
-              "name": "addBigoutsourcing", "type": "e",
-              "parammaps": this.createTemp
-            },
-            {
-              "name": "insertSpotList",
-              "resultmaps": {  "list": this.listAddCont },
-
-              "children": [
-                {
-                    "name": "addOutsourcing",  "type": "e",
-                    "parammaps": {
-                      "bigId": "@addBigoutsourcing.LastInsertId",
-                      "providerId": "@insertSpotList.providerId",
-                      "amount": amount,
-                      "eqId": "@insertSpotList.eqId",
-                      "eqCode": "@insertSpotList.eqCode",
-                      "eqName": "@insertSpotList.eqName",
-                      "typea": "@insertSpotList.typea",
-                      "date": "@insertSpotList.date",
-                      "contractId": "@insertSpotList.contractId",
-                      "providerName": "@insertSpotList.providerName",
-                      "contractCode": "@insertSpotList.contractCode",
-                      "remark": "@insertSpotList.remark",
-                      "status":this.createTemp.status
-                      }
-                  }
-              ]
-              }
-            ]
-        }
-        ExecDataByConfig(send_data).then(response => {
-          console.log('新增保存发送参数', send_data)
-          if (response.msg === 'fail') {
-            this.$notify({
-              title: '保存失败',
-              message: response.data,
-              type: 'warning',
-              duration: 2000
-            })
-          } else {
-            if(this.createTemp.contract==1){
-              this.add_dialog_saveSave2()
-            }
-            this.dialogFormVisible = false
-
-            this.get_table_data1()
-
-            this.$notify({
-              title: '',
-              message: '保存成功',
-              type: 'success',
-              duration: 2000
-            })
-          }
-        })
-        return true
-
-    },
-
-
-
-
-
-    form_see(row){
-      console.log('查看======》',row)
-      this.getDepartParam2.parammaps.pastureId = row.pastureId
-      this.get_depart_list2()
-      this.createTemp = Object.assign({}, row)
-      this.dialogStatus = 'see'
-      this.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.$refs['createTemp'].clearValidate()
-      })
-
-
-      //总价大于等于10000,有高级设备工程师
-      if(row.isAudit == 1) {
-        if (row.flowCompeleted == 1) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人' },
-              { title: '财务负责人' },
-              { title: '场长' },
-              { title: '运营支持部高级工程师' },
-            ]
-            this.active = 1
-          } else if (row.flowCompeleted == 2) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
-              { title: '财务负责人' },
-              { title: '场长' },
-              { title: '运营支持部高级工程师' },
-            ]
-            this.active = 2
-          } else if (row.flowCompeleted === 3) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName,status: 'error', reason: row.workflowNote },
-              { title: '财务负责人' },
-              { title: '场长' },
-              { title: '运营支持部高级工程师' }
-            ]
-            this.active = 2
-          } else if (row.flowCompeleted === 4) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
-              { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
-              { title: '场长' },
-              { title: '运营支持部高级工程师' }
-            ]
-            this.active = 3
-          } else if (row.flowCompeleted === 5) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
-              { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName,status: 'error', reason: row.workflowNote },
-              { title: '场长' },
-              { title: '运营支持部高级工程师' }
-            ]
-            this.active = 3
-          } else if (row.flowCompeleted === 6) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
-              { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
-              { title: '场长',date: row.fielddate, name: row.fieldName },
-              { title: '运营支持部高级工程师' }
-            ]
-            this.active = 4
-          } else if (row.flowCompeleted === 7) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
-              { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
-              { title: '场长',date: row.fielddate, name: row.fieldName,status: 'error', reason: row.workflowNote },
-              { title: '运营支持部高级工程师' }
-            ]
-            this.active = 4
-          }else if (row.flowCompeleted === 8) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
-              { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
-              { title: '场长',date: row.fielddate, name: row.fieldName },
-              { title: '运营支持部高级工程师',date: row.advanceddate, name: row.advancedName }
-            ]
-            this.active = 5
-          }else if (row.flowCompeleted === 9) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
-              { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
-              { title: '场长',date: row.fielddate, name: row.fieldName},
-              { title: '运营支持部高级工程师',date: row.advanceddate, name: row.advancedName,status: 'error', reason: row.workflowNote  }
-            ]
-            this.active = 5
-          }
-
-
-
-      //总价小于10000 没有高级设备工程师,直接场长审核
-      } else {
-        if (row.flowCompeleted == 1) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人' },
-              { title: '财务负责人' },
-              { title: '场长' }
-            ]
-            this.active = 1
-          } else if (row.flowCompeleted == 2) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
-              { title: '财务负责人' },
-              { title: '场长' }
-            ]
-            this.active = 2
-          } else if (row.flowCompeleted === 3) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName,status: 'error', reason: row.workflowNote },
-              { title: '财务负责人' },
-              { title: '场长' }
-            ]
-            this.active = 2
-          } else if (row.flowCompeleted === 4) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
-              { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
-              { title: '场长' },
-            ]
-            this.active = 3
-          } else if (row.flowCompeleted === 5) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
-              { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName,status: 'error', reason: row.workflowNote },
-              { title: '场长' }
-            ]
-            this.active = 3
-          } else if (row.flowCompeleted === 6) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
-              { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
-              { title: '场长',date: row.fielddate, name: row.fieldName },
-            ]
-            this.active = 4
-          } else if (row.flowCompeleted === 7) {
-            this.activeList = [
-              { title: '设备处长', date: row.createTime, name: row.applicantName },
-              { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
-              { title: '财务负责人',date: row.equipmentdate, name: row.equipmentName },
-              { title: '场长',date: row.fielddate, name: row.fieldName,status: 'error', reason: row.workflowNote }
-            ]
-            this.active = 4
-          }
-      }
-      if(row.contract == 1){
-        this.activeList = [
-          { title: '设备处长', date: row.createTime, name: row.applicantName }
-        ]
-        this.active = 1
-      }
-          this.getAddContListParam.parammaps.bigId = row.id
-         this.getAddContList()
-    },
-
-    getAddContList() {
-      GetDataByName(this.getAddContListParam).then(response => {
-        this.listAddCont = response.data.list
-        this.listLoading = false
-      })
-    },
-
-
-
-    form_edit(row) {
-      this.reset_create()
-      console.log('编辑',row)
-      this.getDepartParam2.parammaps.pastureId = row.pastureId
-      this.get_depart_list2()
-      if (row.providerId == undefined) {
-        row.providerId = ''
-        row.providerName = ''
-      }
-      this.createTemp = Object.assign({}, row) // copy obj
-      this.dialogStatus = 'update'
-      this.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.$refs['createTemp'].clearValidate()
-      })
-      this.getAddContListParam.parammaps.bigId = row.id
-      this.getAddContList()
-    },
-    edit_dialog_save() {
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          this.edit_dialog_saveSave()
-        }
-      })
-    },
-    edit_dialog_saveSave() {
-
-        for (var j = 0; j < this.listAddCont.length; j++) {
-          console.log(this.listAddCont[j].amount)
-          // eslint-disable-next-line use-isnan
-          if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
-            this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
-            return false
-          }
-
-        }
-
-        this.listAddCont[0].providerId = "0"
-        this.listAddCont[0].eqId = "0"
-        this.listAddCont[0].contractId = "0"
-
-        var amount = 0
-        if(this.createTemp.contract==0){
-          amount = "@insertSpotList.amount"
-        }else{
-          amount = 0
-        }
-        var send_data = {
-          "common": {  "returnmap": "0" },
-          "data": [
-            {
-              "name": "editBigoutsourcing", "type": "e",
-              "parammaps": this.createTemp
-            },
-            {
-              "name": "insertSpotList",
-              "resultmaps": {  "list": this.listAddCont },
-              "children": [
-                {
-                    "name": "editOutsourcing",  "type": "e",
-                    "parammaps": {
-                      "bigId": "@insertSpotList.LastInsertId",
-                      "providerId": "@insertSpotList.providerId",
-                      "amount": amount,
-                      "eqId": "@insertSpotList.eqId",
-                      "eqCode": "@insertSpotList.eqCode",
-                      "eqName": "@insertSpotList.eqName",
-                      "typea": "@insertSpotList.typea",
-                      "date": "@insertSpotList.date",
-                      "contractId": "@insertSpotList.contractId",
-                      "id": "@insertSpotList.id",
-                      "providerName": "@insertSpotList.providerName",
-                      "contractCode": "@insertSpotList.contractCode"
-                      }
-                  }
-              ]
-            },
-            {
-              "name": "updateBigoutsourcingFlowCompeleted", "type": "e",
-              "parammaps":{
-                id:this.createTemp.id
-              }
-            },
-            ]
-        }
-
-        ExecDataByConfig(send_data).then(response => {
-          console.log('新增保存发送参数', send_data)
-          if (response.msg === 'fail') {
-            this.$notify({
-              title: '保存失败',
-              message: response.data,
-              type: 'warning',
-              duration: 2000
-            })
-          } else {
-            this.dialogFormVisible = false
-
-            this.get_table_data1()
-            this.$notify({
-              title: '',
-              message: '保存成功',
-              type: 'success',
-              duration: 2000
-            })
-          }
-        })
-
-    },
-
-    form_delete(row) {
-      console.log('点击了删除',row)
-      MessageBox.confirm('确认删除此条信息?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        var send_data = {
-        "common": { "returnmap": "0" },
-        "data": [
-          {
-            "name": "deleteBigoutsourcing", "type": "e",
-            "parammaps": { "id":row.id }
-           }
-          ]
-        }
-
-        ExecDataByConfig(send_data).then(response => {
-          this.get_table_data1()
-          this.$notify({
-            title: '成功',
-            message: '删除成功',
-            type: 'success',
-            duration: 2000
-          })
-        })
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '已取消删除'
-        })
-      })
-    },
-
-
-    change_statue(val) {
-      if (val == 2) {
-        this.statueReason = true
-      } else {
-        this.statueReason = false
-      }
-    },
-
-    form_examine(row) {
-      console.log('点击了设备处长审核',row)
-      if (row == undefined) {
-        this.examineTemp = this.createTemp
-        this.$set(this.createTemp, 'status', 1)
-        this.$set(this.createTemp, 'workflowNote', '')
-      } else {
-        this.examineTemp = Object.assign({}, row)
-        this.$set(this.examineTemp, 'status', 1)
-        this.$set(this.examineTemp, 'workflowNote', '')
-      }
-      this.dialogStatus = 'examine'
-      this.dialogFormVisible_Examine = true
-      this.statueReason = false
-    },
-    form_examine_save() {
-      console.log('点击了设备处长审核', this.examineTemp)
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['examineTemp'].validate(valid => {
-        if (valid) {
-
-          //不通过
-          if(this.statueReason){
-            this.examineTemp.status = 2
-             //审核角色
-            this.examineTemp.flowCompeleted = "3"
-          } else {
-            this.examineTemp.status = 0
-            this.examineTemp.flowCompeleted = "2"
-          }
-          this.examineTemp.empid = Cookies.get('employeid')
-
-          var send_data = {
-              "common": {  "returnmap": "0"  },
-              "data": [
-                  // {
-                  //     "name": "editBigoutsourcingEquipment",  "type": "e",
-                  //     "parammaps": this.examineTemp
-                  // },
-                  {
-                      "name": "editBigoutsourcingDepartment",  "type": "e",
-                      "parammaps": this.examineTemp
-                  }
-              ]
-          }
-          console.log(send_data,'审核1保存')
-          ExecDataByConfig(send_data).then(response => {
-            console.log('审核确认发送参数', send_data)
-            if (response.msg !== 'fail') {
-              this.get_table_data1()
-              this.dialogFormVisible_Examine = false
-              this.statueReason = false
-              this.$notify({
-                title: '成功',
-                message: '审核成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-
-    form_examine2(row) {
-      console.log('点击了场长审核',row)
-      this.examineTemp = Object.assign({}, row)
-      if (row == undefined) {
-        // this.examineTemp = this.createTemp
-        this.$set(this.createTemp, 'status', 1)
-        this.$set(this.createTemp, 'workflowNote', '')
-      } else {
-
-        this.$set(this.examineTemp, 'status', 1)
-        this.$set(this.examineTemp, 'workflowNote', '')
-      }
-      this.dialogStatus = 'examine'
-      this.statueReason = false
-      this.dialogFormVisible_Examine = true
-      // GetDataByName(this.getParmCreateNumber).then(response => {
-      //   this.$nextTick(() => {
-      //     console.log('新增单号', response.data.list[0].orderCode)
-      //     this.examineTemp.acceptanceCode = response.data.list[0].orderCode
-      //     this.$set(this.examineTemp,'acceptanceCode',response.data.list[0].orderCode)
-      //     this.$forceUpdate()
-      //   })
-      // })
-    },
-    add_dialog_saveSave2() {
-      console.log(this.examineTemp,'=======contract')
-      // this.examineTemp.iscontract =
-
-        //牧场
-        var mydata = {
-          // acceptanceCode:this.createTemp.acceptanceCode,
-          pastureId:  this.createTemp.pastureId,
-          departmentId: this.createTemp.departmentId,
-          applicant:Cookies.get('employeid'),
-          outsourcingCode:this.createTemp.outsourcingCode,
-          applyType:0,
-          date:parseTime(new Date(), '{y}-{m}-{d}'),
-          status:1
-        }
-        if(this.examineTemp.contract == 0){
-          mydata.iscontract = 1
-        }else{
-          mydata.iscontract = 0
-        }
-        var send_data = {
-          "common": {  "returnmap": "0" },
-          "data": [
-            {
-              "name": "insertBigacceptance",
-              "type": "e",
-              "parammaps": mydata
-            }
-          ]
-        }
-        ExecDataByConfig(send_data).then(response => {
-          console.log('新增保存发送参数', send_data)
-          if (response.msg === 'fail') {
-            this.$notify({
-              title: '保存失败',
-              message: response.data,
-              type: 'warning',
-              duration: 2000
-            })
-          } else {
-            // this.$notify({
-            //   title: '',
-            //   message: '保存成功',
-            //   type: 'success',
-            //   duration: 2000
-            // })
-          }
-        })
-
-
-    },
-
-    form_examine_save2() {
-      console.log('点击了场长审核', this.examineTemp)
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      // this.examineTemp.acceptanceCode = this.createTemp.acceptanceCode
-
-      this.$refs['examineTemp'].validate(valid => {
-        if (valid) {
-
-          //不通过
-          if(this.statueReason){
-            this.examineTemp.status = 2
-             //审核角色
-            this.examineTemp.flowCompeleted = "5"
-          } else {
-
-
-           // //总价大于等于10000 有高级设备工程师审核
-           //  if(this.examineTemp.isAudit == 1){
-           //     this.examineTemp.status = 0
-           // //总价小于10000 没有高级设备工程师,直接场长审核
-           //  } else {
-           //     this.examineTemp.status = 1
-           //  }
-           this.examineTemp.status = 0
-            this.examineTemp.flowCompeleted = "4"
-          }
-          this.examineTemp.empid = Cookies.get('employeid')
-
-          var send_data = {
-              "common": {  "returnmap": "0"  },
-              "data": [
-                  // {
-                  //     "name": "editBigoutsourcingField",  "type": "e",
-                  //     "parammaps": this.examineTemp
-                  // },
-                  {
-                      "name": "editBigoutsourcingEquipment",  "type": "e",
-                      "parammaps": this.examineTemp
-                  }
-              ]
-          }
-          console.log(send_data,'审核2保存')
-          ExecDataByConfig(send_data).then(response => {
-            console.log('审核确认发送参数', send_data)
-            if (response.msg !== 'fail') {
-              if(this.examineTemp.status == 1){
-                this.add_dialog_saveSave2()
-              }
-              this.get_table_data1()
-              this.dialogFormVisible_Examine = false
-              this.statueReason = false
-              this.$notify({
-                title: '成功',
-                message: '审核成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-
-    form_examine3(row) {
-      console.log('点击了高级工程师  审核',row)
-      this.examineTemp = Object.assign({}, row)
-      if (row == undefined) {
-        //this.examineTemp = this.createTemp
-        this.$set(this.createTemp, 'status', 1)
-        this.$set(this.createTemp, 'workflowNote', '')
-      } else {
-
-        this.$set(this.examineTemp, 'status', 1)
-        this.$set(this.examineTemp, 'workflowNote', '')
-      }
-      this.dialogStatus = 'examine'
-      this.dialogFormVisible_Examine = true
-      this.statueReason = false
-    },
-    form_examine_save3() {
-      console.log('点击了高级工程师审核',this.examineTemp )
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['examineTemp'].validate(valid => {
-        if (valid) {
-
-          //不通过
-          if(this.statueReason){
-            this.examineTemp.status = 2
-             //审核角色
-            this.examineTemp.flowCompeleted = "7"
-          } else {
-            //总价大于等于10000 有高级设备工程师审核
-             if(this.examineTemp.isAudit == 1){
-                this.examineTemp.status = 0
-            //总价小于10000 没有高级设备工程师,直接场长审核
-             } else {
-                this.examineTemp.status = 1
-             }
-            this.examineTemp.flowCompeleted = "6"
-          }
-          this.examineTemp.empid = Cookies.get('employeid')
-
-          var send_data = {
-              "common": {  "returnmap": "0"  },
-              "data": [
-                  // {
-                  //     "name": "editBigoutsourcingAdvanceddate",  "type": "e",
-                  //     "parammaps": this.examineTemp
-                  // },
-                  {
-                      "name": "editBigoutsourcingField",  "type": "e",
-                      "parammaps": this.examineTemp
-                  }
-              ]
-          }
-          console.log(send_data,'审核3保存',this.examineTemp)
-          ExecDataByConfig(send_data).then(response => {
-            console.log('审核确认发送参数', send_data)
-            if (response.msg !== 'fail') {
-              if(this.examineTemp.status == 1){
-                this.add_dialog_saveSave2()
-              }
-              this.get_table_data1()
-              this.dialogFormVisible_Examine = false
-              this.statueReason = false
-              this.$notify({
-                title: '成功',
-                message: '审核成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-    form_examine4(row) {
-      console.log('点击了高级工程师  审核',row)
-      this.examineTemp = Object.assign({}, row)
-      if (row == undefined) {
-        //this.examineTemp = this.createTemp
-        this.$set(this.createTemp, 'status', 1)
-        this.$set(this.createTemp, 'workflowNote', '')
-      } else {
-
-        this.$set(this.examineTemp, 'status', 1)
-        this.$set(this.examineTemp, 'workflowNote', '')
-      }
-      this.dialogStatus = 'examine'
-      this.dialogFormVisible_Examine = true
-      this.statueReason = false
-    },
-    form_examine_save4() {
-      console.log('点击了高级工程师审核',this.examineTemp )
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['examineTemp'].validate(valid => {
-        if (valid) {
-
-          //不通过
-          if(this.statueReason){
-            this.examineTemp.status = 2
-             //审核角色
-            this.examineTemp.flowCompeleted = "9"
-          } else {
-            this.examineTemp.status = 1
-            this.examineTemp.flowCompeleted = "8"
-          }
-          this.examineTemp.empid = Cookies.get('employeid')
-
-          var send_data = {
-              "common": {  "returnmap": "0"  },
-              "data": [
-                  // {
-                  //     "name": "editBigoutsourcingAdvanceddate",  "type": "e",
-                  //     "parammaps": this.examineTemp
-                  // },
-                  {
-                      "name": "editBigoutsourcingAdvanceddate",  "type": "e",
-                      "parammaps": this.examineTemp
-                  }
-              ]
-          }
-          console.log(send_data,'审核4保存')
-          ExecDataByConfig(send_data).then(response => {
-            console.log('审核确认发送参数', send_data)
-            if (response.msg !== 'fail') {
-              if(this.examineTemp.status == 1){
-                this.add_dialog_saveSave2()
-              }
-              this.get_table_data1()
-              this.dialogFormVisible_Examine = false
-              this.statueReason = false
-              this.$notify({
-                title: '成功',
-                message: '审核成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-
-  // .content{
-  //   padding: 20px 20px;
-  //   .title{
-  //     text-align: center;
-  //     font-weight: 700;
-  //   }
-  //   .title2{
-  //     float: left;
-  //     font-weight: 700;
-  //     padding: 10px 0;
-  //   }
-  // }
-
-</style>
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+
+      <el-select v-model="tableObj1.getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="change_pasture1">
+        <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
+
+      <el-select v-model="tableObj1.getdataListParm.parammaps.departmentId" clearable style="width: 140px;" placeholder="部门" class="filter-item">
+        <el-option v-for="item in departNameList1" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+
+      <el-input v-model="tableObj1.getdataListParm.parammaps.outsourcingCode" placeholder="委外维修单号" style="width: 200px;" class="filter-item" />
+
+      <el-select v-model="tableObj1.getdataListParm.parammaps.status" style="width: 140px;" clearable placeholder="审核状态" class="filter-item">
+        <el-option v-for="item in statuesNameList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+
+      <el-input v-model="tableObj1.getdataListParm.parammaps.eqName" placeholder="设备名称" style="width: 200px;" class="filter-item" />
+
+      <el-input v-model="tableObj1.getdataListParm.parammaps.eqCode" placeholder="设备内部编号" style="width: 200px;" class="filter-item" />
+
+      <el-input v-model="tableObj1.getdataListParm.parammaps.contractCode" placeholder="合同编号" style="width: 200px;" class="filter-item" />
+
+      <el-date-picker ref="inputDatetime" v-model="tableObj1.getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
+
+      <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
+
+      <el-button v-if="istab1Add" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
+
+    </div>
+
+    <div class="elTable">
+      <el-table
+        :key="tableObj1.tableKey"
+        v-loading="tableObj1.listLoading"
+        :max-height="myHeight"
+        element-loading-text="给我一点时间"
+        :data="tableObj1.list"
+        border
+        fit
+        highlight-current-row
+style="width: 100%;" :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+      >
+
+        <el-table-column label="序号" align="center" type="index" width="50px">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (tableObj1.pageNum-1) * tableObj1.pageSize + 1 }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="委外单号" min-width="120px" align="center" prop="outsourcingCode" />
+        <el-table-column label="牧场" min-width="120px" align="center" prop="pastureName" />
+        <el-table-column label="责任部门 " min-width="120px" align="center" prop="departmentName" />
+        <el-table-column label="合同" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.contract ==1 ">有</span>
+            <span v-else>无</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="申请人" min-width="120px" align="center" prop="applicantName" />
+        <el-table-column label="日期" min-width="120px" align="center" prop="date" />
+        <el-table-column label="审核状态" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.status == 0 ">审核中</span>
+            <span v-else-if="scope.row.status == 1 ">审核通过</span>
+            <span v-else>审核未通过</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="260" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
+            <el-button v-if="istab1Edit && (row.status !== 0) && (row.status !== 1) " type="success" size="mini" @click="form_edit(row)">编辑</el-button>
+            <el-button v-if="istab1Del && (row.status !== 1) " type="danger" size="mini" @click="form_delete(row)">删除</el-button>
+
+            <el-button v-if="istab1Shenhe1 && (row.status== 0) && (row.flowCompeleted == 1) " style="display:inline-block" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
+
+            <el-button v-else style="display:none" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
+
+            <el-button v-if="istab1Shenhe2 && (row.status== 0) && (row.flowCompeleted == 2 )" style="display:inline-block" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
+            <el-button v-else style="display:none" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
+
+            <el-button v-if="istab1Shenhe3 && (row.status== 0) && (row.flowCompeleted == 4)" style="display:inline-block" type="success" size="mini" @click="form_examine3(row)">审核3</el-button>
+            <el-button v-else style="display:none" type="success" size="mini" @click="form_examine3(row)">审核3</el-button>
+
+            <el-button v-if="istab1Shenhe4 && (row.status== 0) && (row.flowCompeleted == 6) && (row.isAudit == 1)" style="display:inline-block" type="success" size="mini" @click="form_examine4(row)">审核4</el-button>
+            <el-button v-else style="display:none" type="success" size="mini" @click="form_examine4(row)">审核4</el-button>
+          </template>
+        </el-table-column>
+
+      </el-table>
+
+      <pagination v-show="tableObj1.total>0" :total="tableObj1.total" :page.sync="tableObj1.getdataListParm.offset" :limit.sync="tableObj1.getdataListParm.pagecount" @pagination="get_table_data1()" />
+    </div>
+
+    <!-- 弹出层新增or修改 -->
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <div>
+        <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="100px" style="width: 100%;">
+          <el-row :gutter="20">
+            <el-col :span="8">
+              <el-form-item label="委外维修单号:" prop="outsourcingCode">
+                <el-input ref="outsourcingCode" v-model="createTemp.outsourcingCode" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="牧场:" prop="pastureId">
+                <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled=" dialogStatus==='see'" @change="change_pasture2">
+                  <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="8">
+              <el-form-item label="责任部门:" prop="departmentId">
+                <el-select v-model="createTemp.departmentId" placeholder="责任部门" class="filter-item" style="width:100%" :disabled=" dialogStatus==='see'" @change="change_depart2">
+                  <el-option v-for="item in departNameList2" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+
+            <el-col :span="8">
+              <el-form-item label="合同:" prop="contract">
+                <el-radio-group v-model="createTemp.contract" :disabled="dialogStatus==='see'" @change="change_contract">
+                  <el-radio :label="0" :checked="createTemp.contract == 0">无合同</el-radio>
+                  <el-radio :label="1" :checked="createTemp.contract == 1">有合同</el-radio>
+
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="8">
+              <el-form-item label="申请人:" prop="applicant">
+                <el-select v-model="createTemp.applicant" placeholder="申请人" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'">
+                  <el-option v-for="item in employeNameList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="日期:" prop="date">
+                <el-date-picker v-model="createTemp.date" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="16">
+              <el-form-item label="故障描述:" prop="description">
+                <el-input v-model="createTemp.description" type="textarea" autosize :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="报修单号:" prop="RUCode">
+                <el-input ref="RUCode" v-model="createTemp.RUCode" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+
+        <el-table
+          :key="tableKey"
+          v-loading="listLoading"
+          element-loading-text="给我一点时间"
+          :data="listAddCont"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;margin-bottom:30px"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable"
+        >
+          <!-- table表格 -->
+          <el-table-column :key="1" label="序号" align="center" type="index" width="50px" />
+          <el-table-column :key="2" label="供应商" prop="providerName" align="center" min-width="80px">
+            <template slot-scope="scope">
+              <el-select v-if="dialogStatus ==='create'||dialogStatus ==='update'" v-model="scope.row.providerName" filterable placeholder="供应商" class="filter-item" style="width: 120px; margin-top:10px">
+                <el-option v-for="item in providerNameList" :key="item.name" :label="item.name" :value="item.name" />
+              </el-select>
+              <span v-if="dialogStatus ==='see'">{{ scope.row.providerName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column v-if="createTemp.contract==0" :key="3" label="金额" prop="amount" align="center" min-width="80px">
+            <template slot-scope="scope">
+              <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                <el-input v-model="scope.row.amount" style="margin-top:10px" />
+              </span>
+              <span v-if="dialogStatus ==='see'">{{ scope.row.amount }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column :key="4" label="设备名称" prop="eqName" align="center" min-width="250">
+            <template slot-scope="scope">
+              <el-autocomplete
+                v-model="scope.row.eqName"
+                style="margin-top:10px"
+                :disabled="dialogStatus ==='see'"
+                class="inline-input"
+                :fetch-suggestions="querySearchEqNameCont"
+                value-key="eqName"
+                placeholder="设备名称"
+                @select="(value)=>
+                {handleSelectEqNameCont(value, scope.row)}"
+                @blur="(value)=>
+                {blurSelectEqNameCont(value, scope.row)}"
+              >
+                <template slot-scope="{ item }">
+                  <span class="addr">{{ item.eqName }}</span>
+                  |<span class="addr">{{ item.eqCode }}</span>
+                </template>
+              </el-autocomplete>
+
+            </template>
+          </el-table-column>
+          <el-table-column :key="5" label="设备内部编号" prop="eqCode" align="center" min-width="150">
+            <template slot-scope="scope">
+
+              <el-autocomplete
+                v-model="scope.row.eqCode"
+                style="margin-top:10px"
+                :disabled="dialogStatus ==='see'"
+                class="inline-input"
+                :fetch-suggestions="querySearchCodeCont"
+                value-key="eqCode"
+                placeholder="设备内部编号"
+                @select="(value)=>
+                {handleSelectEqCodeCont(value, scope.row)}"
+                @blur="(value)=>
+                {blurSelectEqCodeCont(value, scope.row)}"
+              />
+
+            </template>
+          </el-table-column>
+
+          <!-- <el-table-column label="设备名称" prop="eqName" min-width="80px" align="center">
+              <template slot-scope="scope">
+                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                  <el-input v-model="scope.row.eqName" style="margin-top:10px" />
+                </span>
+                <span v-if="dialogStatus ==='see'">{{ scope.row.eqName }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column label="设备内部编号" prop="eqCode" align="center" min-width="80px">
+              <template slot-scope="scope">
+                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                  <el-input v-model="scope.row.eqCode" style="margin-top:10px" />
+                </span>
+                <span v-if="dialogStatus ==='see'">{{ scope.row.eqCode }}</span>
+              </template>
+            </el-table-column> -->
+          <el-table-column :key="6" label="费用类型" prop="typea" align="center" min-width="80px">
+            <template slot-scope="scope">
+
+              <el-select v-if="dialogStatus ==='create'||dialogStatus ==='update'" v-model="scope.row.typea" placeholder="费用类型" class="filter-item" style="width: 120px; margin-top:10px ">
+                <el-option v-for="item in costTypeList" :key="item.id" :label="item.name" :value="item.name" />
+              </el-select>
+              <span v-if="dialogStatus ==='see'">{{ scope.row.typea }}</span>
+            </template>
+          </el-table-column>
+          <!-- <el-table-column label="交付日期" prop="date" align="center" min-width="80px">
+              <template slot-scope="scope">
+                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+
+                  <el-date-picker v-model="scope.row.date"   style="margin-top:10px"   type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"   />
+                </span>
+                <span v-if="dialogStatus ==='see'">{{ scope.row.date }}</span>
+              </template>
+            </el-table-column> -->
+          <el-table-column v-if="createTemp.contract == 1" :key="7" label="合同编号" prop="contractCode" align="center" min-width="80px">
+            <template slot-scope="scope">
+              <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                <el-input v-model="scope.row.contractCode" style="margin-top:10px" />
+              </span>
+              <span v-if="dialogStatus ==='see'">{{ scope.row.contractCode }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column :key="8" label="备注" prop="remark" align="center" min-width="180px">
+            <template slot-scope="scope">
+              <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                <el-input v-model="scope.row.remark" style="margin-top:10px" />
+              </span>
+              <span v-if="dialogStatus ==='see'">{{ scope.row.remark }}</span>
+            </template>
+          </el-table-column>
+
+        </el-table>
+
+        <el-row v-if="dialogStatus ==='see' " :gutter="10">
+
+          <el-col>
+            <h3>流程进度</h3>
+            <el-steps :active="active" align-center finish-status="success">
+              <el-step
+                v-for="(item,index) in activeList"
+                :key="index"
+                :title="item.title"
+                :status="item.status"
+              >
+                <template slot="description">
+                  <div class="step-row">
+                    <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
+                    <div>{{ item.reason }}</div>
+                  </div>
+                </template>
+              </el-step>
+            </el-steps>
+          </el-col>
+        </el-row>
+
+        <div slot="footer" class="dialog-footer" style="bottom:10px">
+          <el-button v-if="dialogStatus !=='see'" type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
+          <el-button @click="dialogFormVisible = false;get_table_data1()">取消并关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+
+    <!-- 审核 -->
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
+      <div class="app-examine">
+        <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
+        <el-form ref="examineTemp" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
+          <el-row style="width:88%;height:150px;margin:0 auto;">
+            <el-col :span="20">
+              <el-form-item>
+                <el-radio-group v-model="examineTemp.status" @change="change_statue">
+                  <el-radio :label="1" checked>通过</el-radio>
+                  <el-radio :label="2">不通过</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col v-if="statueReason" :span="20">
+              <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button v-if="istab1Shenhe1 && (examineTemp.flowCompeleted == 1) " type="primary" :disabled="isokDisable" @click="form_examine_save()">确认1</el-button>
+        <el-button v-if="istab1Shenhe2 && (examineTemp.flowCompeleted == 2)" type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认2</el-button>
+        <el-button v-if="istab1Shenhe3 && (examineTemp.flowCompeleted == 4)" type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认3</el-button>
+        <el-button v-if="istab1Shenhe4 && (examineTemp.flowCompeleted == 6)" type="primary" :disabled="isokDisable" @click="form_examine_save4()">确认4</el-button>
+        <!-- <el-button v-if="dialogStatus==='examine22'" type="primary" :disabled="isokDisable" @click="form_examine_save22()">确认</el-button>
+        <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
+        <el-button v-if="dialogStatus==='examine33'" type="primary" :disabled="isokDisable" @click="form_examine_save33()">确认</el-button>
+        <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</el-button> -->
+        <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
+      </div>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import echarts from 'echarts'
+require('echarts/theme/macarons')
+import { GetDataByNames, GetReportform, GetDataByName, PostDataByName, checkButtons, ExecDataByConfig } from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime, json2excel } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'Tab1',
+  components: { Pagination },
+  inject: ['reload'],
+  data() {
+    return {
+      myHeight: document.documentElement.clientHeight - 85 - 200,
+      // 多个下拉框 - 请求内容
+      send_select_list: [
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'findAllProviderByCt', offset: 0, pagecount: 0, parammaps: { 'id': Cookies.get('pastureid') }}
+
+      ],
+
+      //  下拉框 - 牧场
+      pastureNameList: [
+        // {id: "犊牛1", name: "犊牛1"},
+        // {id: "犊牛2", name: "犊牛2"},
+        // {id: "犊牛3", name: "犊牛3"}
+      ],
+
+      getDepartParam1: {
+        name: 'findAllDepart', offset: 0, pagecount: 0,
+        parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
+      },
+      employeNameList: [],
+      departNameList1: [],
+      getDepartParam2: {
+        name: 'findAllDepart', offset: 0, pagecount: 0,
+        parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
+      },
+      departNameList2: [],
+
+      statuesNameList: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
+      isokDisable: false,
+
+      tableObj1: {
+        getdataListParm: {
+          name: 'getBigoutsourcingList',
+          // 请求的 page 无用参数  offset 第几页  pagecount 每页多少条
+          page: 1, offset: 1, pagecount: 10, returntype: 'Map',
+          parammaps: { pastureName: Cookies.get('pasturename'), outsourcingCode: '', departmentName: '', status: '', eqName: '', eqCode: '', contractCode: '', inputDatetime: '', startdate: '', enddate: '' }
+        },
+        tableKey: 0, listLoading: false,
+        // 返回的 pageNum 第几页  pageSize 每页多少条 total 总条数
+        pageNum: '', pageSize: '', total: 0,
+        list: [
+
+        ]
+      },
+
+      getAddContListParam: {
+        name: 'getOutsourcingList',
+        page: 1, offset: 1, pagecount: 20, returntype: 'Map',
+        parammaps: { 'bigId': '' }
+      },
+
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() > Date.now()// 当天之前的时间可选
+        }
+      },
+
+      rules: {
+        outsourcingCode: [{ required: true, message: '必填', trigger: 'blur' }],
+        equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
+        departmentId: [{ required: true, message: '必填', trigger: 'blur' }],
+        contract: [{ required: true, message: '必填', trigger: 'blur' }],
+        description: [{ required: true, message: '必填', trigger: 'blur' }]
+        // equipmentName: [{ required: true, message: '必填', trigger: 'blur' }]
+      },
+
+      tableKey: 0,
+      listLoading: true,
+      total: 0,
+      list: [],
+      dialogStatus: '',
+      dialogFormVisible: false,
+      dialogFormVisibleSee: false,
+      listLoadingSee: true,
+      listSee: [],
+      totalSee: 0,
+      seeTemp: {},
+      getdataListSee: {
+        name: 'getpartpurchaseBybig',
+        returntype: 'Map',
+        parammaps: {}
+      },
+      createTemp: {
+        pastureId: this.$store.state.user.pastureid,
+        departmentId: this.$store.state.user.departmentid,
+        employeId: this.$store.state.user.employeid,
+        date: parseTime(new Date(), '{y}-{m}-{d}'),
+        outsourcingCode: '',
+        applicant: '',
+        RUCode: '',
+        providerId: '',
+        departmentName: '',
+        description: '',
+        contract: 1
+      },
+
+      costTypeList: [
+        { id: '保养', name: '保养' },
+        { id: '维修', name: '维修' },
+        { id: '物耗', name: '物耗' },
+        { id: '土建', name: '土建' },
+        { id: '安全', name: '安全' }
+      ],
+
+      providerNameList: [
+
+      ],
+
+      getParmCreateNumber: {
+        name: 'autoCreatCode',
+        page: 0,
+        offset: 0,
+        pagecount: 0,
+        returntype: 'Map',
+        parammaps: {
+          pastureId: Cookies.get('pastureid'),
+          codeType: 'WW'
+        }
+      },
+
+      listAddCont: [
+        { providerName: '', providerId: '0', eqId: '0', contractId: '0' }
+      ],
+      activeList: [],
+      active: 1,
+
+      EqNameList: [],
+      requestEqName: {
+        name: 'geteqbyNameCode', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
+        parammaps: { pastureId: Cookies.get('pastureid') }
+      },
+      EqCodeList: [],
+
+      dialogFormVisible_Examine: false,
+      examineTemp: {
+        'status': 1,
+        'empid': '',
+        'flowCompeleted': '',
+        'workflowNote': '',
+        'id': ''
+      },
+      statueReason: false,
+      rowStyle: { maxHeight: 50 + 'px', height: 35 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      textMap: {
+        update: '编辑',
+        create: '新增',
+        see: '查看',
+        examine: '审核1',
+        examine22: '审核2',
+        examine2: '审核3',
+        examine33: '审核4',
+        examine3: '审核5'
+      },
+
+      istab1Add: [],
+      istab1Edit: [],
+      istab1Del: [],
+      istab1Shenhe1: [],
+      istab1Shenhe2: [],
+      istab1Shenhe4: [],
+      getParmCreateNumber2: {
+        name: 'autoCreatCode',
+        page: 0, offset: 0, pagecount: 0, returntype: 'Map',
+        parammaps: {
+          pastureId: Cookies.get('pastureid'),
+          codeType: 'WY'
+        }
+      }
+
+    }
+  },
+  created() {
+    this.get_select_list()
+    this.get_table_data1()
+    this.get_auto_buttons()
+  },
+  methods: {
+    // 获取按钮权限
+    get_auto_buttons() {
+      const istab1Add = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:add')
+      this.istab1Add = istab1Add
+
+      const istab1Edit = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:edit')
+      this.istab1Edit = istab1Edit
+
+      const istab1Del = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:del')
+      this.istab1Del = istab1Del
+
+      const istab1Shenhe1 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe1')
+      this.istab1Shenhe1 = istab1Shenhe1
+
+      const istab1Shenhe2 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe2')
+      this.istab1Shenhe2 = istab1Shenhe2
+
+      const istab1Shenhe3 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe3')
+      this.istab1Shenhe3 = istab1Shenhe3
+
+      const istab1Shenhe4 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten:shenhe4')
+      this.istab1Shenhe4 = istab1Shenhe4
+    },
+
+    querySearchEqNameCont(queryString, cb) {
+      console.log('备件名称/设备内部编号模糊查询输入值', queryString)
+      this.requestEqName.parammaps['eqName'] = queryString
+      GetDataByName(this.requestEqName).then(response => {
+        console.log('备件名称模糊查询搜索data', response.data.list)
+        this.EqNameList = response.data.list
+        cb(this.EqNameList)
+      })
+    },
+    handleSelectEqNameCont(item, row) {
+      console.log('备件名称/设备内部编号模糊查询选中值', item.eqName)
+      console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
+      this.$set(row, 'eqCode', item.eqCode)
+      this.$forceUpdate()
+    },
+    querySearchCodeCont(queryString, cb) {
+      console.log('备件名称/设备内部编号模糊查询输入值', queryString)
+      this.requestEqName.parammaps['eqCode'] = queryString
+      GetDataByName(this.requestEqName).then(response => {
+        console.log('备件名称模糊查询搜索data', response.data.list)
+        this.EqNameList = response.data.list
+        cb(this.EqNameList)
+      })
+    },
+    handleSelectEqCodeCont(item, row) {
+      console.log('备件名称/设备内部编号模糊查询选中值', item)
+      console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
+      this.$set(row, 'eqName', item.eqName)
+      this.$forceUpdate()
+    },
+    blurSelectEqNameCont(item, row) {
+      this.$set(row, 'eqName', '')
+      this.$set(row, 'eqCode', '')
+    },
+    blurSelectEqCodeCont(item, row) {
+      this.$set(row, 'eqName', '')
+      this.$set(row, 'eqCode', '')
+    },
+
+    get_select_list() {
+      GetDataByNames(this.send_select_list).then(response => {
+        this.pastureNameList = response.data.getPastureRoleList.list //  response.data.findAllPasture.list
+        console.log('牧场下拉框', this.pastureNameList)
+        this.employeNameList = response.data.findAllEmploye.list
+        console.log('申请人下拉框', this.employeNameList)
+        this.providerNameList = response.data.findAllProviderByCt.list
+
+        this.get_depart_list1()
+      })
+    },
+    change_pasture1(item) {
+      this.getDepartParam1.parammaps.pastureId = this.pastureNameList.find(obj => obj.name == item).id
+      this.tableObj1.getdataListParm.parammaps.departmentId = ''
+      this.get_depart_list1()
+    },
+    // 部门List
+    get_depart_list1() {
+      GetDataByName(this.getDepartParam1).then(response => {
+        this.departNameList1 = response.data.list
+      })
+    },
+
+    change_pasture2(item) {
+      this.getDepartParam2.parammaps.pastureId = item
+      this.get_depart_list2()
+    },
+
+    get_depart_list2() {
+      GetDataByName(this.getDepartParam2).then(response => {
+        this.departNameList2 = response.data.list
+      })
+    },
+
+    change_depart2(item) {
+      this.createTemp.departmentName = this.departNameList2.find(obj => obj.id == item).name
+    },
+
+    get_table_data1() {
+      this.tableObj1.listLoading = false
+
+      if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
+        this.tableObj1.getdataListParm.parammaps.startdate = this.$refs['inputDatetime'].value[0]
+        this.tableObj1.getdataListParm.parammaps.enddate = this.$refs['inputDatetime'].value[1]
+      } else {
+        this.tableObj1.getdataListParm.parammaps.inputDatetime = ''
+        this.tableObj1.getdataListParm.parammaps.startdate = ''
+        this.tableObj1.getdataListParm.parammaps.enddate = ''
+      }
+
+      GetDataByName(this.tableObj1.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          this.tableObj1.list = response.data.list
+          this.tableObj1.pageNum = response.data.pageNum
+          this.tableObj1.pageSize = response.data.pageSize
+          this.tableObj1.total = response.data.total
+        } else {
+          this.tableObj1.list = []
+        }
+
+        setTimeout(() => {
+          this.tableObj1.listLoading = false
+        }, 100)
+      })
+    },
+    form_search() {
+      console.log('查询')
+
+      this.get_table_data1()
+    },
+    change_contract(val) {
+      console.log(val)
+      if (val == 1) {
+        this.createTemp.contract = 1
+      } else {
+        this.createTemp.contract = 0
+      }
+    },
+    form_add() {
+      this.reset_create()
+      this.getDepartParam2.parammaps.pastureId = this.createTemp.pastureId
+      this.get_depart_list2()
+      this.dialogStatus = 'create'
+      this.dialogFormVisible = true
+      this.listLoading = false
+      this.$nextTick(() => {
+        this.$refs['createTemp'].clearValidate()
+      })
+      // 新增生成单号
+      this.get_create_num()
+    },
+
+    reset_create() {
+      this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
+      this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
+
+      if (parseInt(Cookies.get('pastureid')) == 18) {
+        this.createTemp.departmentId = ''
+      }
+      this.createTemp.departmentName = Cookies.get('departmentname')
+      this.createTemp.employeId = parseInt(Cookies.get('employeid'))
+      this.createTemp.date = parseTime(new Date(), '{y}-{m}-{d}')
+
+      this.createTemp.outsourcingCode = ''
+      this.createTemp.applicant = parseInt(Cookies.get('employeid'))
+      this.createTemp.providerId = ''
+      this.createTemp.contract = 1
+
+      this.createTemp.description = ''
+
+      this.listAddCont = [{ providerName: '', providerId: '0', eqId: '0', contractId: '0', amount: '', contractCode: '', date: '', eqCode: '', eqName: '', remark: '', typea: '' }]
+    },
+
+    get_create_num() {
+      GetDataByName(this.getParmCreateNumber).then(response => {
+        this.$nextTick(() => {
+          console.log('新增单号', response.data.list[0].orderCode)
+          this.createTemp.outsourcingCode = response.data.list[0].orderCode
+          this.$forceUpdate()
+        })
+      })
+    },
+
+    add_dialog_save() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          console.log(this.listAddCont)
+          if (this.createTemp.outsourcingCode == '' || this.createTemp.outsourcingCode == null || this.createTemp.outsourcingCode == undefined) {
+            GetDataByName(this.getParmCreateNumber2).then(response => {
+              this.$nextTick(() => {
+                console.log('新增单号', response.data.list[0].orderCode)
+                this.createTemp.outsourcingCode = response.data.list[0].orderCode
+                this.$forceUpdate()
+                this.add_dialog_saveSave()
+              })
+            })
+          } else {
+            this.add_dialog_saveSave()
+          }
+        }
+      })
+    },
+
+    add_dialog_saveSave() {
+      for (var j = 0; j < this.listAddCont.length; j++) {
+        console.log(this.listAddCont[j].amount)
+        if (this.createTemp.contract == 1) {
+          if (this.listAddCont[j].providerName == '') {
+            this.$message({ type: 'warning', message: '请检查供应商是否未填写', duration: 2000 })
+            return false
+          }
+        }
+        if (this.listAddCont[j].eqName == '') {
+          this.$message({ type: 'warning', message: '请检查设备名称是否未填写', duration: 2000 })
+          return false
+        }
+        if (this.listAddCont[j].eqCode == '') {
+          this.$message({ type: 'warning', message: '请检查设备内部编号是否未填写', duration: 2000 })
+          return false
+        }
+        if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
+          // this.$message({ type: 'warning', message: '请检查金额是否未填写', duration: 2000 })
+          // return false
+        } else {
+          // var rulesAmount = /^[1-9]\d*$/
+          // if (!rulesAmount.test(this.listAddCont[j].amount)) {
+          //   this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
+          //   return false
+          // }
+        }
+
+        if (this.createTemp.contract == 1) {
+          if (this.listAddCont[j].contractCode == null || this.listAddCont[j].contractCode === '') {
+            this.$message({ type: 'warning', message: '请检查合同编号是否未填写', duration: 2000 })
+            return false
+          }
+        }
+      }
+      var amount = 0
+      if (this.createTemp.contract == 0) {
+        amount = '@insertSpotList.amount'
+      } else {
+        amount = 0
+      }
+      if (this.createTemp.contract == 0) {
+        // 无合同
+        this.$set(this.createTemp, 'status', 0)
+      } else {
+        // 有合同
+        this.$set(this.createTemp, 'status', 1)
+      }
+      var send_data = {
+        'common': { 'returnmap': '0' },
+        'data': [
+          {
+            'name': 'addBigoutsourcing', 'type': 'e',
+            'parammaps': this.createTemp
+          },
+          {
+            'name': 'insertSpotList',
+            'resultmaps': { 'list': this.listAddCont },
+
+            'children': [
+              {
+                'name': 'addOutsourcing', 'type': 'e',
+                'parammaps': {
+                  'bigId': '@addBigoutsourcing.LastInsertId',
+                  'providerId': '@insertSpotList.providerId',
+                  'amount': amount,
+                  'eqId': '@insertSpotList.eqId',
+                  'eqCode': '@insertSpotList.eqCode',
+                  'eqName': '@insertSpotList.eqName',
+                  'typea': '@insertSpotList.typea',
+                  'date': '@insertSpotList.date',
+                  'contractId': '@insertSpotList.contractId',
+                  'providerName': '@insertSpotList.providerName',
+                  'contractCode': '@insertSpotList.contractCode',
+                  'remark': '@insertSpotList.remark',
+                  'status': this.createTemp.status
+                }
+              }
+            ]
+          }
+        ]
+      }
+      ExecDataByConfig(send_data).then(response => {
+        console.log('新增保存发送参数', send_data)
+        if (response.msg === 'fail') {
+          this.$notify({
+            title: '保存失败',
+            message: response.data,
+            type: 'warning',
+            duration: 2000
+          })
+        } else {
+          if (this.createTemp.contract == 1) {
+            this.add_dialog_saveSave2()
+          }
+          this.dialogFormVisible = false
+
+          this.get_table_data1()
+
+          this.$notify({
+            title: '',
+            message: '保存成功',
+            type: 'success',
+            duration: 2000
+          })
+        }
+      })
+      return true
+    },
+
+    form_see(row) {
+      console.log('查看======》', row)
+      this.getDepartParam2.parammaps.pastureId = row.pastureId
+      this.get_depart_list2()
+      this.createTemp = Object.assign({}, row)
+      this.dialogStatus = 'see'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['createTemp'].clearValidate()
+      })
+
+      // 总价大于等于10000,有高级设备工程师
+      if (row.isAudit == 1) {
+        if (row.flowCompeleted == 1) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人' },
+            { title: '财务负责人' },
+            { title: '场长' },
+            { title: '运营支持部高级工程师' }
+          ]
+          this.active = 1
+        } else if (row.flowCompeleted == 2) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
+            { title: '财务负责人' },
+            { title: '场长' },
+            { title: '运营支持部高级工程师' }
+          ]
+          this.active = 2
+        } else if (row.flowCompeleted === 3) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName, status: 'error', reason: row.workflowNote },
+            { title: '财务负责人' },
+            { title: '场长' },
+            { title: '运营支持部高级工程师' }
+          ]
+          this.active = 2
+        } else if (row.flowCompeleted === 4) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
+            { title: '财务负责人', date: row.equipmentdate, name: row.equipmentName },
+            { title: '场长' },
+            { title: '运营支持部高级工程师' }
+          ]
+          this.active = 3
+        } else if (row.flowCompeleted === 5) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
+            { title: '财务负责人', date: row.equipmentdate, name: row.equipmentName, status: 'error', reason: row.workflowNote },
+            { title: '场长' },
+            { title: '运营支持部高级工程师' }
+          ]
+          this.active = 3
+        } else if (row.flowCompeleted === 6) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
+            { title: '财务负责人', date: row.equipmentdate, name: row.equipmentName },
+            { title: '场长', date: row.fielddate, name: row.fieldName },
+            { title: '运营支持部高级工程师' }
+          ]
+          this.active = 4
+        } else if (row.flowCompeleted === 7) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
+            { title: '财务负责人', date: row.equipmentdate, name: row.equipmentName },
+            { title: '场长', date: row.fielddate, name: row.fieldName, status: 'error', reason: row.workflowNote },
+            { title: '运营支持部高级工程师' }
+          ]
+          this.active = 4
+        } else if (row.flowCompeleted === 8) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
+            { title: '财务负责人', date: row.equipmentdate, name: row.equipmentName },
+            { title: '场长', date: row.fielddate, name: row.fieldName },
+            { title: '运营支持部高级工程师', date: row.advanceddate, name: row.advancedName }
+          ]
+          this.active = 5
+        } else if (row.flowCompeleted === 9) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
+            { title: '财务负责人', date: row.equipmentdate, name: row.equipmentName },
+            { title: '场长', date: row.fielddate, name: row.fieldName },
+            { title: '运营支持部高级工程师', date: row.advanceddate, name: row.advancedName, status: 'error', reason: row.workflowNote }
+          ]
+          this.active = 5
+        }
+
+      // 总价小于10000 没有高级设备工程师,直接场长审核
+      } else {
+        if (row.flowCompeleted == 1) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人' },
+            { title: '财务负责人' },
+            { title: '场长' }
+          ]
+          this.active = 1
+        } else if (row.flowCompeleted == 2) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
+            { title: '财务负责人' },
+            { title: '场长' }
+          ]
+          this.active = 2
+        } else if (row.flowCompeleted === 3) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName, status: 'error', reason: row.workflowNote },
+            { title: '财务负责人' },
+            { title: '场长' }
+          ]
+          this.active = 2
+        } else if (row.flowCompeleted === 4) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
+            { title: '财务负责人', date: row.equipmentdate, name: row.equipmentName },
+            { title: '场长' }
+          ]
+          this.active = 3
+        } else if (row.flowCompeleted === 5) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
+            { title: '财务负责人', date: row.equipmentdate, name: row.equipmentName, status: 'error', reason: row.workflowNote },
+            { title: '场长' }
+          ]
+          this.active = 3
+        } else if (row.flowCompeleted === 6) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
+            { title: '财务负责人', date: row.equipmentdate, name: row.equipmentName },
+            { title: '场长', date: row.fielddate, name: row.fieldName }
+          ]
+          this.active = 4
+        } else if (row.flowCompeleted === 7) {
+          this.activeList = [
+            { title: '设备处长', date: row.createTime, name: row.applicantName },
+            { title: '部门负责人', date: row.departmentdate, name: row.departmentUserName },
+            { title: '财务负责人', date: row.equipmentdate, name: row.equipmentName },
+            { title: '场长', date: row.fielddate, name: row.fieldName, status: 'error', reason: row.workflowNote }
+          ]
+          this.active = 4
+        }
+      }
+      if (row.contract == 1) {
+        this.activeList = [
+          { title: '设备处长', date: row.createTime, name: row.applicantName }
+        ]
+        this.active = 1
+      }
+      this.getAddContListParam.parammaps.bigId = row.id
+      this.getAddContList()
+    },
+
+    getAddContList() {
+      GetDataByName(this.getAddContListParam).then(response => {
+        this.listAddCont = response.data.list
+        this.listLoading = false
+      })
+    },
+
+    form_edit(row) {
+      this.reset_create()
+      console.log('编辑', row)
+      this.getDepartParam2.parammaps.pastureId = row.pastureId
+      this.get_depart_list2()
+      if (row.providerId == undefined) {
+        row.providerId = ''
+        row.providerName = ''
+      }
+      this.createTemp = Object.assign({}, row) // copy obj
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['createTemp'].clearValidate()
+      })
+      this.getAddContListParam.parammaps.bigId = row.id
+      this.getAddContList()
+    },
+    edit_dialog_save() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          this.edit_dialog_saveSave()
+        }
+      })
+    },
+    edit_dialog_saveSave() {
+      for (var j = 0; j < this.listAddCont.length; j++) {
+        console.log(this.listAddCont[j].amount)
+        // eslint-disable-next-line use-isnan
+        if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
+          this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
+          return false
+        }
+      }
+
+      this.listAddCont[0].providerId = '0'
+      this.listAddCont[0].eqId = '0'
+      this.listAddCont[0].contractId = '0'
+
+      var amount = 0
+      if (this.createTemp.contract == 0) {
+        amount = '@insertSpotList.amount'
+      } else {
+        amount = 0
+      }
+      var send_data = {
+        'common': { 'returnmap': '0' },
+        'data': [
+          {
+            'name': 'editBigoutsourcing', 'type': 'e',
+            'parammaps': this.createTemp
+          },
+          {
+            'name': 'insertSpotList',
+            'resultmaps': { 'list': this.listAddCont },
+            'children': [
+              {
+                'name': 'editOutsourcing', 'type': 'e',
+                'parammaps': {
+                  'bigId': '@insertSpotList.LastInsertId',
+                  'providerId': '@insertSpotList.providerId',
+                  'amount': amount,
+                  'eqId': '@insertSpotList.eqId',
+                  'eqCode': '@insertSpotList.eqCode',
+                  'eqName': '@insertSpotList.eqName',
+                  'typea': '@insertSpotList.typea',
+                  'date': '@insertSpotList.date',
+                  'contractId': '@insertSpotList.contractId',
+                  'id': '@insertSpotList.id',
+                  'providerName': '@insertSpotList.providerName',
+                  'contractCode': '@insertSpotList.contractCode'
+                }
+              }
+            ]
+          },
+          {
+            'name': 'updateBigoutsourcingFlowCompeleted', 'type': 'e',
+            'parammaps': {
+              id: this.createTemp.id
+            }
+          }
+        ]
+      }
+
+      ExecDataByConfig(send_data).then(response => {
+        console.log('新增保存发送参数', send_data)
+        if (response.msg === 'fail') {
+          this.$notify({
+            title: '保存失败',
+            message: response.data,
+            type: 'warning',
+            duration: 2000
+          })
+        } else {
+          this.dialogFormVisible = false
+
+          this.get_table_data1()
+          this.$notify({
+            title: '',
+            message: '保存成功',
+            type: 'success',
+            duration: 2000
+          })
+        }
+      })
+    },
+
+    form_delete(row) {
+      console.log('点击了删除', row)
+      MessageBox.confirm('确认删除此条信息?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        var send_data = {
+          'common': { 'returnmap': '0' },
+          'data': [
+            {
+              'name': 'deleteBigoutsourcing', 'type': 'e',
+              'parammaps': { 'id': row.id }
+            }
+          ]
+        }
+
+        ExecDataByConfig(send_data).then(response => {
+          this.get_table_data1()
+          this.$notify({
+            title: '成功',
+            message: '删除成功',
+            type: 'success',
+            duration: 2000
+          })
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        })
+      })
+    },
+
+    change_statue(val) {
+      if (val == 2) {
+        this.statueReason = true
+      } else {
+        this.statueReason = false
+      }
+    },
+
+    form_examine(row) {
+      console.log('点击了设备处长审核', row)
+      if (row == undefined) {
+        this.examineTemp = this.createTemp
+        this.$set(this.createTemp, 'status', 1)
+        this.$set(this.createTemp, 'workflowNote', '')
+      } else {
+        this.examineTemp = Object.assign({}, row)
+        this.$set(this.examineTemp, 'status', 1)
+        this.$set(this.examineTemp, 'workflowNote', '')
+      }
+      this.dialogStatus = 'examine'
+      this.dialogFormVisible_Examine = true
+      this.statueReason = false
+    },
+    form_examine_save() {
+      console.log('点击了设备处长审核', this.examineTemp)
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['examineTemp'].validate(valid => {
+        if (valid) {
+          // 不通过
+          if (this.statueReason) {
+            this.examineTemp.status = 2
+            // 审核角色
+            this.examineTemp.flowCompeleted = '3'
+          } else {
+            this.examineTemp.status = 0
+            this.examineTemp.flowCompeleted = '2'
+          }
+          this.examineTemp.empid = Cookies.get('employeid')
+
+          var send_data = {
+            'common': { 'returnmap': '0' },
+            'data': [
+              // {
+              //     "name": "editBigoutsourcingEquipment",  "type": "e",
+              //     "parammaps": this.examineTemp
+              // },
+              {
+                'name': 'editBigoutsourcingDepartment', 'type': 'e',
+                'parammaps': this.examineTemp
+              }
+            ]
+          }
+          console.log(send_data, '审核1保存')
+          ExecDataByConfig(send_data).then(response => {
+            console.log('审核确认发送参数', send_data)
+            if (response.msg !== 'fail') {
+              this.get_table_data1()
+              this.dialogFormVisible_Examine = false
+              this.statueReason = false
+              this.$notify({
+                title: '成功',
+                message: '审核成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+
+    form_examine2(row) {
+      console.log('点击了场长审核', row)
+      this.examineTemp = Object.assign({}, row)
+      if (row == undefined) {
+        // this.examineTemp = this.createTemp
+        this.$set(this.createTemp, 'status', 1)
+        this.$set(this.createTemp, 'workflowNote', '')
+      } else {
+        this.$set(this.examineTemp, 'status', 1)
+        this.$set(this.examineTemp, 'workflowNote', '')
+      }
+      this.dialogStatus = 'examine'
+      this.statueReason = false
+      this.dialogFormVisible_Examine = true
+      // GetDataByName(this.getParmCreateNumber).then(response => {
+      //   this.$nextTick(() => {
+      //     console.log('新增单号', response.data.list[0].orderCode)
+      //     this.examineTemp.acceptanceCode = response.data.list[0].orderCode
+      //     this.$set(this.examineTemp,'acceptanceCode',response.data.list[0].orderCode)
+      //     this.$forceUpdate()
+      //   })
+      // })
+    },
+    add_dialog_saveSave2() {
+      console.log(this.examineTemp, '=======contract')
+      // this.examineTemp.iscontract =
+
+      // 牧场
+      var mydata = {
+        // acceptanceCode:this.createTemp.acceptanceCode,
+        pastureId: this.createTemp.pastureId,
+        departmentId: this.createTemp.departmentId,
+        applicant: Cookies.get('employeid'),
+        outsourcingCode: this.createTemp.outsourcingCode,
+        applyType: 0,
+        date: parseTime(new Date(), '{y}-{m}-{d}'),
+        status: 1
+      }
+      if (this.examineTemp.contract == 0) {
+        mydata.iscontract = 1
+      } else {
+        mydata.iscontract = 0
+      }
+      var send_data = {
+        'common': { 'returnmap': '0' },
+        'data': [
+          {
+            'name': 'insertBigacceptance',
+            'type': 'e',
+            'parammaps': mydata
+          }
+        ]
+      }
+      ExecDataByConfig(send_data).then(response => {
+        console.log('新增保存发送参数', send_data)
+        if (response.msg === 'fail') {
+          this.$notify({
+            title: '保存失败',
+            message: response.data,
+            type: 'warning',
+            duration: 2000
+          })
+        } else {
+          // this.$notify({
+          //   title: '',
+          //   message: '保存成功',
+          //   type: 'success',
+          //   duration: 2000
+          // })
+        }
+      })
+    },
+
+    form_examine_save2() {
+      console.log('点击了场长审核', this.examineTemp)
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      // this.examineTemp.acceptanceCode = this.createTemp.acceptanceCode
+
+      this.$refs['examineTemp'].validate(valid => {
+        if (valid) {
+          // 不通过
+          if (this.statueReason) {
+            this.examineTemp.status = 2
+            // 审核角色
+            this.examineTemp.flowCompeleted = '5'
+          } else {
+            // //总价大于等于10000 有高级设备工程师审核
+            //  if(this.examineTemp.isAudit == 1){
+            //     this.examineTemp.status = 0
+            // //总价小于10000 没有高级设备工程师,直接场长审核
+            //  } else {
+            //     this.examineTemp.status = 1
+            //  }
+            this.examineTemp.status = 0
+            this.examineTemp.flowCompeleted = '4'
+          }
+          this.examineTemp.empid = Cookies.get('employeid')
+
+          var send_data = {
+            'common': { 'returnmap': '0' },
+            'data': [
+              // {
+              //     "name": "editBigoutsourcingField",  "type": "e",
+              //     "parammaps": this.examineTemp
+              // },
+              {
+                'name': 'editBigoutsourcingEquipment', 'type': 'e',
+                'parammaps': this.examineTemp
+              }
+            ]
+          }
+          console.log(send_data, '审核2保存')
+          ExecDataByConfig(send_data).then(response => {
+            console.log('审核确认发送参数', send_data)
+            if (response.msg !== 'fail') {
+              if (this.examineTemp.status == 1) {
+                this.add_dialog_saveSave2()
+              }
+              this.get_table_data1()
+              this.dialogFormVisible_Examine = false
+              this.statueReason = false
+              this.$notify({
+                title: '成功',
+                message: '审核成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+
+    form_examine3(row) {
+      console.log('点击了高级工程师  审核', row)
+      this.examineTemp = Object.assign({}, row)
+      if (row == undefined) {
+        // this.examineTemp = this.createTemp
+        this.$set(this.createTemp, 'status', 1)
+        this.$set(this.createTemp, 'workflowNote', '')
+      } else {
+        this.$set(this.examineTemp, 'status', 1)
+        this.$set(this.examineTemp, 'workflowNote', '')
+      }
+      this.dialogStatus = 'examine'
+      this.dialogFormVisible_Examine = true
+      this.statueReason = false
+    },
+    form_examine_save3() {
+      console.log('点击了高级工程师审核', this.examineTemp)
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['examineTemp'].validate(valid => {
+        if (valid) {
+          // 不通过
+          if (this.statueReason) {
+            this.examineTemp.status = 2
+            // 审核角色
+            this.examineTemp.flowCompeleted = '7'
+          } else {
+            // 总价大于等于10000 有高级设备工程师审核
+            if (this.examineTemp.isAudit == 1) {
+              this.examineTemp.status = 0
+            // 总价小于10000 没有高级设备工程师,直接场长审核
+            } else {
+              this.examineTemp.status = 1
+            }
+            this.examineTemp.flowCompeleted = '6'
+          }
+          this.examineTemp.empid = Cookies.get('employeid')
+
+          var send_data = {
+            'common': { 'returnmap': '0' },
+            'data': [
+              // {
+              //     "name": "editBigoutsourcingAdvanceddate",  "type": "e",
+              //     "parammaps": this.examineTemp
+              // },
+              {
+                'name': 'editBigoutsourcingField', 'type': 'e',
+                'parammaps': this.examineTemp
+              }
+            ]
+          }
+          console.log(send_data, '审核3保存', this.examineTemp)
+          ExecDataByConfig(send_data).then(response => {
+            console.log('审核确认发送参数', send_data)
+            if (response.msg !== 'fail') {
+              if (this.examineTemp.status == 1) {
+                this.add_dialog_saveSave2()
+              }
+              this.get_table_data1()
+              this.dialogFormVisible_Examine = false
+              this.statueReason = false
+              this.$notify({
+                title: '成功',
+                message: '审核成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+    form_examine4(row) {
+      console.log('点击了高级工程师  审核', row)
+      this.examineTemp = Object.assign({}, row)
+      if (row == undefined) {
+        // this.examineTemp = this.createTemp
+        this.$set(this.createTemp, 'status', 1)
+        this.$set(this.createTemp, 'workflowNote', '')
+      } else {
+        this.$set(this.examineTemp, 'status', 1)
+        this.$set(this.examineTemp, 'workflowNote', '')
+      }
+      this.dialogStatus = 'examine'
+      this.dialogFormVisible_Examine = true
+      this.statueReason = false
+    },
+    form_examine_save4() {
+      console.log('点击了高级工程师审核', this.examineTemp)
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['examineTemp'].validate(valid => {
+        if (valid) {
+          // 不通过
+          if (this.statueReason) {
+            this.examineTemp.status = 2
+            // 审核角色
+            this.examineTemp.flowCompeleted = '9'
+          } else {
+            this.examineTemp.status = 1
+            this.examineTemp.flowCompeleted = '8'
+          }
+          this.examineTemp.empid = Cookies.get('employeid')
+
+          var send_data = {
+            'common': { 'returnmap': '0' },
+            'data': [
+              // {
+              //     "name": "editBigoutsourcingAdvanceddate",  "type": "e",
+              //     "parammaps": this.examineTemp
+              // },
+              {
+                'name': 'editBigoutsourcingAdvanceddate', 'type': 'e',
+                'parammaps': this.examineTemp
+              }
+            ]
+          }
+          console.log(send_data, '审核4保存')
+          ExecDataByConfig(send_data).then(response => {
+            console.log('审核确认发送参数', send_data)
+            if (response.msg !== 'fail') {
+              if (this.examineTemp.status == 1) {
+                this.add_dialog_saveSave2()
+              }
+              this.get_table_data1()
+              this.dialogFormVisible_Examine = false
+              this.statueReason = false
+              this.$notify({
+                title: '成功',
+                message: '审核成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+
+  // .content{
+  //   padding: 20px 20px;
+  //   .title{
+  //     text-align: center;
+  //     font-weight: 700;
+  //   }
+  //   .title2{
+  //     float: left;
+  //     font-weight: 700;
+  //     padding: 10px 0;
+  //   }
+  // }
+
+</style>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 349 - 387
src/views/maintenance/subcontractingMainten/tabPage/tab11.vue


+ 2345 - 2345
src/views/maintenance/subcontractingMainten/tabPage/tab2.vue

@@ -1,169 +1,169 @@
-<template>
-  <div class="app-container">
-    <div class="filter-container">
-
-      <el-select v-model="tableObj1.getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="change_pasture1">
-        <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.name" />
-      </el-select>
-
-      <el-select v-model="tableObj1.getdataListParm.parammaps.departmentId" clearable style="width: 140px;" placeholder="部门" class="filter-item">
-        <el-option v-for="item in departNameList1" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-
-      <el-input v-model="tableObj1.getdataListParm.parammaps.acceptanceCode" placeholder="委外验收单号" style="width: 200px;" class="filter-item" />
-
-      <el-select v-model="tableObj1.getdataListParm.parammaps.status" style="width: 140px;" clearable placeholder="审核状态" class="filter-item">
-        <el-option v-for="item in statuesNameList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-
-      <el-input v-model="tableObj1.getdataListParm.parammaps.outsourcingCode" placeholder="委外申请单号" style="width: 200px;" class="filter-item" />
-
-      <el-select v-model="tableObj1.getdataListParm.parammaps.iscontract" style="width: 140px;" clearable placeholder="有无合同" class="filter-item">
-        <el-option v-for="item in iscontractList" :key="item.id" :label="item.name" :value="item.id" />
-      </el-select>
-
-      <el-date-picker ref="inputDatetime" v-model="tableObj1.getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
-
-
-
-      <el-button  class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
-
-      <!-- <el-button  v-if="istab2Add" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button> -->
-
-
-
-    </div>
-
-
-    <div class="elTable">
-      <el-table :max-height="myHeight"  :key="tableObj1.tableKey"  v-loading="tableObj1.listLoading" element-loading-text="给我一点时间"  :data="tableObj1.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed"   >
-
-
-        <el-table-column label="序号" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (tableObj1.pageNum-1) * tableObj1.pageSize + 1 }}</span>
-          </template>
-        </el-table-column>
-
-        <el-table-column label="委外验收单号" min-width="120px" align="center" prop="acceptanceCode" />
-        <el-table-column label="牧场" min-width="120px" align="center" prop="pastureName" />
-        <el-table-column label="部门 " min-width="120px" align="center" prop="departmentName" />
-
-        <el-table-column label="申请人" min-width="120px" align="center" prop="applicantName" />
-        <el-table-column label="合同" min-width="120px" align="center" prop="contract">
-          <template slot-scope="scope">
-              <span v-if="scope.row.iscontract == 0 ">有</span>
-              <span v-else>无</span>
-            </template>
-        </el-table-column>
-        <el-table-column label="日期" min-width="120px" align="center" prop="date" />
-        <el-table-column label="审核状态" min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span v-if="scope.row.status == 0 ">未离厂</span>
-            <span v-else-if="scope.row.status == 1 ">未回厂</span>
-            <span v-else-if="scope.row.status == 2 ">已回厂</span>
-            <span v-else>已验收</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" align="center" width="320" class-name="small-padding fixed-width" fixed="right">
-        <template slot-scope="{row}">
-          <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
-          <el-button  v-if="istab2Edit && row.isAcceptance == 0"  type="success" size="mini" @click="form_edit(row)">编辑</el-button>
-          <el-button v-if="istab2Del && row.isAcceptance == 0" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
-
-          <el-button  v-if="row.isAcceptance == 0"  style="display:inline-block" type="success" size="mini" @click="form_submit(row)">提交</el-button>
-          <el-button  v-if="istab2Shenhe1  && row.isAcceptance == 1 && (row.flowCompeleted == 1) "  style="display:inline-block" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
-          <el-button  v-if="istab2Shenhe2 && row.isAcceptance == 1 && (row.flowCompeleted == 2) "  style="display:inline-block" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
-          <el-button  v-if="istab2Shenhe3 && row.isAcceptance == 1 && (row.flowCompeleted == 4) "  style="display:inline-block" type="success" size="mini" @click="form_examine3(row)">审核3</el-button>
-
-        </template>
-      </el-table-column>
-
-      </el-table>
-
-      <pagination v-show="tableObj1.total>0" :total="tableObj1.total" :page.sync="tableObj1.getdataListParm.offset" :limit.sync="tableObj1.getdataListParm.pagecount" @pagination="get_table_data1()" />
-    </div>
-
-
-    <!-- 弹出层新增or修改 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
-      <div class="app-container">
-
-       <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="100px" style="width: 100%;">
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="委外验收单号:" prop="acceptanceCode">
-                <el-input ref="acceptanceCode" v-model="createTemp.acceptanceCode" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="牧场:" prop="pastureId" >
-                <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' || dialogStatus==='see'" @change="change_pasture2" >
-                  <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-
-            <el-col :span="8">
-              <el-form-item label="责任部门:" prop="departmentId">
-                <el-select v-model="createTemp.departmentId" placeholder="责任部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' ||  dialogStatus==='see'"  @change="change_depart2">
-                  <el-option v-for="item in departNameList2" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-
-            <el-col :span="8">
-              <el-form-item label="委外申请单号:" prop="outsourcingCode">
-                <el-autocomplete :disabled="dialogStatus==='update' ||  dialogStatus==='see'"
-                  v-model="createTemp.outsourcingCode"
-                  value-key="name"
-                  class="inline-input"
-                  :fetch-suggestions="getOutNumber"
-                  placeholder=""
-                  style="width:100%"
-                  @select="changeOutNumber"
-                >
-                  <template slot-scope="{ item }">
-                    <div class="name" style="display: inline;">{{ item.outsourcingCode }}</div>
-                    <!-- <div class="name" style="display: inline;">{{ item.departmentName }}</div> -->
-                  </template>
-                </el-autocomplete>
-              </el-form-item>
-            </el-col>
-
-
-            <el-col :span="8">
-              <el-form-item label="录入人:" prop="applicant">
-                <el-select v-model="createTemp.applicant" placeholder="录入人" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' ||  dialogStatus==='see'"  >
-                  <el-option v-for="item in employeNameList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="日期:" prop="date">
-                <el-date-picker v-model="createTemp.date" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'"  />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="有无合同:" prop="iscontract">
-                <span v-if="createTemp.iscontract == 0">有合同</span>
-                <span v-else>无合同</span>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="离厂日期:" prop="lcdate">
-                <el-date-picker v-model="createTemp.lcdate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'"  />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="回厂日期:" prop="hcdate">
-                <el-date-picker v-model="createTemp.hcdate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'"  />
-              </el-form-item>
-            </el-col>
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+
+      <el-select v-model="tableObj1.getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="change_pasture1">
+        <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
+
+      <el-select v-model="tableObj1.getdataListParm.parammaps.departmentId" clearable style="width: 140px;" placeholder="部门" class="filter-item">
+        <el-option v-for="item in departNameList1" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+
+      <el-input v-model="tableObj1.getdataListParm.parammaps.acceptanceCode" placeholder="委外验收单号" style="width: 200px;" class="filter-item" />
+
+      <el-select v-model="tableObj1.getdataListParm.parammaps.status" style="width: 140px;" clearable placeholder="审核状态" class="filter-item">
+        <el-option v-for="item in statuesNameList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+
+      <el-input v-model="tableObj1.getdataListParm.parammaps.outsourcingCode" placeholder="委外申请单号" style="width: 200px;" class="filter-item" />
+
+      <el-select v-model="tableObj1.getdataListParm.parammaps.iscontract" style="width: 140px;" clearable placeholder="有无合同" class="filter-item">
+        <el-option v-for="item in iscontractList" :key="item.id" :label="item.name" :value="item.id" />
+      </el-select>
+
+      <el-date-picker ref="inputDatetime" v-model="tableObj1.getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
+
+
+
+      <el-button  class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
+
+      <!-- <el-button  v-if="istab2Add" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button> -->
+
+
+
+    </div>
+
+
+    <div class="elTable">
+      <el-table :max-height="myHeight"  :key="tableObj1.tableKey"  v-loading="tableObj1.listLoading" element-loading-text="给我一点时间"  :data="tableObj1.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed"   >
+
+
+        <el-table-column label="序号" align="center" type="index" width="50px">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (tableObj1.pageNum-1) * tableObj1.pageSize + 1 }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="委外验收单号" min-width="120px" align="center" prop="acceptanceCode" />
+        <el-table-column label="牧场" min-width="120px" align="center" prop="pastureName" />
+        <el-table-column label="部门 " min-width="120px" align="center" prop="departmentName" />
+
+        <el-table-column label="申请人" min-width="120px" align="center" prop="applicantName" />
+        <el-table-column label="合同" min-width="120px" align="center" prop="contract">
+          <template slot-scope="scope">
+              <span v-if="scope.row.iscontract == 0 ">有</span>
+              <span v-else>无</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="日期" min-width="120px" align="center" prop="date" />
+        <el-table-column label="审核状态" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span v-if="scope.row.status == 0 ">未离厂</span>
+            <span v-else-if="scope.row.status == 1 ">未回厂</span>
+            <span v-else-if="scope.row.status == 2 ">已回厂</span>
+            <span v-else>已验收</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="320" class-name="small-padding fixed-width" fixed="right">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
+          <el-button  v-if="istab2Edit && row.isAcceptance == 0"  type="success" size="mini" @click="form_edit(row)">编辑</el-button>
+          <el-button v-if="istab2Del && row.isAcceptance == 0" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
+
+          <el-button  v-if="row.isAcceptance == 0"  style="display:inline-block" type="success" size="mini" @click="form_submit(row)">提交</el-button>
+          <el-button  v-if="istab2Shenhe1  && row.isAcceptance == 1 && (row.flowCompeleted == 1) "  style="display:inline-block" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
+          <el-button  v-if="istab2Shenhe2 && row.isAcceptance == 1 && (row.flowCompeleted == 2) "  style="display:inline-block" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
+          <el-button  v-if="istab2Shenhe3 && row.isAcceptance == 1 && (row.flowCompeleted == 4) "  style="display:inline-block" type="success" size="mini" @click="form_examine3(row)">审核3</el-button>
+
+        </template>
+      </el-table-column>
+
+      </el-table>
+
+      <pagination v-show="tableObj1.total>0" :total="tableObj1.total" :page.sync="tableObj1.getdataListParm.offset" :limit.sync="tableObj1.getdataListParm.pagecount" @pagination="get_table_data1()" />
+    </div>
+
+
+    <!-- 弹出层新增or修改 -->
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <div class="app-container">
+
+       <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="100px" style="width: 100%;">
+          <el-row :gutter="20">
+            <el-col :span="8">
+              <el-form-item label="委外验收单号:" prop="acceptanceCode">
+                <el-input ref="acceptanceCode" v-model="createTemp.acceptanceCode" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="牧场:" prop="pastureId" >
+                <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' || dialogStatus==='see'" @change="change_pasture2" >
+                  <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="8">
+              <el-form-item label="责任部门:" prop="departmentId">
+                <el-select v-model="createTemp.departmentId" placeholder="责任部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' ||  dialogStatus==='see'"  @change="change_depart2">
+                  <el-option v-for="item in departNameList2" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+
+            <el-col :span="8">
+              <el-form-item label="委外申请单号:" prop="outsourcingCode">
+                <el-autocomplete :disabled="dialogStatus==='update' ||  dialogStatus==='see'"
+                  v-model="createTemp.outsourcingCode"
+                  value-key="name"
+                  class="inline-input"
+                  :fetch-suggestions="getOutNumber"
+                  placeholder=""
+                  style="width:100%"
+                  @select="changeOutNumber"
+                >
+                  <template slot-scope="{ item }">
+                    <div class="name" style="display: inline;">{{ item.outsourcingCode }}</div>
+                    <!-- <div class="name" style="display: inline;">{{ item.departmentName }}</div> -->
+                  </template>
+                </el-autocomplete>
+              </el-form-item>
+            </el-col>
+
+
+            <el-col :span="8">
+              <el-form-item label="录入人:" prop="applicant">
+                <el-select v-model="createTemp.applicant" placeholder="录入人" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' ||  dialogStatus==='see'"  >
+                  <el-option v-for="item in employeNameList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="日期:" prop="date">
+                <el-date-picker v-model="createTemp.date" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'"  />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="8">
+              <el-form-item label="有无合同:" prop="iscontract">
+                <span v-if="createTemp.iscontract == 0">有合同</span>
+                <span v-else>无合同</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="离厂日期:" prop="lcdate">
+                <el-date-picker v-model="createTemp.lcdate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'"  />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="回厂日期:" prop="hcdate">
+                <el-date-picker v-model="createTemp.hcdate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'"  />
+              </el-form-item>
+            </el-col>
           </el-row>
           <el-row>
             <el-col :span="8">
@@ -171,2183 +171,2183 @@
                 <el-input ref="remark" v-model="createTemp.remark" :disabled="dialogStatus==='see'" />
               </el-form-item>
             </el-col>
-          </el-row>
-          <el-divider></el-divider>
-
-          <el-table
-             key="tableKey"
-            v-loading="listLoading"
-            element-loading-text="给我一点时间"
-            :data="listAddCont"
-            border
-            fit
-            highlight-current-row
-            style="width: 100%;margin-bottom:30px"
-            :row-style="rowStyle"
-            :cell-style="cellStyle"
-            class="elTable"
-          >
-            <!-- table表格 -->
-            <el-table-column label="序号" align="center" type="index" width="50px" />
-            <el-table-column label="供应商" prop="providerName" align="center" min-width="80px">
-              <template slot-scope="scope">
-                <span>{{ scope.row.providerName }}</span>
-              </template>
-            </el-table-column>
-            <!-- <el-table-column label="金额" prop="amount" align="center" min-width="80px">
-              <template slot-scope="scope">
-                <span>{{ scope.row.amount }}</span>
-              </template>
-            </el-table-column> -->
-            <el-table-column label="金额" v-if="createTemp.iscontract !== 0" prop="amount" align="center" min-width="80px">
-              <template slot-scope="scope">
-                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                  <el-input v-model="scope.row.amount" style="margin-top:10px" />
-                </span>
-                <span v-if="dialogStatus ==='see'">{{ scope.row.amount }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="设备名称" prop="eqName" min-width="80px" align="center">
-              <template slot-scope="scope">
-
-                <span>{{ scope.row.eqName }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="设备内部编号" prop="eqCode" align="center" min-width="80px">
-              <template slot-scope="scope">
-
-                <span>{{ scope.row.eqCode }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="费用类型" prop="typea" align="center" min-width="80px">
-              <template slot-scope="scope">
-                <span>{{ scope.row.typea }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="铅封号" prop="sealNumber" align="center" min-width="80px">
-              <template slot-scope="scope">
-                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                  <el-input v-model="scope.row.sealNumber" style="margin-top:10px" />
-                </span>
-                <span v-if="dialogStatus ==='see'">{{ scope.row.sealNumber }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column label="质保日期" prop="warrantydate" align="center" min-width="80px">
-              <template slot-scope="scope">
-                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                  <!-- <el-date-picker v-model="scope.row.warrantydate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="margin-top:10px" /> -->
-                  <el-date-picker v-model="scope.row.warrantydate"  type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="margin-top:10px" />
-                </span>
-                <span v-if="dialogStatus ==='see'">{{ scope.row.warrantydate }}</span>
-              </template>
-            </el-table-column>
-            <!-- <el-table-column label="交付日期" prop="date" align="center" min-width="80px">
-              <template slot-scope="scope">
-
-                <span>{{ scope.row.date }}</span>
-              </template>
-            </el-table-column> -->
-            <!-- <el-table-column  label="合同编号" prop="contractCode" align="center" min-width="80px">
-              <template slot-scope="scope">
-
-                <span>{{ scope.row.contractCode }}</span>
-              </template>
-            </el-table-column> -->
-            <el-table-column label="备注" prop="remark" align="center" min-width="80px">
-              <template slot-scope="scope">
-
-                <span >{{ scope.row.remark }}</span>
-              </template>
-            </el-table-column>
-
-
-
-          </el-table>
-
-          <el-divider></el-divider>
-
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="备件类型:" prop="applyType">
-                <el-radio-group v-model="createTemp.applyType" :disabled="dialogStatus==='see'"  @change="change_applyType" >
-                  <el-radio   :label="0" :checked="createTemp.applyType == 0">牧场</el-radio>
-                  <el-radio   :label="1" :checked="createTemp.applyType == 1">供应商</el-radio>
-
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-
-          </el-row>
-
-          <el-row :gutter="20" v-if = "createTemp.applyType == 0">
-
-
-            <el-button v-if = "dialogStatus !=='see' " class="filter-item" type="primary" size="mini" style="margin-bottom:10px" @click="handleCollectionSparePartsCreate">添加领用单</el-button>
-
-
-            <!-- <el-col :span="8">
-              <el-form-item label="领用单号:" prop="applyCode">
-                <el-input ref="applyCode" v-model="createTemp.applyCode" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col :span="16">
-              <el-form-item label="备件:" prop="partCode">
-                <el-autocomplete v-model="orderPart.partCode" value-key="name" class="inline-input" :fetch-suggestions="sparePartSearch" placeholder="请输入备件编号或备件名称或备件规格" style="width:100%" @select="handleSelectSparePart" :disabled="dialogStatus==='update' ||  dialogStatus==='see'" >
-                  <template slot-scope="{ item }">
-                    <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
-                    |  &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
-                    |  &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
-                    |  &nbsp;<b>品牌:</b><span class="addr">{{ item.brand }}</span>
-                    |  &nbsp;<b>库存:</b><span class="addr">{{ item.reportery }}</span>
-                  </template>
-                </el-autocomplete>
-              </el-form-item>
-            </el-col> -->
-
-          </el-row>
-
-
-          <el-table v-if = "createTemp.applyType == 0"
-              :key="tableKey"
-              v-loading="listLoading"
-              element-loading-text="给我一点时间"
-              :data="listCollectionSpareParts"
-              border
-              fit
-              highlight-current-row
-              style="width: 100%;"
-              :row-style="rowStyle"
-              :cell-style="cellStyle"
-              class="elTable table-fixed"
-            >
-              <el-table-column label="序号" align="center" type="index" width="50px">
-                <template slot-scope="scope">
-                  <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="领用单号" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.applyCode }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="领用部门" width="140px" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.departmentName }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="领用日期" sortable prop="createDate" min-width="80px" align="center" />
-              <el-table-column label="领用备件" prop="details" align="center">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.details }}</span>
-                </template>
-              </el-table-column>
-
-
-
-
-
-              <el-table-column label="领用状态" min-width="100px" align="center" :formatter="statue" />
-              <el-table-column label="操作" min-width="80px" align="center">
-                <template slot-scope="{row}">
-                  <el-button type="primary" size="mini" @click="handleCollarUseSee(row)">查看</el-button>
-                </template>
-              </el-table-column>
-          </el-table>
-
-
-          <el-divider></el-divider>
-          <el-button v-if = "createTemp.applyType == 1 && dialogStatus !=='see'  " class="filter-item" type="primary" icon="el-icon-edit" @click="form_add_list2">新增</el-button>
-
-
-          <el-table v-if = "createTemp.applyType == 1"
-             key="2"  v-loading="listLoading"  element-loading-text="给我一点时间"
-            :data="listAdd2" border fit  highlight-current-row  style="width: 100%;margin-bottom:30px"
-            :row-style="rowStyle"  :cell-style="cellStyle"  class="elTable" >
-              <!-- table表格 -->
-
-
-
-              <el-table-column type="index" label="序号" align="center" width="50px" />
-              <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
-                <template slot-scope="scope">
-                   <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                      <el-input v-model="scope.row.partCode" style="margin-top:10px" />
-                    </span>
-                    <span v-if="dialogStatus ==='see'">{{ scope.row.partCode }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备件名称" min-width="60px" align="center">
-                <template slot-scope="scope">
-
-                   <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                      <el-input v-model="scope.row.partName" style="margin-top:10px" />
-                    </span>
-                    <span v-if="dialogStatus ==='see'">{{ scope.row.partName }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="备件规格" prop="specification" align="center" min-width="90">
-                <template slot-scope="scope">
-                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                      <el-input v-model="scope.row.specification" style="margin-top:10px" />
-                    </span>
-                    <span v-if="dialogStatus ==='see'">{{ scope.row.specification }}</span>
-                </template>
-              </el-table-column>
-
-              <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
-                <template slot-scope="scope">
-                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                      <el-input v-model="scope.row.brand" style="margin-top:10px" />
-                    </span>
-                    <span v-if="dialogStatus ==='see'">{{ scope.row.brand }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="供应商" prop="providerName" align="center" min-width="60">
-                <template slot-scope="scope">
-                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                      <el-input v-model="scope.row.providerName" style="margin-top:10px" />
-                    </span>
-                    <span v-if="dialogStatus ==='see'">{{ scope.row.providerName }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
-                <template slot-scope="scope">
-                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                      <el-input v-model="scope.row.unit" style="margin-top:10px" />
-                    </span>
-                    <span v-if="dialogStatus ==='see'">{{ scope.row.unit }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column label="数量" prop="amount" align="center" min-width="60">
-                <template slot-scope="scope">
-                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                      <el-input v-model="scope.row.amount" style="margin-top:10px" />
-                    </span>
-                    <span v-if="dialogStatus ==='see'">{{ scope.row.amount }}</span>
-                </template>
-              </el-table-column>
-
-              <el-table-column label="单价" prop="price" align="center" min-width="70">
-                <template slot-scope="scope">
-                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                      <el-input v-model="scope.row.price" style="margin-top:10px" />
-                    </span>
-                    <span v-if="dialogStatus ==='see'">{{ scope.row.price }}</span>
-                </template>
-
-              </el-table-column>
-              <el-table-column label="总价" prop="totalPrice" align="center" min-width="70">
-                <template slot-scope="scope">
-                  <span>{{ scope.row.price * parseFloat(scope.row.amount) }}</span>
-                </template>
-
-              </el-table-column>
-              <el-table-column label="备注" prop="remark" align="center" min-width="60">
-                <template slot-scope="scope">
-                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                      <el-input v-model="scope.row.remark" style="margin-top:10px" />
-                    </span>
-                    <span v-if="dialogStatus ==='see'">{{ scope.row.remark }}</span>
-
-                </template>
-              </el-table-column>
-              <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right" v-if="dialogStatus ==='create'||dialogStatus ==='update'">
-                <template slot-scope="{row}">
-                  <a class="del" @click="partDelete2(row)">删除</a>
-                </template>
-              </el-table-column>
-          </el-table>
-        </el-form>
-
-
-
-
-
-          <el-row v-if="dialogStatus ==='see'  ">
-            <el-col>
-              <h3 >流程进度</h3>
-              <el-steps :active="active" align-center finish-status="success">
-                <el-step
-                  v-for="(item,index) in activeList"
-                  :key="index"
-                  :title="item.title"
-                  :status="item.status"
-                >
-                  <template slot="description">
-                    <div class="step-row">
-                      <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
-                      <div>{{ item.reason }}</div>
-                    </div>
-                  </template>
-                </el-step>
-              </el-steps>
-            </el-col>
-          </el-row>
-
-
-
-
-        <div slot="footer" class="dialog-footer" style="bottom:10px">
-       <el-button type="primary" v-if="dialogStatus !=='see'"  @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
-          <!-- <el-button type="primary"  v-show ="dialogStatus==='create'" :disabled="isokDisable" @click="add_dialog_save()">保存并关闭1</el-button>
-          <el-button type="primary"  v-show ="dialogStatus==='update'" :disabled="isokDisable" @click="edit_dialog_save()">保存并关闭2</el-button> -->
-
-          <el-button @click="dialogFormVisible = false;get_table_data1()">取消并关闭</el-button>
-        </div>
-      </div>
-    </el-dialog>
-
-    <!-- 审核 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
-      <div class="app-examine">
-        <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
-        <el-form ref="examineTemp" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
-          <el-row style="width:88%;height:150px;margin:0 auto;">
-            <el-col :span="20">
-              <el-form-item>
-                <el-radio-group v-model="examineTemp.status" @change="change_statue">
-                  <el-radio :label="1" checked>通过</el-radio>
-                  <el-radio :label="2">不通过</el-radio>
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-            <el-col v-if="statueReason" :span="20">
-              <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
-            </el-col>
-          </el-row>
-        </el-form>
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button  v-if="istab2Shenhe1 && (examineTemp.flowCompeleted == 1) "  type="primary" :disabled="isokDisable" @click="form_examine_save()">确认</el-button>
-        <el-button v-if="istab2Shenhe2 && (examineTemp.flowCompeleted == 2) "  type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
-        <el-button v-if="istab2Shenhe3 && (examineTemp.flowCompeleted == 4) " type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</el-button>
-        <!-- <el-button v-if="dialogStatus==='examine22'" type="primary" :disabled="isokDisable" @click="form_examine_save22()">确认</el-button>
-        <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
-        <el-button v-if="dialogStatus==='examine33'" type="primary" :disabled="isokDisable" @click="form_examine_save33()">确认</el-button>
-        <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</el-button> -->
-        <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
-      </div>
-    </el-dialog>
-
-    <el-dialog  title="领用单" :visible.sync="dialogFormVisible_CollectionSparePartsSee" :close-on-click-modal="false" width="90%">
-      <div class="collectionSparePartsSee" style="height: 500px;">
-        <el-form
-          ref="collectionSparePartsSeeTemp"
-          :rules="rules"
-          :model="collectionSparePartsSeeTemp"
-          label-position="right"
-          label-width="120px"
-          style="width: 90%;margin:0 auto;"
-        >
-          <el-row>
-            <el-col  :span="8">
-              <el-form-item label="领用单号:" prop="applyCode">
-                <el-input ref="applyCode" v-model="collectionSparePartsSeeTemp.applyCode" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="领用部门:" prop="departmentName">
-                <el-input ref="departmentName" v-model="collectionSparePartsSeeTemp.departmentName" disabled />
-              </el-form-item>
-            </el-col>
-            <el-col   :span="8">
-              <el-form-item label="领用日期:" prop="applyDate">
-                <el-input ref="applyDate" v-model="collectionSparePartsSeeTemp.applyDate" disabled />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row v-if="isPartCode">
-            <el-col :span="16">
-              <el-form-item label="所需备件:" prop="partCode">
-                <el-autocomplete
-                  v-model="collectionSparePartsSeeTemp.partCode"
-                  value-key="name"
-                  class="inline-input"
-                  :fetch-suggestions="sparePartSearch"
-                  placeholder="请输入备件编号或备件名称或备件规格"
-                  style="width:98%"
-                  @select="handleSelectSparePart"
-                >
-                  <template slot-scope="{ item }">
-                    <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
-                    |  &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
-                    |  &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
-                    |  &nbsp;<b>库存:</b><span class="addr">{{ item.reportery }}</span>
-                    |  &nbsp;<b>是否零库存:</b><span class="addr" v-if="item.isZeroStock==1">是</span>
-                    <span class="addr" v-else>否</span>
-                  </template>
-                </el-autocomplete>
-              </el-form-item>
-            </el-col>
-
-          </el-row>
-        </el-form>
-        <el-table
-          :key="tableKey"
-          v-loading="listLoading"
-          element-loading-text="给我一点时间"
-          :data="listCreateCollectionSpareParts"
-          border
-          fit
-          highlight-current-row
-          style="width: 100%;margin-bottom:30px"
-          :row-style="rowStyle"
-          :cell-style="cellStyle"
-          class="elTable table-fixed"
-        >
-          <!-- table表格 -->
-          <el-table-column type="index" label="序号" align="center" width="50px" />
-          <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.partCode }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="备件名称" min-width="80px" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.partName }}</span><br>
-            </template>
-          </el-table-column>
-          <el-table-column label="备件规格" prop="specification" align="center" min-width="100">
-            <template slot-scope="scope">
-              <span>{{ scope.row.specification }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="库存数" prop="reportery" align="center" min-width="100">
-            <template slot-scope="scope">
-              <span>{{ scope.row.reportery }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="领用数量" prop="amount" align="center" min-width="80">
-            <template slot-scope="scope">
-              <el-form :model="scope.row">
-                <el-form-item prop="amount">
-                  <el-input ref="amount" v-model="scope.row.amount" :disabled="dialogStatus==='collectionSparePartsSee1'" style="margin-top:15px" />
-                </el-form-item>
-              </el-form>
-            </template>
-          </el-table-column>
-          <!-- <el-table-column  label="领用时间" prop="date" align="center" min-width="100">
-            <template slot-scope="scope">
-              <span>{{ scope.row.date }}</span>
-            </template>
-          </el-table-column> -->
-          <el-table-column label="用途" prop="note" align="center" min-width="60">
-            <template slot-scope="scope">
-              <el-form :model="scope.row">
-                <el-form-item prop="note">
-                  <el-input ref="note" v-model="scope.row.note" :disabled="dialogStatus==='collectionSparePartsSee1'" style="margin-top:15px" />
-                </el-form-item>
-              </el-form>
-            </template>
-          </el-table-column>
-
-             <el-table-column   label="设备名称" prop="eqName" align="center" min-width="250">
-                <template slot-scope="scope">
-                  <el-autocomplete  v-if="isCreatePartDelete"
-                    v-model="scope.row.eqName"
-                    class="inline-input"
-                    :fetch-suggestions="querySearchEqName"
-                    value-key="eqName"
-                    placeholder="设备名称"
-                    @select="(value)=>
-                    {handleSelectEqName(value, scope.row)}"
-                    @blur="(value)=>
-                    {blurSelectEqName(value, scope.row)}"
-                  >
-                    <template slot-scope="{ item }">
-                      <span class="addr">{{ item.eqName }}</span>
-                      |<span class="addr">{{ item.eqCode }}</span>
-                    </template>
-                  </el-autocomplete>
-                  <span v-else class="addr">{{ scope.row.eqName }}</span>
-                </template>
-              </el-table-column>
-              <el-table-column   label="设备内部编号" prop="eqCode" align="center" min-width="150">
-                <template slot-scope="scope">
-                  <el-autocomplete v-if="isCreatePartDelete"
-                    v-model="scope.row.eqCode"
-                    class="inline-input"
-                    :fetch-suggestions="querySearchCode"
-                    value-key="eqCode"
-                    placeholder="设备内部编号"
-                    @select="(value)=>
-                    {handleSelectEqCode(value, scope.row)}"
-                    @blur="(value)=>
-                    {blurSelectEqCode(value, scope.row)}"
-                  />
-                  <span v-else class="addr">{{ scope.row.eqCode }}</span>
-                </template>
-              </el-table-column>
-
-          <el-table-column v-if="isCreatePartDelete" label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
-            <template slot-scope="{row}">
-              <a class="del" @click="createPartDelete(row)">删除</a>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <div slot="footer" class="dialog-footer" style="bottom:5px">
-        <el-button v-if="isPartCode" type="primary" :disabled="isokDisable" @click="createCollectionSparePartsData()">确认</el-button>
-        <!-- <el-button @click="dialogFormVisible_CollectionSparePartsSee = false;">关闭</el-button> -->
-        <el-button @click="closeCollectionSparePartsSee">关闭</el-button>
-      </div>
-    </el-dialog>
-
-
-
-  </div>
-</template>
-
-<script>
-import echarts from 'echarts'
-require('echarts/theme/macarons')
-import { GetDataByNames, GetReportform, GetDataByName, PostDataByName, checkButtons, ExecDataByConfig} from '@/api/common'
-import Cookies from 'js-cookie'
-import { parseTime, json2excel } from '@/utils/index.js'
-import { MessageBox } from 'element-ui'
-import Pagination from '@/components/Pagination'
-export default {
-  name: 'Tab2',
-  components: { Pagination },
-  inject: ['reload'],
-  data() {
-    return {
-      myHeight:document.documentElement.clientHeight - 85- 200,
-      //多个下拉框 - 请求内容
-      send_select_list: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-
-      ],
-
-
-      //  下拉框 - 牧场
-      pastureNameList: [
-        // {id: "犊牛1", name: "犊牛1"},
-        // {id: "犊牛2", name: "犊牛2"},
-        // {id: "犊牛3", name: "犊牛3"}
-      ],
-
-      getDepartParam1: {
-        name: 'findAllDepart', offset: 0, pagecount: 0,
-        parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
-      },
-      employeNameList: [],
-      departNameList1: [],
-      getDepartParam2: {
-        name: 'findAllDepart', offset: 0, pagecount: 0,
-        parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
-      },
-      departNameList2: [],
-
-      // statuesNameList: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
-      statuesNameList: [{ id: '0', name: '未离厂' }, { id: '1', name: '未回厂' }, { id: '2', name: '已回厂' }, { id: '3', name: '已验收' }],
-      iscontractList:[{id: '0', name: '有合同'},{id: '1', name: '无合同'}],
-      isokDisable: false,
-
-
-      tableObj1: {
-        getdataListParm: {
-          name: 'getBigacceptanceList',
-          //请求的 page 无用参数  offset 第几页  pagecount 每页多少条
-          page: 1, offset: 1,pagecount: 10,returntype: 'Map',
-          parammaps: { pastureName:Cookies.get('pasturename'), acceptanceCode: '',departmentName: '',status: "",outsourcingCode: "", inputDatetime:"",startdate: "",enddate: "",iscontract:''}
-        },
-        tableKey: 0,listLoading: false,
-        //返回的 pageNum 第几页  pageSize 每页多少条 total 总条数
-        pageNum:'',pageSize:'',total: 0,
-        list: [
-
-        ]
-      },
-      pageNum:'',pageSize:'',total: 0,
-      getAddContListParam:  {
-        name: "getOutsourcingList",
-        page: 1,offset: 1,pagecount: 20,returntype: "Map",
-        parammaps: {"bigId": ""}
-      },
-
-      pickerOptions: {
-        disabledDate(time) {
-          return time.getTime() > Date.now()// 当天之前的时间可选
-        }
-      },
-      dialogFormVisible_CollectionSparePartsSee: false,
-      beforedialog:'',
-      listCreateCollectionSpareParts: [],
-      isCreatePartDelete: false,
-      isPartCode: true,
-      getCollarUseSeeParm: {
-        name: 'getpartapplyListBybig',
-        parammaps: {}
-      },
-      orderPart: {},
-      getOutCodetParm: {
-        name: 'getBigoutsourcingCode',
-        returntype: 'Map',
-        parammaps: {
-          pastureId: Cookies.get('pastureid'),
-          outsourcingCode:"",
-        }
-      },
-      useForms: [],
-      getParmCreateAdd: {
-        name: 'getPartApplyByBig',
-        returntype: 'Map',
-        parammaps: {}
-      },
-
-      rules: {
-        equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
-        // lcdate: [{ required: true, message: '必填', trigger: 'blur' }],
-        // hcdate: [{ required: true, message: '必填', trigger: 'blur' }],
-      },
-      getPramPartApplyListBybig: {
-        name:"getpartapplyListBybig",
-        returntype:"Map",
-        parammaps:{"id":""}
-      },
-
-      getPramAcceptanceList: {
-        name:"getAcceptanceList",
-        returntype:"Map",
-        parammaps:{"bigId	":""}
-      },
-
-
-      getCollarUseListParm: {
-        name: 'getPartsapplybyMt',
-        page: 1,
-        offset: 1,
-        returntype: 'Map',
-        parammaps: {
-          "RUCode":"",
-        }
-      },
-
-      collectionSparePartsSeeTemp: {
-        applyCode:"",departmentName:"",applyDate:"",
-        isStock: 0,
-        applyDate:"",
-      },
-      listCollectionSpareParts: [],
-
-      tableKey: 0,
-      listLoading: true,
-      total: 0,
-      list: [],
-      dialogStatus: '',
-      dialogFormVisible: false,
-      dialogFormVisibleSee: false,
-      listLoadingSee: true,
-      listSee: [],
-      totalSee: 0,
-      seeTemp: {},
-      getdataListSee: {
-        name: 'getpartpurchaseBybig',
-        returntype: 'Map',
-        parammaps: {}
-      },
-      createTemp: {
-        pastureId: this.$store.state.user.pastureid,
-        departmentId: this.$store.state.user.departmentid,
-        employeId: this.$store.state.user.employeid,
-        date: parseTime(new Date(), '{y}-{m}-{d}'),
-        providerId: '',
-        contract:1,
-        acceptanceCode:"",
-        outsourcingCode:"",
-        applyType:0,
-        remark:'',
-
-        applicant: '',
-
-        departmentName: '',
-
-        contract:1,
-      },
-
-      getParmCreateNumber: {
-        name: 'autoCreatCode',
-        page: 0, offset: 0,  pagecount: 0,  returntype: 'Map',
-        parammaps: {
-          pastureId: Cookies.get('pastureid'),
-          codeType: 'WY'
-        }
-      },
-      getParmCreateNumber2: {
-        name: 'autoCreatCode',
-        page: 0, offset: 0,  pagecount: 0,  returntype: 'Map',
-        parammaps: {
-          pastureId: Cookies.get('pastureid'),
-          codeType: 'LY'
-        }
-      },
-
-
-      requestSparePart: {
-        name: 'getPartsListLY', page: 1, offset: 1, pagecount: 20, returntype: 'Map',
-        parammaps: { pastureId: Cookies.get('pastureid') }
-      },
-
-      EqNameList: [],
-      requestEqName: {
-        name: 'geteqbyNameCode', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
-        parammaps: { pastureId: Cookies.get('pastureid') }
-      },
-      EqCodeList: [],
-
-
-
-      listAdd:[],
-      listAdd2:[],
-      isData:false,
-
-      listAddCont:[
-        //  {providerName:"",providerId: "0",eqId: "0",contractId: "0",}
-      ],
-      activeList: [],
-      active: 1,
-
-      dialogFormVisible_Examine: false,
-      examineTemp: {
-            "status": 1,
-            "empid": "",
-            "flowCompeleted":"",
-            "workflowNote": "",
-            "id": ""
-      },
-      statueReason: false,
-      rowStyle: { maxHeight: 50 + 'px', height: 35 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      textMap: {
-        update: '编辑',
-        create: '新增',
-        see: '查看',
-        examine: '审核1',
-        examine22: '审核2',
-        examine2: '审核3',
-        examine33: '审核4',
-        examine3: '审核5',
-        collectionSparePartsSee: '查看领用',
-        collectionSparePartsSee1:'查看领用',
-        collectionSparePartsCreate: '添加领用',
-      },
-
-      istab2Add:[],
-      istab2Edit:[],
-      istab2Del:[],
-      istab2Shenhe1:[],
-      istab2Shenhe2:[],
-      istab2Shenhe3:[],
-    }
-  },
-  created() {
-
-
-    this.get_select_list()
-    this.get_table_data1()
-
-  },
-  methods: {
-    //获取按钮权限
-    get_auto_buttons() {
-      const istab2Add = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:add')
-      this.istab2Add = istab2Add
-
-      const istab2Edit = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:edit')
-      this.istab2Edit = istab2Edit
-
-      const istab2Del = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:del')
-      this.istab2Del = istab2Del
-
-      const istab2Shenhe1 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe1')
-      this.istab2Shenhe1 = istab2Shenhe1
-
-      const istab2Shenhe2 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe2')
-      this.istab2Shenhe2 = istab2Shenhe2
-
-      const istab2Shenhe3 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe3')
-      this.istab2Shenhe3 = istab2Shenhe3
-
-    },
-
-
-    get_select_list() {
-      GetDataByNames(this.send_select_list).then(response => {
-        this.pastureNameList = response.data.findAllPasture.list
-        console.log("牧场下拉框", this.pastureNameList)
-        this.employeNameList = response.data.findAllEmploye.list
-        console.log("申请人下拉框", this.employeNameList)
-
-        this.get_depart_list1()
-      })
-    },
-    change_pasture1(item) {
-      this.getDepartParam1.parammaps.pastureId = this.pastureNameList.find(obj => obj.name == item).id
-      this.tableObj1.getdataListParm.parammaps.departmentId = ''
-      this.get_depart_list1()
-    },
-    //部门List
-    get_depart_list1() {
-      GetDataByName(this.getDepartParam1).then(response => {
-        this.departNameList1 = response.data.list
-      })
-    },
-
-
-    change_pasture2(item) {
-      this.getDepartParam2.parammaps.pastureId = item
-      this.get_depart_list2()
-    },
-
-    get_depart_list2() {
-      GetDataByName(this.getDepartParam2).then(response => {
-        this.departNameList2 = response.data.list
-      })
-    },
-
-    change_depart2(item) {
-      this.createTemp.departmentName = this.departNameList2.find(obj => obj.id == item).name
-    },
-
-
-    get_table_data1() {
-      this.tableObj1.listLoading = false
-
-      if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
-        this.tableObj1.getdataListParm.parammaps.startdate = this.$refs['inputDatetime'].value[0]
-        this.tableObj1.getdataListParm.parammaps.enddate = this.$refs['inputDatetime'].value[1]
-
-
-      } else {
-        this.tableObj1.getdataListParm.parammaps.inputDatetime = ''
-        this.tableObj1.getdataListParm.parammaps.startdate = ''
-        this.tableObj1.getdataListParm.parammaps.enddate = ''
-      }
-
-      GetDataByName(this.tableObj1.getdataListParm).then(response => {
-        if (response.data.list !== null) {
-          this.tableObj1.list = response.data.list
-          this.tableObj1.pageNum = response.data.pageNum
-          this.tableObj1.pageSize = response.data.pageSize
-          this.tableObj1.total = response.data.total
-        } else {
-          this.tableObj1.list = [ ]
-        }
-
-        setTimeout(() => {
-          this.tableObj1.listLoading = false
-        }, 100)
-      })
-    },
-    form_search() {
-      console.log('查询')
-
-
-      this.get_table_data1()
-
-    },
-    change_applyType(val) {
-      console.log(val)
-      if(val ==1){
-        this.createTemp.applyType = 1
-      } else {
-        this.createTemp.applyType = 0
-      }
-
-    },
-    form_add() {
-      this.reset_create()
-
-      this.getDepartParam2.parammaps.pastureId = this.createTemp.pastureId
-      this.get_depart_list2()
-      this.dialogStatus = 'create'
-
-
-      this.dialogFormVisible = true
-      this.listLoading = false
-      this.$nextTick(() => {
-        this.$refs['createTemp'].clearValidate()
-      })
-       //新增生成单号
-      this.getCreateNumber()
-
-    },
-    statue: function(cellValue) {
-      // console.log(cellValue.isZeroStock)
-      if (cellValue.statue == 0) {
-        return '未领用'
-      } else if (cellValue.statue == 1) {
-        return '已领用'
-      }
-    },
-    reset_create() {
-      this.createTemp.pastureId =  parseInt(Cookies.get('pastureid'))
-      this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
-      this.createTemp.departmentName = Cookies.get('departmentname')
-      this.createTemp.employeId = parseInt(Cookies.get('employeid'))
-      this.createTemp.date = parseTime(new Date(), '{y}-{m}-{d}')
-      this.createTemp.outsourcingCode = ''
-      this.createTemp.applicant = parseInt(Cookies.get('employeid'))
-      this.createTemp.providerId = ''
-      this.createTemp.contract = 1
-
-      this.createTemp.description = ''
-
-      if(parseInt(Cookies.get('pastureid')) == 18){
-      this.createTemp.departmentId = ""
-     }
-
-      this.createTemp.outsourcingCode = ''
-      console.log(  this.createTemp.departmentName )
-
-
-
-
-      this.listAddCont = [
-      //   {providerName:"",providerId: "0",eqId: "0",contractId: "0",amount:"",contractCode:"",date:"",eqCode:"",eqName:"",remark:"",typea:"",}
-      ]
-      this.listAdd = []
-      this.listAdd2 = []
-      this.listCreateCollectionSpareParts = []
-      this.listCollectionSpareParts = []
-
-
-
-
-    },
-
-
-
-    handleCollarUseSee(row, isStock) {
-      console.log(row)
-      let beforedialog = ''
-      this.beforedialog = this.dialogStatus
-      this.collectionSparePartsSeeTemp = Object.assign({}, row)
-      this.dialogStatus = 'collectionSparePartsSee1'
-
-      this.collectionSparePartsSeeTemp.applyDate = row.createDate
-      this.dialogFormVisible_CollectionSparePartsSee = true
-      this.isCreatePartDelete = false
-      this.isPartCode = false
-      this.getCollarUseSeeList()
-    },
-    getCollarUseSeeList() {
-      this.getCollarUseSeeParm.parammaps.id = this.collectionSparePartsSeeTemp.id
-      GetDataByName(this.getCollarUseSeeParm).then(response => {
-        this.listCreateCollectionSpareParts = response.data.list
-
-      })
-    },
-
-    form_add_list2() {
-      var idDel = "id" + Math.round(Math.random()*100) + Math.round(Math.random()*100)
-
-      this.listAdd2.unshift({partCode:"",providerId: "0",eqId: "0",contractId: "0",idDel:idDel,partId: "",partCode: "",partName: "",brandId: "",brand: "",providerId: "",providerName: "",price: "",sumPrice: "",remark: "",amount: ""})
-
-
-    },
-
-    getCreateNumber() {
-      GetDataByName(this.getParmCreateNumber).then(response => {
-        this.$nextTick(() => {
-          console.log('新增委外维修单单号', response.data.list[0].orderCode)
-          this.createTemp.acceptanceCode = response.data.list[0].orderCode
-          this.$forceUpdate()
-        })
-      })
-
-    },
-
-
-    getCreateLYNumber() {
-
-      GetDataByName(this.getParmCreateNumber2).then(response => {
-        this.$nextTick(() => {
-          console.log('新增领用单号', response.data.list[0].orderCode)
-          this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
-          this.$forceUpdate()
-        })
-      })
-    },
-
-    add_dialog_save() {
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          console.log(this.listAddCont)
-          if (this.createTemp.acceptanceCode == '' || this.createTemp.acceptanceCode == null || this.createTemp.acceptanceCode == undefined) {
-            GetDataByName(this.getParmCreateNumber).then(response => {
-              this.$nextTick(() => {
-                console.log('新增单号', response.data.list[0].orderCode)
-                this.createTemp.acceptanceCode = response.data.list[0].orderCode
-                this.$forceUpdate()
-                this.add_dialog_saveSave()
-              })
-            })
-          } else {
-            this.add_dialog_saveSave()
-          }
-        }
-      })
-    },
-
-
-    add_dialog_saveSave() {
-
-        for (var j = 0; j < this.listAddCont.length; j++) {
-          console.log(this.listAddCont[j].amount)
-          if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
-            this.$message({ type: 'warning', message: '请检查金额是否未填写', duration: 2000 })
-            return false
-          } else {
-            // var rulesAmount = /^[1-9]\d*$/
-            // if (!rulesAmount.test(this.listAddCont[j].amount)) {
-            //   this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
-            //   return false
-            // }
-          }
-
-
-        }
-        //牧场
-        if(this.createTemp.applyType == 0){
-
-
-          let mySumPrice = 0
-          for (let i = 0; i < this.listAdd.length; i++) {
-            mySumPrice += parseFloat(this.listAdd[i].price) * parseFloat(this.listAdd[i].amount)
-          }
-          if (mySumPrice > 500) {
-            this.createTemp.SHStatus = 2
-          } else {
-            this.createTemp.SHStatus = 9
-          }
-
-
-          var send_data = {
-            "common": {  "returnmap": "0" },
-            "data": [
-              {
-                "name": "insertBigacceptance",
-                "type": "e",
-                "parammaps": this.createTemp
-              }
-            ]
-          }
-
-        }
-        //供应商
-        if(this.createTemp.applyType == 1){
-
-
-
-          if(this.listAdd2.length == 0){
-            this.$notify({
-              title: '失败',   message: "备件必选!",
-              type: 'warning',
-              duration: 2000
-            })
-            return false
-          }
-          this.listAdd2.map((item, index) => {
-             return item.partId = "0"
-          })
-          this.listAdd2.map((item, index) => {
-             return item.brandId = "0"
-          })
-
-          this.listAdd2.map((item, index) => {
-             return item.providerId = "0"
-          })
-
-
-          var send_data = {
-              "common": {
-                  "returnmap": "0"
-              },
-              "data": [
-                  {
-                      "name": "insertBigacceptance",
-                      "type": "e",
-                      "parammaps": this.createTemp
-                  },
-                  {
-                      "name": "insertSpotList",
-                      "resultmaps": {
-                          "list": this.listAdd2
-                      },
-                      "children": [
-                          {
-                              "name": "insertAcceptance",
-                              "type": "e",
-                              "parammaps": {
-                                "bigId":"@insertBigacceptance.LastInsertId",
-                                "partId":"@insertSpotList.partId",
-                                "partCode":"@insertSpotList.partCode",
-                                "partName":"@insertSpotList.partName",
-                                "brandId":"@insertSpotList.brandId",
-                                "brand":"@insertSpotList.brand",
-                                "providerId":"@insertSpotList.providerId",
-                                "providerName":"@insertSpotList.providerName",
-                                "unit":"@insertSpotList.unit",
-                                "price":"@insertSpotList.price",
-
-                                "remark":"@insertSpotList.remark",
-                                   "specification": "@insertSpotList.specification",
-                                "amount":"@insertSpotList.amount"
-                              }
-                          }
-                      ]
-                  }
-              ]
-          }
-
-
-        }
-
-        ExecDataByConfig(send_data).then(response => {
-          console.log('新增保存发送参数', send_data)
-          if (response.msg === 'fail') {
-            this.$notify({
-              title: '保存失败',
-              message: response.data,
-              type: 'warning',
-              duration: 2000
-            })
-          } else {
-            this.dialogFormVisible = false
-
-            this.get_table_data1()
-
-            this.$notify({
-              title: '',
-              message: '保存成功',
-              type: 'success',
-              duration: 2000
-            })
-          }
-        })
-
-
-    },
-
-
-    getOutNumber(queryString, cb) {
-      console.log('委外申请单号模糊查询输入值', queryString)
-      this.getOutCodetParm.parammaps['outsourcingCode'] = queryString
-      GetDataByName(this.getOutCodetParm).then(response => {
-        console.log('委外申请单号模糊查询搜索data', response.data.list)
-        // this.useForms = response.data.list
-        cb(response.data.list)
-      })
-    },
-
-
-    changeOutNumber(item) {
-      console.log('委外申请单号模糊查询选中值', item)
-      this.createTemp.outsourcingCode = item.outsourcingCode
-      this.$set(this.createTemp, "outsourcingCode", item.outsourcingCode)
-      this.getAddContListParam.parammaps.bigId = item.id
-      this.getAddContList()
-
-
-      // this.createTemp.bid = item.id
-      // this.createTemp.applicatId = item.empId
-      // this.orderPart.applyCode = item.applyCode
-      // this.TotalAmount = 0
-      // this.get_table_dataAdd()
-    },
-
-
-    querySearchEqName(queryString, cb) {
-      console.log('备件名称/设备内部编号模糊查询输入值', queryString)
-      this.requestEqName.parammaps['eqName'] = queryString
-      GetDataByName(this.requestEqName).then(response => {
-        console.log('备件名称模糊查询搜索data', response.data.list)
-        this.EqNameList = response.data.list
-        cb(this.EqNameList)
-      })
-    },
-    handleSelectEqName(item, row) {
-      console.log('备件名称/设备内部编号模糊查询选中值', item.eqName)
-      console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
-      this.$set(row, 'eqCode', item.eqCode)
-      this.$forceUpdate()
-    },
-    querySearchCode(queryString, cb) {
-      console.log('备件名称/设备内部编号模糊查询输入值', queryString)
-      this.requestEqName.parammaps['eqCode'] = queryString
-      GetDataByName(this.requestEqName).then(response => {
-        console.log('备件名称模糊查询搜索data', response.data.list)
-        this.EqNameList = response.data.list
-        cb(this.EqNameList)
-      })
-    },
-    handleSelectEqCode(item, row) {
-      console.log('备件名称/设备内部编号模糊查询选中值', item)
-      console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
-      this.$set(row, 'eqName', item.eqName)
-      this.$forceUpdate()
-    },
-    blurSelectEqName(item, row) {
-      this.$set(row, 'eqName', '')
-      this.$set(row, 'eqCode', '')
-    },
-    blurSelectEqCode(item, row) {
-      this.$set(row, 'eqName', '')
-      this.$set(row, 'eqCode', '')
-    },
-
-
-
-    sparePartSearch(queryString, cb) {
-      console.log('备件模糊查询输入值', queryString)
-      this.requestSparePart.parammaps.pastureId = this.createTemp.pastureId
-      this.requestSparePart.parammaps['partCode'] = queryString
-      GetDataByName(this.requestSparePart).then(response => {
-        console.log('备件模糊查询搜索data', response.data.list)
-        if (response.data.list == null) {
-          cb([])
-        } else {
-          cb(response.data.list)
-        }
-      })
-    },
-    // handleSelectSparePart(item) {
-    //   console.log('备件模糊查询选中值', item)
-    //   if (this.listAdd.length > 0) {
-    //     // eslint-disable-next-line no-redeclare
-    //     if (this.listAdd.find(obj => obj.id === item.id)) {
-    //       this.$message({
-    //         type: 'warning',
-    //         message: '此备件已存在,请重新选择备件'
-    //       })
-    //     } else {
-    //       if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
-    //         this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
-    //         this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
-    //       } else {
-    //         item.srcpath = ''
-    //         item.picpath = ''
-    //       }
-    //       this.listAdd.push(item)
-    //     }
-    //   } else {
-    //     if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
-    //       this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
-    //       this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
-    //     } else {
-    //       item.srcpath = ''
-    //       item.picpath = ''
-    //     }
-    //     this.listAdd.push(item)
-    //   }
-    //   // this.getEqNameList()
-    // },
-
-
-    handleSelectSparePart(item) {
-      console.log('备件模糊查询选中值', item)
-      if (this.listCreateCollectionSpareParts.length > 0) {
-        // eslint-disable-next-line no-redeclare
-        if (this.listCreateCollectionSpareParts.find(obj => obj.partId === item.partId)) {
-          this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
-        } else {
-
-          item.date = this.collectionSparePartsSeeTemp.applyDate
-          this.listCreateCollectionSpareParts.unshift(item)
-        }
-      } else {
-        item.date = this.collectionSparePartsSeeTemp.applyDate
-        this.listCreateCollectionSpareParts.unshift(item)
-      }
-    },
-
-
-    createPartDelete(row) {
-      console.log(this.listAdd)
-      MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        // console.log(this.list2)
-        for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
-          console.log(this.listCreateCollectionSpareParts[i])
-          if (this.listCreateCollectionSpareParts[i].id === row.id) {
-            var listCreateCollectionSparePartsIndex = this.listCreateCollectionSpareParts.indexOf(this.listCreateCollectionSpareParts[i])
-          }
-          if (listCreateCollectionSparePartsIndex > -1) {
-            this.listCreateCollectionSpareParts.splice(listCreateCollectionSparePartsIndex, 1)
-            return
-          }
-        }
-      })
-    },
-
-    closeCollectionSparePartsSee(){
-      this.dialogFormVisible_CollectionSparePartsSee = false
-      this.dialogStatus = this.beforedialog
-    },
-    // 添加领用保存
-    createCollectionSparePartsData() {
-      this.isokDisable = true
-
-          if (this.listCreateCollectionSpareParts.length !== 0) {
-            for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
-              console.log(this.listCreateCollectionSpareParts[i].amount)
-              if (this.listCreateCollectionSpareParts[i].amount !== undefined && this.listCreateCollectionSpareParts[i].amount !== '') {
-                var rulesAmount = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
-                if (!rulesAmount.test(this.listCreateCollectionSpareParts[i].amount)) {
-                  this.$message({
-                    type: 'error',
-                    message: '领用数量请输入正数,最多保留两位小数',
-                    duration: 2000
-                  })
-                  return false
-                } else {
-                  var listCreateCollectionSpareParts1 = [] // >库存
-                  var listCreateCollectionSpareParts2 = [] // <=库存
-                  var amountList = []
-                  var amount2List = []
-
-
-                  let mySumPrice = 0
-                  for (let i = 0; i < listCreateCollectionSpareParts2.length; i++) {
-                    mySumPrice += parseFloat(listCreateCollectionSpareParts2[i].price) * parseFloat(listCreateCollectionSpareParts2[i].amount)
-                  }
-                  if (mySumPrice > 500) {
-                    this.collectionSparePartsSeeTemp.SHStatus = 2
-                  } else {
-                    this.collectionSparePartsSeeTemp.SHStatus = 9
-                  }
-
-
-
-                  var send_data ={
-                      "common": { "returnmap": "0"  },
-                      "data": [
-                          {
-                              "name": "insertBigpartapply",
-                              "type": "e",
-                              "parammaps": {
-                                  "pastureId": this.collectionSparePartsSeeTemp.pastureId,
-                                  "applyCode": this.collectionSparePartsSeeTemp.applyCode,
-                                  "applyType": 1,
-                                  "departmentId": this.collectionSparePartsSeeTemp.departmentId,
-                                  "empId": this.collectionSparePartsSeeTemp.empId,
-                                  "applyDate": this.collectionSparePartsSeeTemp.applyDate,
-                                  "RUCode": this.createTemp.acceptanceCode,
-                                  "SHStatus": 9
-                              }
-                          },
-                          {
-                              "name": "insertSpotList",
-                              "resultmaps": {
-                                  "list":this.listCreateCollectionSpareParts
-                              },
-                              "children": [
-                                  {
-                                      "name": "insertpartapply",
-                                      "type": "e",
-                                      "parammaps": {
-                                          "bigId": "@insertBigpartapply.LastInsertId",
-                                          "pastureId": "@insertSpotList.pastureId",
-                                          "partId": "@insertSpotList.partId",
-                                          "partCode": "@insertSpotList.partCode",
-                                          "partName": "@insertSpotList.partName",
-                                          "specification": "@insertSpotList.specification",
-                                          "brandId": "@insertSpotList.brandId",
-                                          "price": "@insertSpotList.price",
-                                          "amount": "@insertSpotList.amount",
-                                          "eqName": "@insertSpotList.eqName",
-                                          "eqCode": "@insertSpotList.eqCode",
-                                          "providerId": "@insertSpotList.providerId",
-                                          "note": "@insertSpotList.note",
-                                          "reportery": "@insertSpotList.reportery",
-                                          "contractId": "@insertSpotList.contractId",
-                                          "locationId": "@insertSpotList.locationId"
-                                      }
-                                  }
-                              ]
-                          }
-                      ]
-                  }
-
-                  ExecDataByConfig(send_data).then(response => {
-                    console.log('添加领用保存发送参数',send_data)
-                    if (response.msg === 'fail') {
-                      this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-                    } else {
-                      this.dialogFormVisible_CollectionSparePartsSee = false
-                      this.getCollectionSpareParts()
-                      this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-                    }
-                  })
-                  setTimeout(() => {
-                    this.isokDisable = false
-                  }, 2000)
-                  return true
-                }
-              } else {
-                this.$message({ type: 'error', message: '请检查领用数量是否未填写', duration: 2000 })
-                return false
-              }
-            }
-
-
-          } else {
-            this.$notify({ title: '', type: 'warning', message: '请选择备件', duration: 2000 })
-
-
-            return false
-          }
-
-           setTimeout(() => {
-              this.isokDisable = false
-            }, 2000)
-
-    },
-    //看领用单
-    getCollectionSpareParts() {
-      this.getCollarUseListParm.parammaps.RUCode = this.createTemp.acceptanceCode
-      GetDataByName(this.getCollarUseListParm).then(response => {
-        console.log('领用table数据', response.data.list)
-        this.listCollectionSpareParts = response.data.list
-      })
-    },
-
-    // 新增删除
-    partDelete(row) {
-      console.log(this.listAdd)
-      MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        for (var i = 0; i < this.listAdd.length; i++) {
-          console.log(this.listAdd[i])
-          if (this.listAdd[i].id === row.id) {
-            var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
-          }
-          if (listAddIndex > -1) {
-            this.listAdd.splice(listAddIndex, 1)
-            return
-          }
-        }
-      })
-    },
-
-    partDelete2(row) {
-      console.log(this.listAdd2)
-      MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        for (var i = 0; i < this.listAdd2.length; i++) {
-          console.log(this.listAdd2[i])
-          if (this.listAdd2[i].idDel === row.idDel) {
-            var listAddIndex = this.listAdd2.indexOf(this.listAdd2[i])
-          }
-          if (listAddIndex > -1) {
-            this.listAdd2.splice(listAddIndex, 1)
-            return
-          }
-        }
-      })
-    },
-    handleCollectionSparePartsCreate() {
-
-
-
-      if(this.createTemp.departmentId == "" || this.createTemp.departmentId == undefined){
-        this.$message({ type: 'warning', message: '请选择责任部门', duration: 2000 })
-        return false
-      }
-
-      if(this.createTemp.applicant == "" || this.createTemp.applicant == undefined){
-        this.$message({ type: 'warning', message: '请选择录入人', duration: 2000 })
-        return false
-      }
-      console.log( "createTemp)============",this.createTemp)
-
-
-      this.collectionSparePartsSeeTemp = Object.assign({}, this.createTemp)
-
-        this.collectionSparePartsSeeTemp.empId =  this.collectionSparePartsSeeTemp.applicant
-        this.collectionSparePartsSeeTemp.applyDate = parseTime(new Date(), '{y}-{m}-{d}')
+          </el-row>
+          <el-divider></el-divider>
+
+          <el-table
+             key="tableKey"
+            v-loading="listLoading"
+            element-loading-text="给我一点时间"
+            :data="listAddCont"
+            border
+            fit
+            highlight-current-row
+            style="width: 100%;margin-bottom:30px"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable"
+          >
+            <!-- table表格 -->
+            <el-table-column label="序号" align="center" type="index" width="50px" />
+            <el-table-column label="供应商" prop="providerName" align="center" min-width="80px">
+              <template slot-scope="scope">
+                <span>{{ scope.row.providerName }}</span>
+              </template>
+            </el-table-column>
+            <!-- <el-table-column label="金额" prop="amount" align="center" min-width="80px">
+              <template slot-scope="scope">
+                <span>{{ scope.row.amount }}</span>
+              </template>
+            </el-table-column> -->
+            <el-table-column label="金额" v-if="createTemp.iscontract !== 0" prop="amount" align="center" min-width="80px">
+              <template slot-scope="scope">
+                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                  <el-input v-model="scope.row.amount" style="margin-top:10px" />
+                </span>
+                <span v-if="dialogStatus ==='see'">{{ scope.row.amount }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="设备名称" prop="eqName" min-width="80px" align="center">
+              <template slot-scope="scope">
+
+                <span>{{ scope.row.eqName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="设备内部编号" prop="eqCode" align="center" min-width="80px">
+              <template slot-scope="scope">
+
+                <span>{{ scope.row.eqCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="费用类型" prop="typea" align="center" min-width="80px">
+              <template slot-scope="scope">
+                <span>{{ scope.row.typea }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="铅封号" prop="sealNumber" align="center" min-width="80px">
+              <template slot-scope="scope">
+                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                  <el-input v-model="scope.row.sealNumber" style="margin-top:10px" />
+                </span>
+                <span v-if="dialogStatus ==='see'">{{ scope.row.sealNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="质保日期" prop="warrantydate" align="center" min-width="80px">
+              <template slot-scope="scope">
+                <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                  <!-- <el-date-picker v-model="scope.row.warrantydate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="margin-top:10px" /> -->
+                  <el-date-picker v-model="scope.row.warrantydate"  type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="margin-top:10px" />
+                </span>
+                <span v-if="dialogStatus ==='see'">{{ scope.row.warrantydate }}</span>
+              </template>
+            </el-table-column>
+            <!-- <el-table-column label="交付日期" prop="date" align="center" min-width="80px">
+              <template slot-scope="scope">
+
+                <span>{{ scope.row.date }}</span>
+              </template>
+            </el-table-column> -->
+            <!-- <el-table-column  label="合同编号" prop="contractCode" align="center" min-width="80px">
+              <template slot-scope="scope">
+
+                <span>{{ scope.row.contractCode }}</span>
+              </template>
+            </el-table-column> -->
+            <el-table-column label="备注" prop="remark" align="center" min-width="80px">
+              <template slot-scope="scope">
+
+                <span >{{ scope.row.remark }}</span>
+              </template>
+            </el-table-column>
+
+
+
+          </el-table>
+
+          <el-divider></el-divider>
+
+          <el-row :gutter="20">
+            <el-col :span="8">
+              <el-form-item label="备件类型:" prop="applyType">
+                <el-radio-group v-model="createTemp.applyType" :disabled="dialogStatus==='see'"  @change="change_applyType" >
+                  <el-radio   :label="0" :checked="createTemp.applyType == 0">牧场</el-radio>
+                  <el-radio   :label="1" :checked="createTemp.applyType == 1">供应商</el-radio>
+
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+
+          </el-row>
+
+          <el-row :gutter="20" v-if = "createTemp.applyType == 0">
+
+
+            <el-button v-if = "dialogStatus !=='see' " class="filter-item" type="primary" size="mini" style="margin-bottom:10px" @click="handleCollectionSparePartsCreate">添加领用单</el-button>
+
+
+            <!-- <el-col :span="8">
+              <el-form-item label="领用单号:" prop="applyCode">
+                <el-input ref="applyCode" v-model="createTemp.applyCode" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="16">
+              <el-form-item label="备件:" prop="partCode">
+                <el-autocomplete v-model="orderPart.partCode" value-key="name" class="inline-input" :fetch-suggestions="sparePartSearch" placeholder="请输入备件编号或备件名称或备件规格" style="width:100%" @select="handleSelectSparePart" :disabled="dialogStatus==='update' ||  dialogStatus==='see'" >
+                  <template slot-scope="{ item }">
+                    <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
+                    |  &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
+                    |  &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
+                    |  &nbsp;<b>品牌:</b><span class="addr">{{ item.brand }}</span>
+                    |  &nbsp;<b>库存:</b><span class="addr">{{ item.reportery }}</span>
+                  </template>
+                </el-autocomplete>
+              </el-form-item>
+            </el-col> -->
+
+          </el-row>
+
+
+          <el-table v-if = "createTemp.applyType == 0"
+              :key="tableKey"
+              v-loading="listLoading"
+              element-loading-text="给我一点时间"
+              :data="listCollectionSpareParts"
+              border
+              fit
+              highlight-current-row
+              style="width: 100%;"
+              :row-style="rowStyle"
+              :cell-style="cellStyle"
+              class="elTable table-fixed"
+            >
+              <el-table-column label="序号" align="center" type="index" width="50px">
+                <template slot-scope="scope">
+                  <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="领用单号" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.applyCode }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="领用部门" width="140px" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.departmentName }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="领用日期" sortable prop="createDate" min-width="80px" align="center" />
+              <el-table-column label="领用备件" prop="details" align="center">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.details }}</span>
+                </template>
+              </el-table-column>
+
+
+
+
+
+              <el-table-column label="领用状态" min-width="100px" align="center" :formatter="statue" />
+              <el-table-column label="操作" min-width="80px" align="center">
+                <template slot-scope="{row}">
+                  <el-button type="primary" size="mini" @click="handleCollarUseSee(row)">查看</el-button>
+                </template>
+              </el-table-column>
+          </el-table>
+
+
+          <el-divider></el-divider>
+          <el-button v-if = "createTemp.applyType == 1 && dialogStatus !=='see'  " class="filter-item" type="primary" icon="el-icon-edit" @click="form_add_list2">新增</el-button>
+
+
+          <el-table v-if = "createTemp.applyType == 1"
+             key="2"  v-loading="listLoading"  element-loading-text="给我一点时间"
+            :data="listAdd2" border fit  highlight-current-row  style="width: 100%;margin-bottom:30px"
+            :row-style="rowStyle"  :cell-style="cellStyle"  class="elTable" >
+              <!-- table表格 -->
+
+
+
+              <el-table-column type="index" label="序号" align="center" width="50px" />
+              <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
+                <template slot-scope="scope">
+                   <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                      <el-input v-model="scope.row.partCode" style="margin-top:10px" />
+                    </span>
+                    <span v-if="dialogStatus ==='see'">{{ scope.row.partCode }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="备件名称" min-width="60px" align="center">
+                <template slot-scope="scope">
+
+                   <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                      <el-input v-model="scope.row.partName" style="margin-top:10px" />
+                    </span>
+                    <span v-if="dialogStatus ==='see'">{{ scope.row.partName }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="备件规格" prop="specification" align="center" min-width="90">
+                <template slot-scope="scope">
+                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                      <el-input v-model="scope.row.specification" style="margin-top:10px" />
+                    </span>
+                    <span v-if="dialogStatus ==='see'">{{ scope.row.specification }}</span>
+                </template>
+              </el-table-column>
+
+              <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
+                <template slot-scope="scope">
+                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                      <el-input v-model="scope.row.brand" style="margin-top:10px" />
+                    </span>
+                    <span v-if="dialogStatus ==='see'">{{ scope.row.brand }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="供应商" prop="providerName" align="center" min-width="60">
+                <template slot-scope="scope">
+                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                      <el-input v-model="scope.row.providerName" style="margin-top:10px" />
+                    </span>
+                    <span v-if="dialogStatus ==='see'">{{ scope.row.providerName }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
+                <template slot-scope="scope">
+                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                      <el-input v-model="scope.row.unit" style="margin-top:10px" />
+                    </span>
+                    <span v-if="dialogStatus ==='see'">{{ scope.row.unit }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="数量" prop="amount" align="center" min-width="60">
+                <template slot-scope="scope">
+                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                      <el-input v-model="scope.row.amount" style="margin-top:10px" />
+                    </span>
+                    <span v-if="dialogStatus ==='see'">{{ scope.row.amount }}</span>
+                </template>
+              </el-table-column>
+
+              <el-table-column label="单价" prop="price" align="center" min-width="70">
+                <template slot-scope="scope">
+                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                      <el-input v-model="scope.row.price" style="margin-top:10px" />
+                    </span>
+                    <span v-if="dialogStatus ==='see'">{{ scope.row.price }}</span>
+                </template>
+
+              </el-table-column>
+              <el-table-column label="总价" prop="totalPrice" align="center" min-width="70">
+                <template slot-scope="scope">
+                  <span>{{ scope.row.price * parseFloat(scope.row.amount) }}</span>
+                </template>
+
+              </el-table-column>
+              <el-table-column label="备注" prop="remark" align="center" min-width="60">
+                <template slot-scope="scope">
+                  <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                      <el-input v-model="scope.row.remark" style="margin-top:10px" />
+                    </span>
+                    <span v-if="dialogStatus ==='see'">{{ scope.row.remark }}</span>
+
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right" v-if="dialogStatus ==='create'||dialogStatus ==='update'">
+                <template slot-scope="{row}">
+                  <a class="del" @click="partDelete2(row)">删除</a>
+                </template>
+              </el-table-column>
+          </el-table>
+        </el-form>
+
+
+
+
+
+          <el-row v-if="dialogStatus ==='see'  ">
+            <el-col>
+              <h3 >流程进度</h3>
+              <el-steps :active="active" align-center finish-status="success">
+                <el-step
+                  v-for="(item,index) in activeList"
+                  :key="index"
+                  :title="item.title"
+                  :status="item.status"
+                >
+                  <template slot="description">
+                    <div class="step-row">
+                      <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
+                      <div>{{ item.reason }}</div>
+                    </div>
+                  </template>
+                </el-step>
+              </el-steps>
+            </el-col>
+          </el-row>
+
+
+
+
+        <div slot="footer" class="dialog-footer" style="bottom:10px">
+       <el-button type="primary" v-if="dialogStatus !=='see'"  @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
+          <!-- <el-button type="primary"  v-show ="dialogStatus==='create'" :disabled="isokDisable" @click="add_dialog_save()">保存并关闭1</el-button>
+          <el-button type="primary"  v-show ="dialogStatus==='update'" :disabled="isokDisable" @click="edit_dialog_save()">保存并关闭2</el-button> -->
+
+          <el-button @click="dialogFormVisible = false;get_table_data1()">取消并关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+
+    <!-- 审核 -->
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
+      <div class="app-examine">
+        <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
+        <el-form ref="examineTemp" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
+          <el-row style="width:88%;height:150px;margin:0 auto;">
+            <el-col :span="20">
+              <el-form-item>
+                <el-radio-group v-model="examineTemp.status" @change="change_statue">
+                  <el-radio :label="1" checked>通过</el-radio>
+                  <el-radio :label="2">不通过</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col v-if="statueReason" :span="20">
+              <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button  v-if="istab2Shenhe1 && (examineTemp.flowCompeleted == 1) "  type="primary" :disabled="isokDisable" @click="form_examine_save()">确认</el-button>
+        <el-button v-if="istab2Shenhe2 && (examineTemp.flowCompeleted == 2) "  type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
+        <el-button v-if="istab2Shenhe3 && (examineTemp.flowCompeleted == 4) " type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</el-button>
+        <!-- <el-button v-if="dialogStatus==='examine22'" type="primary" :disabled="isokDisable" @click="form_examine_save22()">确认</el-button>
+        <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
+        <el-button v-if="dialogStatus==='examine33'" type="primary" :disabled="isokDisable" @click="form_examine_save33()">确认</el-button>
+        <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</el-button> -->
+        <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog  title="领用单" :visible.sync="dialogFormVisible_CollectionSparePartsSee" :close-on-click-modal="false" width="90%">
+      <div class="collectionSparePartsSee" style="height: 500px;">
+        <el-form
+          ref="collectionSparePartsSeeTemp"
+          :rules="rules"
+          :model="collectionSparePartsSeeTemp"
+          label-position="right"
+          label-width="120px"
+          style="width: 90%;margin:0 auto;"
+        >
+          <el-row>
+            <el-col  :span="8">
+              <el-form-item label="领用单号:" prop="applyCode">
+                <el-input ref="applyCode" v-model="collectionSparePartsSeeTemp.applyCode" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="领用部门:" prop="departmentName">
+                <el-input ref="departmentName" v-model="collectionSparePartsSeeTemp.departmentName" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col   :span="8">
+              <el-form-item label="领用日期:" prop="applyDate">
+                <el-input ref="applyDate" v-model="collectionSparePartsSeeTemp.applyDate" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row v-if="isPartCode">
+            <el-col :span="16">
+              <el-form-item label="所需备件:" prop="partCode">
+                <el-autocomplete
+                  v-model="collectionSparePartsSeeTemp.partCode"
+                  value-key="name"
+                  class="inline-input"
+                  :fetch-suggestions="sparePartSearch"
+                  placeholder="请输入备件编号或备件名称或备件规格"
+                  style="width:98%"
+                  @select="handleSelectSparePart"
+                >
+                  <template slot-scope="{ item }">
+                    <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
+                    |  &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
+                    |  &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
+                    |  &nbsp;<b>库存:</b><span class="addr">{{ item.reportery }}</span>
+                    |  &nbsp;<b>是否零库存:</b><span class="addr" v-if="item.isZeroStock==1">是</span>
+                    <span class="addr" v-else>否</span>
+                  </template>
+                </el-autocomplete>
+              </el-form-item>
+            </el-col>
+
+          </el-row>
+        </el-form>
+        <el-table
+          :key="tableKey"
+          v-loading="listLoading"
+          element-loading-text="给我一点时间"
+          :data="listCreateCollectionSpareParts"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;margin-bottom:30px"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+        >
+          <!-- table表格 -->
+          <el-table-column type="index" label="序号" align="center" width="50px" />
+          <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.partCode }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件名称" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.partName }}</span><br>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件规格" prop="specification" align="center" min-width="100">
+            <template slot-scope="scope">
+              <span>{{ scope.row.specification }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="库存数" prop="reportery" align="center" min-width="100">
+            <template slot-scope="scope">
+              <span>{{ scope.row.reportery }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="领用数量" prop="amount" align="center" min-width="80">
+            <template slot-scope="scope">
+              <el-form :model="scope.row">
+                <el-form-item prop="amount">
+                  <el-input ref="amount" v-model="scope.row.amount" :disabled="dialogStatus==='collectionSparePartsSee1'" style="margin-top:15px" />
+                </el-form-item>
+              </el-form>
+            </template>
+          </el-table-column>
+          <!-- <el-table-column  label="领用时间" prop="date" align="center" min-width="100">
+            <template slot-scope="scope">
+              <span>{{ scope.row.date }}</span>
+            </template>
+          </el-table-column> -->
+          <el-table-column label="用途" prop="note" align="center" min-width="60">
+            <template slot-scope="scope">
+              <el-form :model="scope.row">
+                <el-form-item prop="note">
+                  <el-input ref="note" v-model="scope.row.note" :disabled="dialogStatus==='collectionSparePartsSee1'" style="margin-top:15px" />
+                </el-form-item>
+              </el-form>
+            </template>
+          </el-table-column>
+
+             <el-table-column   label="设备名称" prop="eqName" align="center" min-width="250">
+                <template slot-scope="scope">
+                  <el-autocomplete  v-if="isCreatePartDelete"
+                    v-model="scope.row.eqName"
+                    class="inline-input"
+                    :fetch-suggestions="querySearchEqName"
+                    value-key="eqName"
+                    placeholder="设备名称"
+                    @select="(value)=>
+                    {handleSelectEqName(value, scope.row)}"
+                    @blur="(value)=>
+                    {blurSelectEqName(value, scope.row)}"
+                  >
+                    <template slot-scope="{ item }">
+                      <span class="addr">{{ item.eqName }}</span>
+                      |<span class="addr">{{ item.eqCode }}</span>
+                    </template>
+                  </el-autocomplete>
+                  <span v-else class="addr">{{ scope.row.eqName }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column   label="设备内部编号" prop="eqCode" align="center" min-width="150">
+                <template slot-scope="scope">
+                  <el-autocomplete v-if="isCreatePartDelete"
+                    v-model="scope.row.eqCode"
+                    class="inline-input"
+                    :fetch-suggestions="querySearchCode"
+                    value-key="eqCode"
+                    placeholder="设备内部编号"
+                    @select="(value)=>
+                    {handleSelectEqCode(value, scope.row)}"
+                    @blur="(value)=>
+                    {blurSelectEqCode(value, scope.row)}"
+                  />
+                  <span v-else class="addr">{{ scope.row.eqCode }}</span>
+                </template>
+              </el-table-column>
+
+          <el-table-column v-if="isCreatePartDelete" label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
+            <template slot-scope="{row}">
+              <a class="del" @click="createPartDelete(row)">删除</a>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div slot="footer" class="dialog-footer" style="bottom:5px">
+        <el-button v-if="isPartCode" type="primary" :disabled="isokDisable" @click="createCollectionSparePartsData()">确认</el-button>
+        <!-- <el-button @click="dialogFormVisible_CollectionSparePartsSee = false;">关闭</el-button> -->
+        <el-button @click="closeCollectionSparePartsSee">关闭</el-button>
+      </div>
+    </el-dialog>
+
+
+
+  </div>
+</template>
+
+<script>
+import echarts from 'echarts'
+require('echarts/theme/macarons')
+import { GetDataByNames, GetReportform, GetDataByName, PostDataByName, checkButtons, ExecDataByConfig} from '@/api/common'
+import Cookies from 'js-cookie'
+import { parseTime, json2excel } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'Tab2',
+  components: { Pagination },
+  inject: ['reload'],
+  data() {
+    return {
+      myHeight:document.documentElement.clientHeight - 85- 200,
+      //多个下拉框 - 请求内容
+      send_select_list: [
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+
+      ],
+
+
+      //  下拉框 - 牧场
+      pastureNameList: [
+        // {id: "犊牛1", name: "犊牛1"},
+        // {id: "犊牛2", name: "犊牛2"},
+        // {id: "犊牛3", name: "犊牛3"}
+      ],
+
+      getDepartParam1: {
+        name: 'findAllDepart', offset: 0, pagecount: 0,
+        parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
+      },
+      employeNameList: [],
+      departNameList1: [],
+      getDepartParam2: {
+        name: 'findAllDepart', offset: 0, pagecount: 0,
+        parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
+      },
+      departNameList2: [],
+
+      // statuesNameList: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
+      statuesNameList: [{ id: '0', name: '未离厂' }, { id: '1', name: '未回厂' }, { id: '2', name: '已回厂' }, { id: '3', name: '已验收' }],
+      iscontractList:[{id: '0', name: '有合同'},{id: '1', name: '无合同'}],
+      isokDisable: false,
+
+
+      tableObj1: {
+        getdataListParm: {
+          name: 'getBigacceptanceList',
+          //请求的 page 无用参数  offset 第几页  pagecount 每页多少条
+          page: 1, offset: 1,pagecount: 10,returntype: 'Map',
+          parammaps: { pastureName:Cookies.get('pasturename'), acceptanceCode: '',departmentName: '',status: "",outsourcingCode: "", inputDatetime:"",startdate: "",enddate: "",iscontract:''}
+        },
+        tableKey: 0,listLoading: false,
+        //返回的 pageNum 第几页  pageSize 每页多少条 total 总条数
+        pageNum:'',pageSize:'',total: 0,
+        list: [
+
+        ]
+      },
+      pageNum:'',pageSize:'',total: 0,
+      getAddContListParam:  {
+        name: "getOutsourcingList",
+        page: 1,offset: 1,pagecount: 20,returntype: "Map",
+        parammaps: {"bigId": ""}
+      },
+
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() > Date.now()// 当天之前的时间可选
+        }
+      },
+      dialogFormVisible_CollectionSparePartsSee: false,
+      beforedialog:'',
+      listCreateCollectionSpareParts: [],
+      isCreatePartDelete: false,
+      isPartCode: true,
+      getCollarUseSeeParm: {
+        name: 'getpartapplyListBybig',
+        parammaps: {}
+      },
+      orderPart: {},
+      getOutCodetParm: {
+        name: 'getBigoutsourcingCode',
+        returntype: 'Map',
+        parammaps: {
+          pastureId: Cookies.get('pastureid'),
+          outsourcingCode:"",
+        }
+      },
+      useForms: [],
+      getParmCreateAdd: {
+        name: 'getPartApplyByBig',
+        returntype: 'Map',
+        parammaps: {}
+      },
+
+      rules: {
+        equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
+        // lcdate: [{ required: true, message: '必填', trigger: 'blur' }],
+        // hcdate: [{ required: true, message: '必填', trigger: 'blur' }],
+      },
+      getPramPartApplyListBybig: {
+        name:"getpartapplyListBybig",
+        returntype:"Map",
+        parammaps:{"id":""}
+      },
+
+      getPramAcceptanceList: {
+        name:"getAcceptanceList",
+        returntype:"Map",
+        parammaps:{"bigId	":""}
+      },
+
+
+      getCollarUseListParm: {
+        name: 'getPartsapplybyMt',
+        page: 1,
+        offset: 1,
+        returntype: 'Map',
+        parammaps: {
+          "RUCode":"",
+        }
+      },
+
+      collectionSparePartsSeeTemp: {
+        applyCode:"",departmentName:"",applyDate:"",
+        isStock: 0,
+        applyDate:"",
+      },
+      listCollectionSpareParts: [],
+
+      tableKey: 0,
+      listLoading: true,
+      total: 0,
+      list: [],
+      dialogStatus: '',
+      dialogFormVisible: false,
+      dialogFormVisibleSee: false,
+      listLoadingSee: true,
+      listSee: [],
+      totalSee: 0,
+      seeTemp: {},
+      getdataListSee: {
+        name: 'getpartpurchaseBybig',
+        returntype: 'Map',
+        parammaps: {}
+      },
+      createTemp: {
+        pastureId: this.$store.state.user.pastureid,
+        departmentId: this.$store.state.user.departmentid,
+        employeId: this.$store.state.user.employeid,
+        date: parseTime(new Date(), '{y}-{m}-{d}'),
+        providerId: '',
+        contract:1,
+        acceptanceCode:"",
+        outsourcingCode:"",
+        applyType:0,
+        remark:'',
+
+        applicant: '',
+
+        departmentName: '',
+
+        contract:1,
+      },
+
+      getParmCreateNumber: {
+        name: 'autoCreatCode',
+        page: 0, offset: 0,  pagecount: 0,  returntype: 'Map',
+        parammaps: {
+          pastureId: Cookies.get('pastureid'),
+          codeType: 'WY'
+        }
+      },
+      getParmCreateNumber2: {
+        name: 'autoCreatCode',
+        page: 0, offset: 0,  pagecount: 0,  returntype: 'Map',
+        parammaps: {
+          pastureId: Cookies.get('pastureid'),
+          codeType: 'LY'
+        }
+      },
+
+
+      requestSparePart: {
+        name: 'getPartsListLY', page: 1, offset: 1, pagecount: 20, returntype: 'Map',
+        parammaps: { pastureId: Cookies.get('pastureid') }
+      },
+
+      EqNameList: [],
+      requestEqName: {
+        name: 'geteqbyNameCode', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
+        parammaps: { pastureId: Cookies.get('pastureid') }
+      },
+      EqCodeList: [],
+
+
+
+      listAdd:[],
+      listAdd2:[],
+      isData:false,
+
+      listAddCont:[
+        //  {providerName:"",providerId: "0",eqId: "0",contractId: "0",}
+      ],
+      activeList: [],
+      active: 1,
+
+      dialogFormVisible_Examine: false,
+      examineTemp: {
+            "status": 1,
+            "empid": "",
+            "flowCompeleted":"",
+            "workflowNote": "",
+            "id": ""
+      },
+      statueReason: false,
+      rowStyle: { maxHeight: 50 + 'px', height: 35 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      textMap: {
+        update: '编辑',
+        create: '新增',
+        see: '查看',
+        examine: '审核1',
+        examine22: '审核2',
+        examine2: '审核3',
+        examine33: '审核4',
+        examine3: '审核5',
+        collectionSparePartsSee: '查看领用',
+        collectionSparePartsSee1:'查看领用',
+        collectionSparePartsCreate: '添加领用',
+      },
+
+      istab2Add:[],
+      istab2Edit:[],
+      istab2Del:[],
+      istab2Shenhe1:[],
+      istab2Shenhe2:[],
+      istab2Shenhe3:[],
+    }
+  },
+  created() {
+
+
+    this.get_select_list()
+    this.get_table_data1()
+
+  },
+  methods: {
+    //获取按钮权限
+    get_auto_buttons() {
+      const istab2Add = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:add')
+      this.istab2Add = istab2Add
+
+      const istab2Edit = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:edit')
+      this.istab2Edit = istab2Edit
+
+      const istab2Del = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:del')
+      this.istab2Del = istab2Del
+
+      const istab2Shenhe1 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe1')
+      this.istab2Shenhe1 = istab2Shenhe1
+
+      const istab2Shenhe2 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe2')
+      this.istab2Shenhe2 = istab2Shenhe2
+
+      const istab2Shenhe3 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe3')
+      this.istab2Shenhe3 = istab2Shenhe3
+
+    },
+
+
+    get_select_list() {
+      GetDataByNames(this.send_select_list).then(response => {
+        this.pastureNameList =response.data.getPastureRoleList.list // response.data.findAllPasture.list
+        console.log("牧场下拉框", this.pastureNameList)
+        this.employeNameList = response.data.findAllEmploye.list
+        console.log("申请人下拉框", this.employeNameList)
+
+        this.get_depart_list1()
+      })
+    },
+    change_pasture1(item) {
+      this.getDepartParam1.parammaps.pastureId = this.pastureNameList.find(obj => obj.name == item).id
+      this.tableObj1.getdataListParm.parammaps.departmentId = ''
+      this.get_depart_list1()
+    },
+    //部门List
+    get_depart_list1() {
+      GetDataByName(this.getDepartParam1).then(response => {
+        this.departNameList1 = response.data.list
+      })
+    },
+
+
+    change_pasture2(item) {
+      this.getDepartParam2.parammaps.pastureId = item
+      this.get_depart_list2()
+    },
+
+    get_depart_list2() {
+      GetDataByName(this.getDepartParam2).then(response => {
+        this.departNameList2 = response.data.list
+      })
+    },
+
+    change_depart2(item) {
+      this.createTemp.departmentName = this.departNameList2.find(obj => obj.id == item).name
+    },
+
+
+    get_table_data1() {
+      this.tableObj1.listLoading = false
+
+      if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
+        this.tableObj1.getdataListParm.parammaps.startdate = this.$refs['inputDatetime'].value[0]
+        this.tableObj1.getdataListParm.parammaps.enddate = this.$refs['inputDatetime'].value[1]
+
+
+      } else {
+        this.tableObj1.getdataListParm.parammaps.inputDatetime = ''
+        this.tableObj1.getdataListParm.parammaps.startdate = ''
+        this.tableObj1.getdataListParm.parammaps.enddate = ''
+      }
+
+      GetDataByName(this.tableObj1.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          this.tableObj1.list = response.data.list
+          this.tableObj1.pageNum = response.data.pageNum
+          this.tableObj1.pageSize = response.data.pageSize
+          this.tableObj1.total = response.data.total
+        } else {
+          this.tableObj1.list = [ ]
+        }
+
+        setTimeout(() => {
+          this.tableObj1.listLoading = false
+        }, 100)
+      })
+    },
+    form_search() {
+      console.log('查询')
+
+
+      this.get_table_data1()
+
+    },
+    change_applyType(val) {
+      console.log(val)
+      if(val ==1){
+        this.createTemp.applyType = 1
+      } else {
+        this.createTemp.applyType = 0
+      }
+
+    },
+    form_add() {
+      this.reset_create()
+
+      this.getDepartParam2.parammaps.pastureId = this.createTemp.pastureId
+      this.get_depart_list2()
+      this.dialogStatus = 'create'
+
+
+      this.dialogFormVisible = true
+      this.listLoading = false
+      this.$nextTick(() => {
+        this.$refs['createTemp'].clearValidate()
+      })
+       //新增生成单号
+      this.getCreateNumber()
+
+    },
+    statue: function(cellValue) {
+      // console.log(cellValue.isZeroStock)
+      if (cellValue.statue == 0) {
+        return '未领用'
+      } else if (cellValue.statue == 1) {
+        return '已领用'
+      }
+    },
+    reset_create() {
+      this.createTemp.pastureId =  parseInt(Cookies.get('pastureid'))
+      this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
+      this.createTemp.departmentName = Cookies.get('departmentname')
+      this.createTemp.employeId = parseInt(Cookies.get('employeid'))
+      this.createTemp.date = parseTime(new Date(), '{y}-{m}-{d}')
+      this.createTemp.outsourcingCode = ''
+      this.createTemp.applicant = parseInt(Cookies.get('employeid'))
+      this.createTemp.providerId = ''
+      this.createTemp.contract = 1
+
+      this.createTemp.description = ''
+
+      if(parseInt(Cookies.get('pastureid')) == 18){
+      this.createTemp.departmentId = ""
+     }
+
+      this.createTemp.outsourcingCode = ''
+      console.log(  this.createTemp.departmentName )
+
+
+
+
+      this.listAddCont = [
+      //   {providerName:"",providerId: "0",eqId: "0",contractId: "0",amount:"",contractCode:"",date:"",eqCode:"",eqName:"",remark:"",typea:"",}
+      ]
+      this.listAdd = []
+      this.listAdd2 = []
+      this.listCreateCollectionSpareParts = []
+      this.listCollectionSpareParts = []
+
+
+
+
+    },
+
+
+
+    handleCollarUseSee(row, isStock) {
+      console.log(row)
+      let beforedialog = ''
+      this.beforedialog = this.dialogStatus
+      this.collectionSparePartsSeeTemp = Object.assign({}, row)
+      this.dialogStatus = 'collectionSparePartsSee1'
+
+      this.collectionSparePartsSeeTemp.applyDate = row.createDate
+      this.dialogFormVisible_CollectionSparePartsSee = true
+      this.isCreatePartDelete = false
+      this.isPartCode = false
+      this.getCollarUseSeeList()
+    },
+    getCollarUseSeeList() {
+      this.getCollarUseSeeParm.parammaps.id = this.collectionSparePartsSeeTemp.id
+      GetDataByName(this.getCollarUseSeeParm).then(response => {
+        this.listCreateCollectionSpareParts = response.data.list
+
+      })
+    },
+
+    form_add_list2() {
+      var idDel = "id" + Math.round(Math.random()*100) + Math.round(Math.random()*100)
+
+      this.listAdd2.unshift({partCode:"",providerId: "0",eqId: "0",contractId: "0",idDel:idDel,partId: "",partCode: "",partName: "",brandId: "",brand: "",providerId: "",providerName: "",price: "",sumPrice: "",remark: "",amount: ""})
+
+
+    },
+
+    getCreateNumber() {
+      GetDataByName(this.getParmCreateNumber).then(response => {
+        this.$nextTick(() => {
+          console.log('新增委外维修单单号', response.data.list[0].orderCode)
+          this.createTemp.acceptanceCode = response.data.list[0].orderCode
+          this.$forceUpdate()
+        })
+      })
+
+    },
+
+
+    getCreateLYNumber() {
+
+      GetDataByName(this.getParmCreateNumber2).then(response => {
+        this.$nextTick(() => {
+          console.log('新增领用单号', response.data.list[0].orderCode)
+          this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
+          this.$forceUpdate()
+        })
+      })
+    },
+
+    add_dialog_save() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          console.log(this.listAddCont)
+          if (this.createTemp.acceptanceCode == '' || this.createTemp.acceptanceCode == null || this.createTemp.acceptanceCode == undefined) {
+            GetDataByName(this.getParmCreateNumber).then(response => {
+              this.$nextTick(() => {
+                console.log('新增单号', response.data.list[0].orderCode)
+                this.createTemp.acceptanceCode = response.data.list[0].orderCode
+                this.$forceUpdate()
+                this.add_dialog_saveSave()
+              })
+            })
+          } else {
+            this.add_dialog_saveSave()
+          }
+        }
+      })
+    },
+
+
+    add_dialog_saveSave() {
+
+        for (var j = 0; j < this.listAddCont.length; j++) {
+          console.log(this.listAddCont[j].amount)
+          if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
+            this.$message({ type: 'warning', message: '请检查金额是否未填写', duration: 2000 })
+            return false
+          } else {
+            // var rulesAmount = /^[1-9]\d*$/
+            // if (!rulesAmount.test(this.listAddCont[j].amount)) {
+            //   this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
+            //   return false
+            // }
+          }
+
+
+        }
+        //牧场
+        if(this.createTemp.applyType == 0){
+
+
+          let mySumPrice = 0
+          for (let i = 0; i < this.listAdd.length; i++) {
+            mySumPrice += parseFloat(this.listAdd[i].price) * parseFloat(this.listAdd[i].amount)
+          }
+          if (mySumPrice > 500) {
+            this.createTemp.SHStatus = 2
+          } else {
+            this.createTemp.SHStatus = 9
+          }
+
+
+          var send_data = {
+            "common": {  "returnmap": "0" },
+            "data": [
+              {
+                "name": "insertBigacceptance",
+                "type": "e",
+                "parammaps": this.createTemp
+              }
+            ]
+          }
+
+        }
+        //供应商
+        if(this.createTemp.applyType == 1){
+
+
+
+          if(this.listAdd2.length == 0){
+            this.$notify({
+              title: '失败',   message: "备件必选!",
+              type: 'warning',
+              duration: 2000
+            })
+            return false
+          }
+          this.listAdd2.map((item, index) => {
+             return item.partId = "0"
+          })
+          this.listAdd2.map((item, index) => {
+             return item.brandId = "0"
+          })
+
+          this.listAdd2.map((item, index) => {
+             return item.providerId = "0"
+          })
+
+
+          var send_data = {
+              "common": {
+                  "returnmap": "0"
+              },
+              "data": [
+                  {
+                      "name": "insertBigacceptance",
+                      "type": "e",
+                      "parammaps": this.createTemp
+                  },
+                  {
+                      "name": "insertSpotList",
+                      "resultmaps": {
+                          "list": this.listAdd2
+                      },
+                      "children": [
+                          {
+                              "name": "insertAcceptance",
+                              "type": "e",
+                              "parammaps": {
+                                "bigId":"@insertBigacceptance.LastInsertId",
+                                "partId":"@insertSpotList.partId",
+                                "partCode":"@insertSpotList.partCode",
+                                "partName":"@insertSpotList.partName",
+                                "brandId":"@insertSpotList.brandId",
+                                "brand":"@insertSpotList.brand",
+                                "providerId":"@insertSpotList.providerId",
+                                "providerName":"@insertSpotList.providerName",
+                                "unit":"@insertSpotList.unit",
+                                "price":"@insertSpotList.price",
+
+                                "remark":"@insertSpotList.remark",
+                                   "specification": "@insertSpotList.specification",
+                                "amount":"@insertSpotList.amount"
+                              }
+                          }
+                      ]
+                  }
+              ]
+          }
+
+
+        }
+
+        ExecDataByConfig(send_data).then(response => {
+          console.log('新增保存发送参数', send_data)
+          if (response.msg === 'fail') {
+            this.$notify({
+              title: '保存失败',
+              message: response.data,
+              type: 'warning',
+              duration: 2000
+            })
+          } else {
+            this.dialogFormVisible = false
+
+            this.get_table_data1()
+
+            this.$notify({
+              title: '',
+              message: '保存成功',
+              type: 'success',
+              duration: 2000
+            })
+          }
+        })
+
+
+    },
+
+
+    getOutNumber(queryString, cb) {
+      console.log('委外申请单号模糊查询输入值', queryString)
+      this.getOutCodetParm.parammaps['outsourcingCode'] = queryString
+      GetDataByName(this.getOutCodetParm).then(response => {
+        console.log('委外申请单号模糊查询搜索data', response.data.list)
+        // this.useForms = response.data.list
+        cb(response.data.list)
+      })
+    },
+
+
+    changeOutNumber(item) {
+      console.log('委外申请单号模糊查询选中值', item)
+      this.createTemp.outsourcingCode = item.outsourcingCode
+      this.$set(this.createTemp, "outsourcingCode", item.outsourcingCode)
+      this.getAddContListParam.parammaps.bigId = item.id
+      this.getAddContList()
+
+
+      // this.createTemp.bid = item.id
+      // this.createTemp.applicatId = item.empId
+      // this.orderPart.applyCode = item.applyCode
+      // this.TotalAmount = 0
+      // this.get_table_dataAdd()
+    },
+
+
+    querySearchEqName(queryString, cb) {
+      console.log('备件名称/设备内部编号模糊查询输入值', queryString)
+      this.requestEqName.parammaps['eqName'] = queryString
+      GetDataByName(this.requestEqName).then(response => {
+        console.log('备件名称模糊查询搜索data', response.data.list)
+        this.EqNameList = response.data.list
+        cb(this.EqNameList)
+      })
+    },
+    handleSelectEqName(item, row) {
+      console.log('备件名称/设备内部编号模糊查询选中值', item.eqName)
+      console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
+      this.$set(row, 'eqCode', item.eqCode)
+      this.$forceUpdate()
+    },
+    querySearchCode(queryString, cb) {
+      console.log('备件名称/设备内部编号模糊查询输入值', queryString)
+      this.requestEqName.parammaps['eqCode'] = queryString
+      GetDataByName(this.requestEqName).then(response => {
+        console.log('备件名称模糊查询搜索data', response.data.list)
+        this.EqNameList = response.data.list
+        cb(this.EqNameList)
+      })
+    },
+    handleSelectEqCode(item, row) {
+      console.log('备件名称/设备内部编号模糊查询选中值', item)
+      console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
+      this.$set(row, 'eqName', item.eqName)
+      this.$forceUpdate()
+    },
+    blurSelectEqName(item, row) {
+      this.$set(row, 'eqName', '')
+      this.$set(row, 'eqCode', '')
+    },
+    blurSelectEqCode(item, row) {
+      this.$set(row, 'eqName', '')
+      this.$set(row, 'eqCode', '')
+    },
+
+
+
+    sparePartSearch(queryString, cb) {
+      console.log('备件模糊查询输入值', queryString)
+      this.requestSparePart.parammaps.pastureId = this.createTemp.pastureId
+      this.requestSparePart.parammaps['partCode'] = queryString
+      GetDataByName(this.requestSparePart).then(response => {
+        console.log('备件模糊查询搜索data', response.data.list)
+        if (response.data.list == null) {
+          cb([])
+        } else {
+          cb(response.data.list)
+        }
+      })
+    },
+    // handleSelectSparePart(item) {
+    //   console.log('备件模糊查询选中值', item)
+    //   if (this.listAdd.length > 0) {
+    //     // eslint-disable-next-line no-redeclare
+    //     if (this.listAdd.find(obj => obj.id === item.id)) {
+    //       this.$message({
+    //         type: 'warning',
+    //         message: '此备件已存在,请重新选择备件'
+    //       })
+    //     } else {
+    //       if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
+    //         this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
+    //         this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
+    //       } else {
+    //         item.srcpath = ''
+    //         item.picpath = ''
+    //       }
+    //       this.listAdd.push(item)
+    //     }
+    //   } else {
+    //     if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
+    //       this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
+    //       this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
+    //     } else {
+    //       item.srcpath = ''
+    //       item.picpath = ''
+    //     }
+    //     this.listAdd.push(item)
+    //   }
+    //   // this.getEqNameList()
+    // },
+
+
+    handleSelectSparePart(item) {
+      console.log('备件模糊查询选中值', item)
+      if (this.listCreateCollectionSpareParts.length > 0) {
+        // eslint-disable-next-line no-redeclare
+        if (this.listCreateCollectionSpareParts.find(obj => obj.partId === item.partId)) {
+          this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
+        } else {
+
+          item.date = this.collectionSparePartsSeeTemp.applyDate
+          this.listCreateCollectionSpareParts.unshift(item)
+        }
+      } else {
+        item.date = this.collectionSparePartsSeeTemp.applyDate
+        this.listCreateCollectionSpareParts.unshift(item)
+      }
+    },
+
+
+    createPartDelete(row) {
+      console.log(this.listAdd)
+      MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        // console.log(this.list2)
+        for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
+          console.log(this.listCreateCollectionSpareParts[i])
+          if (this.listCreateCollectionSpareParts[i].id === row.id) {
+            var listCreateCollectionSparePartsIndex = this.listCreateCollectionSpareParts.indexOf(this.listCreateCollectionSpareParts[i])
+          }
+          if (listCreateCollectionSparePartsIndex > -1) {
+            this.listCreateCollectionSpareParts.splice(listCreateCollectionSparePartsIndex, 1)
+            return
+          }
+        }
+      })
+    },
+
+    closeCollectionSparePartsSee(){
+      this.dialogFormVisible_CollectionSparePartsSee = false
+      this.dialogStatus = this.beforedialog
+    },
+    // 添加领用保存
+    createCollectionSparePartsData() {
+      this.isokDisable = true
+
+          if (this.listCreateCollectionSpareParts.length !== 0) {
+            for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
+              console.log(this.listCreateCollectionSpareParts[i].amount)
+              if (this.listCreateCollectionSpareParts[i].amount !== undefined && this.listCreateCollectionSpareParts[i].amount !== '') {
+                var rulesAmount = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
+                if (!rulesAmount.test(this.listCreateCollectionSpareParts[i].amount)) {
+                  this.$message({
+                    type: 'error',
+                    message: '领用数量请输入正数,最多保留两位小数',
+                    duration: 2000
+                  })
+                  return false
+                } else {
+                  var listCreateCollectionSpareParts1 = [] // >库存
+                  var listCreateCollectionSpareParts2 = [] // <=库存
+                  var amountList = []
+                  var amount2List = []
+
+
+                  let mySumPrice = 0
+                  for (let i = 0; i < listCreateCollectionSpareParts2.length; i++) {
+                    mySumPrice += parseFloat(listCreateCollectionSpareParts2[i].price) * parseFloat(listCreateCollectionSpareParts2[i].amount)
+                  }
+                  if (mySumPrice > 500) {
+                    this.collectionSparePartsSeeTemp.SHStatus = 2
+                  } else {
+                    this.collectionSparePartsSeeTemp.SHStatus = 9
+                  }
+
+
+
+                  var send_data ={
+                      "common": { "returnmap": "0"  },
+                      "data": [
+                          {
+                              "name": "insertBigpartapply",
+                              "type": "e",
+                              "parammaps": {
+                                  "pastureId": this.collectionSparePartsSeeTemp.pastureId,
+                                  "applyCode": this.collectionSparePartsSeeTemp.applyCode,
+                                  "applyType": 1,
+                                  "departmentId": this.collectionSparePartsSeeTemp.departmentId,
+                                  "empId": this.collectionSparePartsSeeTemp.empId,
+                                  "applyDate": this.collectionSparePartsSeeTemp.applyDate,
+                                  "RUCode": this.createTemp.acceptanceCode,
+                                  "SHStatus": 9
+                              }
+                          },
+                          {
+                              "name": "insertSpotList",
+                              "resultmaps": {
+                                  "list":this.listCreateCollectionSpareParts
+                              },
+                              "children": [
+                                  {
+                                      "name": "insertpartapply",
+                                      "type": "e",
+                                      "parammaps": {
+                                          "bigId": "@insertBigpartapply.LastInsertId",
+                                          "pastureId": "@insertSpotList.pastureId",
+                                          "partId": "@insertSpotList.partId",
+                                          "partCode": "@insertSpotList.partCode",
+                                          "partName": "@insertSpotList.partName",
+                                          "specification": "@insertSpotList.specification",
+                                          "brandId": "@insertSpotList.brandId",
+                                          "price": "@insertSpotList.price",
+                                          "amount": "@insertSpotList.amount",
+                                          "eqName": "@insertSpotList.eqName",
+                                          "eqCode": "@insertSpotList.eqCode",
+                                          "providerId": "@insertSpotList.providerId",
+                                          "note": "@insertSpotList.note",
+                                          "reportery": "@insertSpotList.reportery",
+                                          "contractId": "@insertSpotList.contractId",
+                                          "locationId": "@insertSpotList.locationId"
+                                      }
+                                  }
+                              ]
+                          }
+                      ]
+                  }
+
+                  ExecDataByConfig(send_data).then(response => {
+                    console.log('添加领用保存发送参数',send_data)
+                    if (response.msg === 'fail') {
+                      this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
+                    } else {
+                      this.dialogFormVisible_CollectionSparePartsSee = false
+                      this.getCollectionSpareParts()
+                      this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
+                    }
+                  })
+                  setTimeout(() => {
+                    this.isokDisable = false
+                  }, 2000)
+                  return true
+                }
+              } else {
+                this.$message({ type: 'error', message: '请检查领用数量是否未填写', duration: 2000 })
+                return false
+              }
+            }
+
+
+          } else {
+            this.$notify({ title: '', type: 'warning', message: '请选择备件', duration: 2000 })
+
+
+            return false
+          }
+
+           setTimeout(() => {
+              this.isokDisable = false
+            }, 2000)
+
+    },
+    //看领用单
+    getCollectionSpareParts() {
+      this.getCollarUseListParm.parammaps.RUCode = this.createTemp.acceptanceCode
+      GetDataByName(this.getCollarUseListParm).then(response => {
+        console.log('领用table数据', response.data.list)
+        this.listCollectionSpareParts = response.data.list
+      })
+    },
+
+    // 新增删除
+    partDelete(row) {
+      console.log(this.listAdd)
+      MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        for (var i = 0; i < this.listAdd.length; i++) {
+          console.log(this.listAdd[i])
+          if (this.listAdd[i].id === row.id) {
+            var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
+          }
+          if (listAddIndex > -1) {
+            this.listAdd.splice(listAddIndex, 1)
+            return
+          }
+        }
+      })
+    },
+
+    partDelete2(row) {
+      console.log(this.listAdd2)
+      MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        for (var i = 0; i < this.listAdd2.length; i++) {
+          console.log(this.listAdd2[i])
+          if (this.listAdd2[i].idDel === row.idDel) {
+            var listAddIndex = this.listAdd2.indexOf(this.listAdd2[i])
+          }
+          if (listAddIndex > -1) {
+            this.listAdd2.splice(listAddIndex, 1)
+            return
+          }
+        }
+      })
+    },
+    handleCollectionSparePartsCreate() {
+
+
+
+      if(this.createTemp.departmentId == "" || this.createTemp.departmentId == undefined){
+        this.$message({ type: 'warning', message: '请选择责任部门', duration: 2000 })
+        return false
+      }
+
+      if(this.createTemp.applicant == "" || this.createTemp.applicant == undefined){
+        this.$message({ type: 'warning', message: '请选择录入人', duration: 2000 })
+        return false
+      }
+      console.log( "createTemp)============",this.createTemp)
+
+
+      this.collectionSparePartsSeeTemp = Object.assign({}, this.createTemp)
+
+        this.collectionSparePartsSeeTemp.empId =  this.collectionSparePartsSeeTemp.applicant
+        this.collectionSparePartsSeeTemp.applyDate = parseTime(new Date(), '{y}-{m}-{d}')
         this.dialogStatus = 'collectionSparePartsSee'
-        this.beforedialog = 'update'
-        this.dialogFormVisible_CollectionSparePartsSee = true
-        this.isCreatePartDelete = true
-        this.listCreateCollectionSpareParts = []
-        this.isPartCode = true
-        this.getCreateLYNumber()
-
-        console.log( "console.log( this.collectionSparePartsSeeTemp)============",this.collectionSparePartsSeeTemp)
-
-
-
-    },
-    // getCreateNumber() {
-    //   // GetDataByName(this.getParmCreateNumber).then(response => {
-    //   //   this.$nextTick(() => {
-    //   //     console.log('新增领用单号', response.data.list[0].orderCode)
-    //   //     this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
-    //   //     this.$forceUpdate()
-    //   //   })
-    //   // })
-    // },
-
-    form_see(row){
-      console.log('查看======》',row)
-      this.reset_create()
-
-      this.getDepartParam2.parammaps.pastureId = row.pastureId
-      this.get_depart_list2()
-
-      if (row.providerId == undefined) {
-        row.providerId = ''
-        row.providerName = ''
-      }
-      this.createTemp = Object.assign({}, row) // copy obj
-      this.dialogStatus = 'see'
-      this.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.$refs['createTemp'].clearValidate()
-      })
-      //委外申请单号获取合同
-      this.getAddContListParam.parammaps.bigId = row.outsourcingId
-      this.getAddContList()
-
-      //牧场
-      if(row.applyType == 0){
-        this.getPramPartApplyListBybig.parammaps.id = row.partapplyId
-        this.getCollectionSpareParts()
-        this.isCreatePartDelete = false
-
-
-
-      }
-      //供应商
-      if(row.applyType == 1){
-        this.getPramAcceptanceList.parammaps.bigId = row.id
-        this.getListAdd2()
-
-
-      }
-
-
-           if (row.flowCompeleted == 1) {
-            this.activeList = [{ title: '委外验收', date: row.createTime, name: row.empname }, { title: '供应处长' }, { title: '部门负责人' },{ title: '场长' }]
-            this.active = 1
-
-          } else if (row.flowCompeleted == 2) {
-            this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人' },{ title: '场长' }]
-            this.active = 2
-          } else if (row.flowCompeleted === 3) {
-            this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName },  { title: '供应处长', date: row.equipmentdate, name: row.equipmentName, status: 'error', reason: row.workflowNote },{ title: '部门负责人' },{ title: '场长' }]
-            this.active = 2
-
-          } else if (row.flowCompeleted === 4) {
-            this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser  },{ title: '场长' }]
-            this.active = 3
-          } else if (row.flowCompeleted === 5) {
-            this.activeList = [{ title: '委外验收', date: row.createTime, name:row.applicantName },  { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser, status: 'error', reason: row.workflowNote   },{ title: '场长' }]
-            this.active = 3
-          } else if (row.flowCompeleted === 6) {
-            this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date:row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser  },{ title: '场长', date:row.fielddate, name:row.fieldName }]
-            this.active = 4
-          } else if (row.flowCompeleted === 7) {
-            this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName },  { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser  },{  title: '场长', date: row.fielddate, name: row.fieldName, status: 'error', reason: row.workflowNote   }]
-            this.active = 4
-           }
-
-
-
-
-    },
-
-    getAddContList() {
-      GetDataByName(this.getAddContListParam).then(response => {
-        this.listAddCont = response.data.list
-        this.listLoading = false
-      })
-    },
-
-
-
-    form_edit(row) {
-      this.reset_create()
-      console.log('编辑',row)
-      this.getDepartParam2.parammaps.pastureId = row.pastureId
-      this.get_depart_list2()
-      if (row.providerId == undefined) {
-        row.providerId = ''
-        row.providerName = ''
-      }
-      this.createTemp = Object.assign({}, row) // copy obj
-      this.dialogStatus = 'update'
-      this.dialogFormVisible = true
-      this.$nextTick(() => {
-        this.$refs['createTemp'].clearValidate()
-      })
-      //委外申请单号获取合同
-      this.getAddContListParam.parammaps.bigId = row.outsourcingId
-      this.getAddContList()
-      this.isData = false
-      //牧场
-      if(row.applyType == 0){
-
-        this.getCollectionSpareParts()
-
-
-
-      }
-      //供应商
-      if(row.applyType == 1){
-        this.getPramAcceptanceList.parammaps.bigId = row.id
-        this.getListAdd2()
-
-
-      }
-    },
-
-    getListAdd() {
-      GetDataByName(this.getPramPartApplyListBybig).then(response => {
-        this.listAdd = response.data.list
-        this.listLoading = false
-      })
-    },
-
-    getListAdd2() {
-      GetDataByName(this.getPramAcceptanceList).then(response => {
-        this.listAdd2 = response.data.list
-        if(this.listAdd2.length>0){
-          this.isData = true
-        }else{
-          this.isData = false
-        }
-        this.listLoading = false
-      })
-    },
-
-    edit_dialog_save() {
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          this.edit_dialog_saveSave()
-        }
-      })
-    },
-    edit_dialog_saveSave() {
-
-        //牧场
-        if(this.createTemp.applyType == 0){
-          for(let i=0;i<this.listAddCont.length;i++){
-            // if(this.listAddCont[i].sealNumber == ''){
-            //   this.$message({ type: 'warning', message: '请检查铅封号是否未填写', duration: 2000 })
-            //   return false
-            // }
-            // if(this.listAddCont[i].warrantydate == ''){
-            //   this.$message({ type: 'warning', message: '请检查质保日期是否未填写', duration: 2000 })
-            //   return false
-            // }
-          }
-
-
-
-                var send_data = {
-                    "common": { "returnmap": "0"  },
-                    "data": [
-                        {
-                            "name": "editBigacceptanceDate",
-                            "type": "e",
-                            "parammaps": {
-                                "id":this.createTemp.id,
-                                "date":this.createTemp.date,
-                                "applyType":this.createTemp.applyType
-                            }
-                        },
-                        {
-                          "name": "updateBigacceptanceFlowCompeleted", "type": "e",
-                          "parammaps":{
-                            id:this.createTemp.id
-                          }
-                        },
-                        {
-                          "name": "editBigacceptance", "type": "e",
-                          "parammaps":{
-                            id:this.createTemp.id,
-                            lcdate:this.createTemp.lcdate,
-                            hcdate:this.createTemp.hcdate,
-                            remark:this.createTemp.remark
-                          }
-                        },
-                        {
-                          "name": "insertSpotList",
-                          "resultmaps": {  "list": this.listAddCont },
-                          "children": [
-                            {
-                                "name": "editOutsourcingData",  "type": "e",
-                                "parammaps": {
-                                  "id": "@insertSpotList.id",
-                                  "amount": "@insertSpotList.amount",
-                                  "sealNumber": "@insertSpotList.sealNumber",
-                                  "warrantydate": "@insertSpotList.warrantydate"
-                                  }
-                              }
-                          ],
-                        }
-                    ]
-                }
-
-
-          }
-            //供应商
-            if(this.createTemp.applyType == 1){
-
-
-
-              if(this.listAdd2.length == 0){
-                this.$notify({
-                  title: '失败',   message: "备件必选!",
-                  type: 'warning',
-                  duration: 2000
-                })
-                return false
-              }
-              this.listAdd2.map((item, index) => {
-                return item.partId = "0"
-              })
-              this.listAdd2.map((item, index) => {
-                return item.brandId = "0"
-              })
-
-              this.listAdd2.map((item, index) => {
-                return item.providerId = "0"
-              })
-              var myname = ''
-              // var bigId = ''
-              if(this.isData == true){
-                myname = 'editAcceptance'
-                // bigId = "@insertBigacceptance.LastInsertId"
-                // bigId = "@insertSpotList.bigId"
-              }else{
-                myname = 'insertAcceptance'
-                for(let i=0;i<this.listAdd2.length;i++){
-                  this.$set(this.listAdd2[i],'bigId',this.createTemp.id)
-                }
-                // bigId = "@insertSpotList.bigId"
-              }
-              var send_data = {
-                  "common": { "returnmap": "0"  },
-                  "data": [
-                      {
-                          "name": "editBigacceptanceDate",
-                          "type": "e",
-                          "parammaps": {
-                              "id":this.createTemp.id,"date":this.createTemp.date,"applyType":this.createTemp.applyType
-                          }
-                      },
-                      {
-                          "name": "insertSpotList",
-                          "type": "e",
-                          "resultmaps": {
-                              "list": this.listAdd2
-                          },
-                          "children": [
-                              {
-                                  "name": myname,
-                                  "type": "e",
-                                  "parammaps": {
-                                    "id":"@insertSpotList.id",
-                                    "bigId":"@insertSpotList.bigId",
-                                    "partId":"@insertSpotList.partId",
-                                    "partCode":"@insertSpotList.partCode",
-                                    "partName":"@insertSpotList.partName",
-                                    "brandId":"@insertSpotList.brandId",
-                                    "brand":"@insertSpotList.brand",
-                                    "providerId":"@insertSpotList.providerId",
-                                    "providerName":"@insertSpotList.providerName",
-                                    "unit":"@insertSpotList.unit",
-                                    "price":"@insertSpotList.price",
-                                    "remark":"@insertSpotList.remark",
-                                    "specification":"@insertSpotList.specification",
-                                    "amount":"@insertSpotList.amount"
-                                  }
-                              }
-                          ]
-                      },
-                      {
-                        "name": "updateBigacceptanceFlowCompeleted", "type": "e",
-                        "parammaps":{
-                          id:this.createTemp.id
-                        }
-                      },
-                      {
-                        "name": "editBigacceptance", "type": "e",
-                        "parammaps":{
-                          id:this.createTemp.id,
-                          lcdate:this.createTemp.lcdate,
-                          hcdate:this.createTemp.hcdate
-                        }
-                      },
-                      {
-                        "name": "insertSpotList",
-                        "resultmaps": {  "list": this.listAddCont },
-                        "children": [
-                          {
-                              "name": "editOutsourcingData",  "type": "e",
-                              "parammaps": {
-                                "id": "@insertSpotList.id",
-                                "amount": "@insertSpotList.amount",
-                                "sealNumber": "@insertSpotList.sealNumber",
-                                "warrantydate": "@insertSpotList.warrantydate"
-                                }
-                            }
-                        ],
-                      }
-                  ]
-              }
-
-
-
-            }
-
-            ExecDataByConfig(send_data).then(response => {
-            console.log('编辑保存发送参数', send_data)
-            if (response.msg === 'fail') {
-              this.$notify({
-                title: '保存失败',
-                message: response.data,
-                type: 'warning',
-                duration: 2000
-              })
-            } else {
-              this.dialogFormVisible = false
-
-              this.get_table_data1()
-
-              this.$notify({
-                title: '',
-                message: '保存成功',
-                type: 'success',
-                duration: 2000
-              })
-            }
-            })
-
-    },
-
-    form_delete(row) {
-      console.log('点击了删除',row)
-      MessageBox.confirm('确认删除此条信息?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        var send_data = {
-        "common": { "returnmap": "0" },
-        "data": [
-          {
-            "name": "deleteBigacceptance", "type": "e",
-            "parammaps": { "id":row.id }
-           }
-          ]
-        }
-
-        ExecDataByConfig(send_data).then(response => {
-          this.get_table_data1()
-          this.$notify({
-            title: '成功',
-            message: '删除成功',
-            type: 'success',
-            duration: 2000
-          })
-        })
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '已取消删除'
-        })
-      })
-    },
-
-
-    change_statue(val) {
-      if (val == 2) {
-        this.statueReason = true
-      } else {
-        this.statueReason = false
-      }
-    },
-
-    form_examine(row) {
-      console.log('点击了供应处长审核',row)
-      if (row == undefined) {
-        this.examineTemp = this.createTemp
-        this.$set(this.createTemp, 'status', 1)
-        this.$set(this.createTemp, 'workflowNote', '')
-      } else {
-        this.examineTemp = Object.assign({}, row)
-        this.$set(this.examineTemp, 'status', 1)
-        this.$set(this.examineTemp, 'workflowNote', '')
-      }
-      this.dialogStatus = 'examine'
-      this.dialogFormVisible_Examine = true
-      this.statueReason = false
-    },
-    form_examine_save() {
-      console.log('点击了供应处长审核', )
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['examineTemp'].validate(valid => {
-        if (valid) {
-
-          //不通过
-          if(this.statueReason){
-            this.examineTemp.status = 2
-             //审核角色
-            this.examineTemp.flowCompeleted = "3"
-          } else {
-            this.examineTemp.status = 0
-            this.examineTemp.flowCompeleted = "2"
-          }
-          this.examineTemp.empid = Cookies.get('employeid')
-
-          var send_data = {
-              "common": {  "returnmap": "0"  },
-              "data": [
-                  {
-                      "name": "EditBigacceptanceEquipment",  "type": "e",
-                      "parammaps": this.examineTemp
-                  }
-              ]
-          }
-          ExecDataByConfig(send_data).then(response => {
-            console.log('审核确认发送参数', send_data)
-            if (response.msg !== 'fail') {
-              this.get_table_data1()
-              this.dialogFormVisible_Examine = false
-              this.statueReason = false
-              this.$notify({
-                title: '成功',
-                message: '审核成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-
-    form_examine2(row) {
-      console.log('点击了部门负责人审核',row)
-      if (row == undefined) {
-        this.examineTemp = this.createTemp
-        this.$set(this.createTemp, 'status', 1)
-        this.$set(this.createTemp, 'workflowNote', '')
-      } else {
-        this.examineTemp = Object.assign({}, row)
-        this.$set(this.examineTemp, 'status', 1)
-        this.$set(this.examineTemp, 'workflowNote', '')
-      }
-      this.dialogStatus = 'examine'
-      this.dialogFormVisible_Examine = true
-      this.statueReason = false
-    },
-    form_examine_save2() {
-      console.log('点击了部门负责人审核', )
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['examineTemp'].validate(valid => {
-        if (valid) {
-
-          //不通过
-          if(this.statueReason){
-            this.examineTemp.status = 2
-             //审核角色
-            this.examineTemp.flowCompeleted = "5"
-          } else {
-            this.examineTemp.status = 0
-            this.examineTemp.flowCompeleted = "4"
-          }
-          this.examineTemp.empid = Cookies.get('employeid')
-
-          var send_data = {
-              "common": {  "returnmap": "0"  },
-              "data": [
-                  {
-                      "name": "EditBigacceptanceDepartment",  "type": "e",
-                      "parammaps": this.examineTemp
-                  }
-              ]
-          }
-          ExecDataByConfig(send_data).then(response => {
-            console.log('审核确认发送参数', send_data)
-            if (response.msg !== 'fail') {
-              this.get_table_data1()
-              this.dialogFormVisible_Examine = false
-              this.statueReason = false
-              this.$notify({
-                title: '成功',
-                message: '审核成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-
-    form_examine3(row) {
-      console.log('点击了场长  审核',row)
-      if (row == undefined) {
-        this.examineTemp = this.createTemp
-        this.$set(this.createTemp, 'status', 1)
-        this.$set(this.createTemp, 'workflowNote', '')
-      } else {
-        this.examineTemp = Object.assign({}, row)
-        this.$set(this.examineTemp, 'status', 1)
-        this.$set(this.examineTemp, 'workflowNote', '')
-      }
-      this.dialogStatus = 'examine'
-      this.dialogFormVisible_Examine = true
-      this.statueReason = false
-    },
-    form_examine_save3() {
-      console.log('点击了场长审核', )
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['examineTemp'].validate(valid => {
-        if (valid) {
-
-          //不通过
-          if(this.statueReason){
-            this.examineTemp.status = 2
-             //审核角色
-            this.examineTemp.flowCompeleted = "7"
-          } else {
-            this.examineTemp.status = 1
-            this.examineTemp.flowCompeleted = "6"
-          }
-          this.examineTemp.empid = Cookies.get('employeid')
-
-          var send_data = {
-              "common": {  "returnmap": "0"  },
-              "data": [
-                  {
-                      "name": "EditBigacceptanceField",  "type": "e",
-                      "parammaps": this.examineTemp
-                  }
-              ]
-          }
-          ExecDataByConfig(send_data).then(response => {
-            console.log('审核确认发送参数', send_data)
-            if (response.msg !== 'fail') {
-              this.get_table_data1()
-              this.dialogFormVisible_Examine = false
-              this.statueReason = false
-              this.$notify({
-                title: '成功',
-                message: '审核成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-    form_submit(row){
-      MessageBox.confirm('确认提交此条信息?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        if(row.isPartapply == 1){
-          var send_data1 = {
-              "name": "checkOutsourcingAmount",
-              "parammaps": { "outsourcingCode":row.outsourcingCode }
-          }
-          var send_data2 = {
-          "common": { "returnmap": "0" },
-          "data": [
-            {
-              "name": "editBigacceptanceIsAcceptance", "type": "e",
-              "parammaps": { "id":row.id }
-             }
-            ]
-          }
-          GetDataByName(send_data1).then(response => {
-            if(parseFloat(response.data.list[0].amount) !== 0){
-              this.save_submit(send_data2)
-            }else{
-              this.$message({
-                type: 'error',
-                message: '数据未填写,请完善相关信息'
-              })
-            }
-          })
-        }else{
-          this.$message({ type: 'warning', message: '备件未领用,暂时不能提交。', duration: 2000 })
-        }
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '已取消提交'
-        })
-      })
-    },
-    save_submit(send_data){
-      ExecDataByConfig(send_data).then(response => {
-        if (response.msg !== 'fail') {
-          this.$notify({ title: '成功', message: '提交成功', type: 'success', duration: 2000 })
-          this.get_table_data1()
-        }
-      })
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-
-  .content{
-    padding: 20px 20px;
-    .title{
-      text-align: center;
-      font-weight: 700;
-    }
-    .title2{
-      float: left;
-      font-weight: 700;
-      padding: 10px 0;
-    }
-  }
-
-</style>
+        this.beforedialog = 'update'
+        this.dialogFormVisible_CollectionSparePartsSee = true
+        this.isCreatePartDelete = true
+        this.listCreateCollectionSpareParts = []
+        this.isPartCode = true
+        this.getCreateLYNumber()
+
+        console.log( "console.log( this.collectionSparePartsSeeTemp)============",this.collectionSparePartsSeeTemp)
+
+
+
+    },
+    // getCreateNumber() {
+    //   // GetDataByName(this.getParmCreateNumber).then(response => {
+    //   //   this.$nextTick(() => {
+    //   //     console.log('新增领用单号', response.data.list[0].orderCode)
+    //   //     this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
+    //   //     this.$forceUpdate()
+    //   //   })
+    //   // })
+    // },
+
+    form_see(row){
+      console.log('查看======》',row)
+      this.reset_create()
+
+      this.getDepartParam2.parammaps.pastureId = row.pastureId
+      this.get_depart_list2()
+
+      if (row.providerId == undefined) {
+        row.providerId = ''
+        row.providerName = ''
+      }
+      this.createTemp = Object.assign({}, row) // copy obj
+      this.dialogStatus = 'see'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['createTemp'].clearValidate()
+      })
+      //委外申请单号获取合同
+      this.getAddContListParam.parammaps.bigId = row.outsourcingId
+      this.getAddContList()
+
+      //牧场
+      if(row.applyType == 0){
+        this.getPramPartApplyListBybig.parammaps.id = row.partapplyId
+        this.getCollectionSpareParts()
+        this.isCreatePartDelete = false
+
+
+
+      }
+      //供应商
+      if(row.applyType == 1){
+        this.getPramAcceptanceList.parammaps.bigId = row.id
+        this.getListAdd2()
+
+
+      }
+
+
+           if (row.flowCompeleted == 1) {
+            this.activeList = [{ title: '委外验收', date: row.createTime, name: row.empname }, { title: '供应处长' }, { title: '部门负责人' },{ title: '场长' }]
+            this.active = 1
+
+          } else if (row.flowCompeleted == 2) {
+            this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人' },{ title: '场长' }]
+            this.active = 2
+          } else if (row.flowCompeleted === 3) {
+            this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName },  { title: '供应处长', date: row.equipmentdate, name: row.equipmentName, status: 'error', reason: row.workflowNote },{ title: '部门负责人' },{ title: '场长' }]
+            this.active = 2
+
+          } else if (row.flowCompeleted === 4) {
+            this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser  },{ title: '场长' }]
+            this.active = 3
+          } else if (row.flowCompeleted === 5) {
+            this.activeList = [{ title: '委外验收', date: row.createTime, name:row.applicantName },  { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser, status: 'error', reason: row.workflowNote   },{ title: '场长' }]
+            this.active = 3
+          } else if (row.flowCompeleted === 6) {
+            this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date:row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser  },{ title: '场长', date:row.fielddate, name:row.fieldName }]
+            this.active = 4
+          } else if (row.flowCompeleted === 7) {
+            this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName },  { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser  },{  title: '场长', date: row.fielddate, name: row.fieldName, status: 'error', reason: row.workflowNote   }]
+            this.active = 4
+           }
+
+
+
+
+    },
+
+    getAddContList() {
+      GetDataByName(this.getAddContListParam).then(response => {
+        this.listAddCont = response.data.list
+        this.listLoading = false
+      })
+    },
+
+
+
+    form_edit(row) {
+      this.reset_create()
+      console.log('编辑',row)
+      this.getDepartParam2.parammaps.pastureId = row.pastureId
+      this.get_depart_list2()
+      if (row.providerId == undefined) {
+        row.providerId = ''
+        row.providerName = ''
+      }
+      this.createTemp = Object.assign({}, row) // copy obj
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['createTemp'].clearValidate()
+      })
+      //委外申请单号获取合同
+      this.getAddContListParam.parammaps.bigId = row.outsourcingId
+      this.getAddContList()
+      this.isData = false
+      //牧场
+      if(row.applyType == 0){
+
+        this.getCollectionSpareParts()
+
+
+
+      }
+      //供应商
+      if(row.applyType == 1){
+        this.getPramAcceptanceList.parammaps.bigId = row.id
+        this.getListAdd2()
+
+
+      }
+    },
+
+    getListAdd() {
+      GetDataByName(this.getPramPartApplyListBybig).then(response => {
+        this.listAdd = response.data.list
+        this.listLoading = false
+      })
+    },
+
+    getListAdd2() {
+      GetDataByName(this.getPramAcceptanceList).then(response => {
+        this.listAdd2 = response.data.list
+        if(this.listAdd2.length>0){
+          this.isData = true
+        }else{
+          this.isData = false
+        }
+        this.listLoading = false
+      })
+    },
+
+    edit_dialog_save() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          this.edit_dialog_saveSave()
+        }
+      })
+    },
+    edit_dialog_saveSave() {
+
+        //牧场
+        if(this.createTemp.applyType == 0){
+          for(let i=0;i<this.listAddCont.length;i++){
+            // if(this.listAddCont[i].sealNumber == ''){
+            //   this.$message({ type: 'warning', message: '请检查铅封号是否未填写', duration: 2000 })
+            //   return false
+            // }
+            // if(this.listAddCont[i].warrantydate == ''){
+            //   this.$message({ type: 'warning', message: '请检查质保日期是否未填写', duration: 2000 })
+            //   return false
+            // }
+          }
+
+
+
+                var send_data = {
+                    "common": { "returnmap": "0"  },
+                    "data": [
+                        {
+                            "name": "editBigacceptanceDate",
+                            "type": "e",
+                            "parammaps": {
+                                "id":this.createTemp.id,
+                                "date":this.createTemp.date,
+                                "applyType":this.createTemp.applyType
+                            }
+                        },
+                        {
+                          "name": "updateBigacceptanceFlowCompeleted", "type": "e",
+                          "parammaps":{
+                            id:this.createTemp.id
+                          }
+                        },
+                        {
+                          "name": "editBigacceptance", "type": "e",
+                          "parammaps":{
+                            id:this.createTemp.id,
+                            lcdate:this.createTemp.lcdate,
+                            hcdate:this.createTemp.hcdate,
+                            remark:this.createTemp.remark
+                          }
+                        },
+                        {
+                          "name": "insertSpotList",
+                          "resultmaps": {  "list": this.listAddCont },
+                          "children": [
+                            {
+                                "name": "editOutsourcingData",  "type": "e",
+                                "parammaps": {
+                                  "id": "@insertSpotList.id",
+                                  "amount": "@insertSpotList.amount",
+                                  "sealNumber": "@insertSpotList.sealNumber",
+                                  "warrantydate": "@insertSpotList.warrantydate"
+                                  }
+                              }
+                          ],
+                        }
+                    ]
+                }
+
+
+          }
+            //供应商
+            if(this.createTemp.applyType == 1){
+
+
+
+              if(this.listAdd2.length == 0){
+                this.$notify({
+                  title: '失败',   message: "备件必选!",
+                  type: 'warning',
+                  duration: 2000
+                })
+                return false
+              }
+              this.listAdd2.map((item, index) => {
+                return item.partId = "0"
+              })
+              this.listAdd2.map((item, index) => {
+                return item.brandId = "0"
+              })
+
+              this.listAdd2.map((item, index) => {
+                return item.providerId = "0"
+              })
+              var myname = ''
+              // var bigId = ''
+              if(this.isData == true){
+                myname = 'editAcceptance'
+                // bigId = "@insertBigacceptance.LastInsertId"
+                // bigId = "@insertSpotList.bigId"
+              }else{
+                myname = 'insertAcceptance'
+                for(let i=0;i<this.listAdd2.length;i++){
+                  this.$set(this.listAdd2[i],'bigId',this.createTemp.id)
+                }
+                // bigId = "@insertSpotList.bigId"
+              }
+              var send_data = {
+                  "common": { "returnmap": "0"  },
+                  "data": [
+                      {
+                          "name": "editBigacceptanceDate",
+                          "type": "e",
+                          "parammaps": {
+                              "id":this.createTemp.id,"date":this.createTemp.date,"applyType":this.createTemp.applyType
+                          }
+                      },
+                      {
+                          "name": "insertSpotList",
+                          "type": "e",
+                          "resultmaps": {
+                              "list": this.listAdd2
+                          },
+                          "children": [
+                              {
+                                  "name": myname,
+                                  "type": "e",
+                                  "parammaps": {
+                                    "id":"@insertSpotList.id",
+                                    "bigId":"@insertSpotList.bigId",
+                                    "partId":"@insertSpotList.partId",
+                                    "partCode":"@insertSpotList.partCode",
+                                    "partName":"@insertSpotList.partName",
+                                    "brandId":"@insertSpotList.brandId",
+                                    "brand":"@insertSpotList.brand",
+                                    "providerId":"@insertSpotList.providerId",
+                                    "providerName":"@insertSpotList.providerName",
+                                    "unit":"@insertSpotList.unit",
+                                    "price":"@insertSpotList.price",
+                                    "remark":"@insertSpotList.remark",
+                                    "specification":"@insertSpotList.specification",
+                                    "amount":"@insertSpotList.amount"
+                                  }
+                              }
+                          ]
+                      },
+                      {
+                        "name": "updateBigacceptanceFlowCompeleted", "type": "e",
+                        "parammaps":{
+                          id:this.createTemp.id
+                        }
+                      },
+                      {
+                        "name": "editBigacceptance", "type": "e",
+                        "parammaps":{
+                          id:this.createTemp.id,
+                          lcdate:this.createTemp.lcdate,
+                          hcdate:this.createTemp.hcdate
+                        }
+                      },
+                      {
+                        "name": "insertSpotList",
+                        "resultmaps": {  "list": this.listAddCont },
+                        "children": [
+                          {
+                              "name": "editOutsourcingData",  "type": "e",
+                              "parammaps": {
+                                "id": "@insertSpotList.id",
+                                "amount": "@insertSpotList.amount",
+                                "sealNumber": "@insertSpotList.sealNumber",
+                                "warrantydate": "@insertSpotList.warrantydate"
+                                }
+                            }
+                        ],
+                      }
+                  ]
+              }
+
+
+
+            }
+
+            ExecDataByConfig(send_data).then(response => {
+            console.log('编辑保存发送参数', send_data)
+            if (response.msg === 'fail') {
+              this.$notify({
+                title: '保存失败',
+                message: response.data,
+                type: 'warning',
+                duration: 2000
+              })
+            } else {
+              this.dialogFormVisible = false
+
+              this.get_table_data1()
+
+              this.$notify({
+                title: '',
+                message: '保存成功',
+                type: 'success',
+                duration: 2000
+              })
+            }
+            })
+
+    },
+
+    form_delete(row) {
+      console.log('点击了删除',row)
+      MessageBox.confirm('确认删除此条信息?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        var send_data = {
+        "common": { "returnmap": "0" },
+        "data": [
+          {
+            "name": "deleteBigacceptance", "type": "e",
+            "parammaps": { "id":row.id }
+           }
+          ]
+        }
+
+        ExecDataByConfig(send_data).then(response => {
+          this.get_table_data1()
+          this.$notify({
+            title: '成功',
+            message: '删除成功',
+            type: 'success',
+            duration: 2000
+          })
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        })
+      })
+    },
+
+
+    change_statue(val) {
+      if (val == 2) {
+        this.statueReason = true
+      } else {
+        this.statueReason = false
+      }
+    },
+
+    form_examine(row) {
+      console.log('点击了供应处长审核',row)
+      if (row == undefined) {
+        this.examineTemp = this.createTemp
+        this.$set(this.createTemp, 'status', 1)
+        this.$set(this.createTemp, 'workflowNote', '')
+      } else {
+        this.examineTemp = Object.assign({}, row)
+        this.$set(this.examineTemp, 'status', 1)
+        this.$set(this.examineTemp, 'workflowNote', '')
+      }
+      this.dialogStatus = 'examine'
+      this.dialogFormVisible_Examine = true
+      this.statueReason = false
+    },
+    form_examine_save() {
+      console.log('点击了供应处长审核', )
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['examineTemp'].validate(valid => {
+        if (valid) {
+
+          //不通过
+          if(this.statueReason){
+            this.examineTemp.status = 2
+             //审核角色
+            this.examineTemp.flowCompeleted = "3"
+          } else {
+            this.examineTemp.status = 0
+            this.examineTemp.flowCompeleted = "2"
+          }
+          this.examineTemp.empid = Cookies.get('employeid')
+
+          var send_data = {
+              "common": {  "returnmap": "0"  },
+              "data": [
+                  {
+                      "name": "EditBigacceptanceEquipment",  "type": "e",
+                      "parammaps": this.examineTemp
+                  }
+              ]
+          }
+          ExecDataByConfig(send_data).then(response => {
+            console.log('审核确认发送参数', send_data)
+            if (response.msg !== 'fail') {
+              this.get_table_data1()
+              this.dialogFormVisible_Examine = false
+              this.statueReason = false
+              this.$notify({
+                title: '成功',
+                message: '审核成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+
+    form_examine2(row) {
+      console.log('点击了部门负责人审核',row)
+      if (row == undefined) {
+        this.examineTemp = this.createTemp
+        this.$set(this.createTemp, 'status', 1)
+        this.$set(this.createTemp, 'workflowNote', '')
+      } else {
+        this.examineTemp = Object.assign({}, row)
+        this.$set(this.examineTemp, 'status', 1)
+        this.$set(this.examineTemp, 'workflowNote', '')
+      }
+      this.dialogStatus = 'examine'
+      this.dialogFormVisible_Examine = true
+      this.statueReason = false
+    },
+    form_examine_save2() {
+      console.log('点击了部门负责人审核', )
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['examineTemp'].validate(valid => {
+        if (valid) {
+
+          //不通过
+          if(this.statueReason){
+            this.examineTemp.status = 2
+             //审核角色
+            this.examineTemp.flowCompeleted = "5"
+          } else {
+            this.examineTemp.status = 0
+            this.examineTemp.flowCompeleted = "4"
+          }
+          this.examineTemp.empid = Cookies.get('employeid')
+
+          var send_data = {
+              "common": {  "returnmap": "0"  },
+              "data": [
+                  {
+                      "name": "EditBigacceptanceDepartment",  "type": "e",
+                      "parammaps": this.examineTemp
+                  }
+              ]
+          }
+          ExecDataByConfig(send_data).then(response => {
+            console.log('审核确认发送参数', send_data)
+            if (response.msg !== 'fail') {
+              this.get_table_data1()
+              this.dialogFormVisible_Examine = false
+              this.statueReason = false
+              this.$notify({
+                title: '成功',
+                message: '审核成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+
+    form_examine3(row) {
+      console.log('点击了场长  审核',row)
+      if (row == undefined) {
+        this.examineTemp = this.createTemp
+        this.$set(this.createTemp, 'status', 1)
+        this.$set(this.createTemp, 'workflowNote', '')
+      } else {
+        this.examineTemp = Object.assign({}, row)
+        this.$set(this.examineTemp, 'status', 1)
+        this.$set(this.examineTemp, 'workflowNote', '')
+      }
+      this.dialogStatus = 'examine'
+      this.dialogFormVisible_Examine = true
+      this.statueReason = false
+    },
+    form_examine_save3() {
+      console.log('点击了场长审核', )
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['examineTemp'].validate(valid => {
+        if (valid) {
+
+          //不通过
+          if(this.statueReason){
+            this.examineTemp.status = 2
+             //审核角色
+            this.examineTemp.flowCompeleted = "7"
+          } else {
+            this.examineTemp.status = 1
+            this.examineTemp.flowCompeleted = "6"
+          }
+          this.examineTemp.empid = Cookies.get('employeid')
+
+          var send_data = {
+              "common": {  "returnmap": "0"  },
+              "data": [
+                  {
+                      "name": "EditBigacceptanceField",  "type": "e",
+                      "parammaps": this.examineTemp
+                  }
+              ]
+          }
+          ExecDataByConfig(send_data).then(response => {
+            console.log('审核确认发送参数', send_data)
+            if (response.msg !== 'fail') {
+              this.get_table_data1()
+              this.dialogFormVisible_Examine = false
+              this.statueReason = false
+              this.$notify({
+                title: '成功',
+                message: '审核成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+    form_submit(row){
+      MessageBox.confirm('确认提交此条信息?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        if(row.isPartapply == 1){
+          var send_data1 = {
+              "name": "checkOutsourcingAmount",
+              "parammaps": { "outsourcingCode":row.outsourcingCode }
+          }
+          var send_data2 = {
+          "common": { "returnmap": "0" },
+          "data": [
+            {
+              "name": "editBigacceptanceIsAcceptance", "type": "e",
+              "parammaps": { "id":row.id }
+             }
+            ]
+          }
+          GetDataByName(send_data1).then(response => {
+            if(parseFloat(response.data.list[0].amount) !== 0){
+              this.save_submit(send_data2)
+            }else{
+              this.$message({
+                type: 'error',
+                message: '数据未填写,请完善相关信息'
+              })
+            }
+          })
+        }else{
+          this.$message({ type: 'warning', message: '备件未领用,暂时不能提交。', duration: 2000 })
+        }
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消提交'
+        })
+      })
+    },
+    save_submit(send_data){
+      ExecDataByConfig(send_data).then(response => {
+        if (response.msg !== 'fail') {
+          this.$notify({ title: '成功', message: '提交成功', type: 'success', duration: 2000 })
+          this.get_table_data1()
+        }
+      })
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+
+  .content{
+    padding: 20px 20px;
+    .title{
+      text-align: center;
+      font-weight: 700;
+    }
+    .title2{
+      float: left;
+      font-weight: 700;
+      padding: 10px 0;
+    }
+  }
+
+</style>

+ 3 - 2
src/views/maintenance/upkeep/index.vue

@@ -501,7 +501,8 @@ export default {
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllEmploye', offset: 0, pagecount: 0, params: [] },
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
 
       temp: {},
@@ -569,7 +570,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list

+ 125 - 125
src/views/maintenance/vehicleRecords/index.vue

@@ -4,7 +4,7 @@
       <el-select v-model="getdataListParm.parammaps.pastureid" placeholder="牧场" class="filter-item" style="width: 110px">
         <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
-      <el-date-picker v-model="getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item"  clearable type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;margin-right: 10px;" />
+      <el-date-picker v-model="getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" clearable type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;margin-right: 10px;" />
       <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
       <el-button class="filter-item" type="success" icon="el-icon-download" @click="handleDownload">导出</el-button>
     </div>
@@ -52,124 +52,124 @@
 </template>
 
 <script>
-  import { GetDataByName,GetDataByNames,getJson, checkButtons } from '@/api/common'
-  import { parseTime } from '@/utils/index.js'
-  import Pagination from '@/components/Pagination' // secondary package based on el-pagination
-  import Cookies from 'js-cookie'
-  export default{
-    name:'VehicleRecords',
-    components: { Pagination },
-    data() {
-      return {
-        myHeight:document.documentElement.clientHeight - 85- 200,
-        buttons:[],
-        listLoading:false,pageNum:0,pageSize:0,total:0,tableKey: 0,
-        list:[],
-        getdataListParm: {
-          page: 1, offset: 1, pagecount: 10, returntype: 'Map',
-          parammaps: {
-            pastureid: parseInt(Cookies.get('pastureid')),
-            inputDatetime:[],
-            startTime:'',
-            stopTime:''
-          }
-        },
+import { GetDataByName, GetDataByNames, getJson, checkButtons } from '@/api/common'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination' // secondary package based on el-pagination
+import Cookies from 'js-cookie'
+export default {
+  name: 'VehicleRecords',
+  components: { Pagination },
+  data() {
+    return {
+      myHeight: document.documentElement.clientHeight - 85 - 200,
+      buttons: [],
+      listLoading: false, pageNum: 0, pageSize: 0, total: 0, tableKey: 0,
+      list: [],
+      getdataListParm: {
+        page: 1, offset: 1, pagecount: 10, returntype: 'Map',
+        parammaps: {
+          pastureid: parseInt(Cookies.get('pastureid')),
+          inputDatetime: [],
+          startTime: '',
+          stopTime: ''
+        }
+      },
 
-        findAllPasture: [],
-        requestParams: [
-          { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        ],
-        rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
-        cellStyle: { padding: 0 + 'px' },
-        isPercentage: false,
-        percentage: 1,
-      }
+      findAllPasture: [],
+      requestParams: [
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
+      ],
+      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      isPercentage: false,
+      percentage: 1
+    }
+  },
+  created() {
+    const that = this
+    GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
+      that.buttons = response.data.list
+      that.get_auto_buttons()
+    })
+    this.get_select_list()
+  },
+  methods: {
+    get_auto_buttons() {
+      // const shengweiwaidan = 'shengweiwaidan'
+      // const isshengweiwaidan = checkButtons(this.buttons, shengweiwaidan)
+      // this.isshengweiwaidan = isshengweiwaidan
     },
-    created() {
-      const that = this
-      GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
-        that.buttons = response.data.list
-        that.get_auto_buttons()
+    get_select_list() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
+        this.get_table_data()
       })
-      this.get_select_list()
-
     },
-    methods:{
-      get_auto_buttons() {
-        // const shengweiwaidan = 'shengweiwaidan'
-        // const isshengweiwaidan = checkButtons(this.buttons, shengweiwaidan)
-        // this.isshengweiwaidan = isshengweiwaidan
-      },
-      get_select_list() {
-        GetDataByNames(this.requestParams).then(response => {
-          this.findAllPasture = response.data.findAllPasture.list
-          this.get_table_data()
-        })
-      },
-      get_table_data(){
-        this.listLoading = true
-        var startTime = ''
-        var stopTime = ''
-        if(this.getdataListParm.parammaps.inputDatetime !== null && this.getdataListParm.parammaps.inputDatetime.length > 0){
-          startTime = parseTime(this.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-          stopTime = parseTime(this.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-        }else{
-          this.getdataListParm.parammaps.inputDatetime = []
-          startTime = ''
-          stopTime = ''
+    get_table_data() {
+      this.listLoading = true
+      var startTime = ''
+      var stopTime = ''
+      if (this.getdataListParm.parammaps.inputDatetime !== null && this.getdataListParm.parammaps.inputDatetime.length > 0) {
+        startTime = parseTime(this.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        stopTime = parseTime(this.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.getdataListParm.parammaps.inputDatetime = []
+        startTime = ''
+        stopTime = ''
+      }
+      const url = 'authdata/vehicleL/list'
+      const data = '?pastureId=' + this.getdataListParm.parammaps.pastureid +
+        '&startTime=' + startTime +
+        '&endTime=' + stopTime +
+        '&offset=' + this.getdataListParm.offset +
+        '&pageCount=' + this.getdataListParm.pagecount
+      getJson(url, data).then(response => {
+        this.list = response.data
+        this.pageNum = response.data.pageNum
+        this.pageSize = response.data.pageSize
+        if (response.data.total) {
+          this.total = response.data.total
         }
-        let url = 'authdata/vehicleL/list'
-        let data = "?pastureId=" + this.getdataListParm.parammaps.pastureid
-        + '&startTime='+ startTime
-        + '&endTime='+ stopTime
-        + '&offset='+ this.getdataListParm.offset
-        + '&pageCount='+ this.getdataListParm.pagecount
-        getJson(url,data).then(response => {
-          this.list = response.data
-          this.pageNum = response.data.pageNum
-          this.pageSize = response.data.pageSize
-          if (response.data.total) {
-            this.total = response.data.total
-          }
-          setTimeout(() => {
-            this.listLoading = false
-          }, 100)
-        })
-      },
-      form_search(){
-        this.get_table_data()
-      },
-      handleDownload() {
-        this.$alert('车辆记录正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
-        this.isPercentage = true
-        this.percentage = 1
-        var timer = setInterval(() => {
-          this.percentage += 5
-          if (this.percentage > 95) {
-            this.percentage = 99
-            clearInterval(timer)
-          }
-          this.percentage = this.percentage
-        }, 1000)
-
-        let url = 'authdata/vehicleL/list'
-        var startTime = ''
-        var stopTime = ''
-        if(this.getdataListParm.parammaps.inputDatetime !== null && this.getdataListParm.parammaps.inputDatetime.length > 0){
-          startTime = parseTime(this.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
-          stopTime = parseTime(this.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
-        }else{
-          this.getdataListParm.parammaps.inputDatetime = []
-          startTime = ''
-          stopTime = ''
+        setTimeout(() => {
+          this.listLoading = false
+        }, 100)
+      })
+    },
+    form_search() {
+      this.get_table_data()
+    },
+    handleDownload() {
+      this.$alert('车辆记录正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
+      this.isPercentage = true
+      this.percentage = 1
+      var timer = setInterval(() => {
+        this.percentage += 5
+        if (this.percentage > 95) {
+          this.percentage = 99
+          clearInterval(timer)
         }
-        let data = "?pastureId=" + this.getdataListParm.parammaps.pastureid
-        + '&startTime='+ startTime
-        + '&endTime='+ stopTime
-        + '&offset='+ this.getdataListParm.offset
-        + '&pageCount='+ 0
-        getJson(url,data).then(response => {
-          this.$nextTick(() => {
+        this.percentage = this.percentage
+      }, 1000)
+
+      const url = 'authdata/vehicleL/list'
+      var startTime = ''
+      var stopTime = ''
+      if (this.getdataListParm.parammaps.inputDatetime !== null && this.getdataListParm.parammaps.inputDatetime.length > 0) {
+        startTime = parseTime(this.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        stopTime = parseTime(this.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.getdataListParm.parammaps.inputDatetime = []
+        startTime = ''
+        stopTime = ''
+      }
+      const data = '?pastureId=' + this.getdataListParm.parammaps.pastureid +
+        '&startTime=' + startTime +
+        '&endTime=' + stopTime +
+        '&offset=' + this.getdataListParm.offset +
+        '&pageCount=' + 0
+      getJson(url, data).then(response => {
+        this.$nextTick(() => {
             import('@/vendor/Export2Excel').then(excel => {
               const list1 = response.data
               if (response.data !== '') {
@@ -180,27 +180,27 @@
               }
 
               const tHeader = [
-                '牧场','日期','设备编码','柳工机号','开机小时(H)','怠速小时(H)','油耗(L)','怠速油耗(H)','平均油耗(L/H)','经度','维度','油位(%)','耗电量','平价耗电量','充电量','充电时长','电动设备状态','电池包 SOC(%)'
+                '牧场', '日期', '设备编码', '柳工机号', '开机小时(H)', '怠速小时(H)', '油耗(L)', '怠速油耗(H)', '平均油耗(L/H)', '经度', '维度', '油位(%)', '耗电量', '平价耗电量', '充电量', '充电时长', '电动设备状态', '电池包 SOC(%)'
               ]
               const filterVal = [
-                'pastureName','dataTime','eqCode','license','workHour','idleHour','fuelConsumption','idleFuel','hoursConsumption','longitude','latitude',
-                'fuelLevel','powerConsumption','hoursPowerConsumption','chargeCapacity','chargeHour','chargeStatus','batteryPackSoc'
+                'pastureName', 'dataTime', 'eqCode', 'license', 'workHour', 'idleHour', 'fuelConsumption', 'idleFuel', 'hoursConsumption', 'longitude', 'latitude',
+                'fuelLevel', 'powerConsumption', 'hoursPowerConsumption', 'chargeCapacity', 'chargeHour', 'chargeStatus', 'batteryPackSoc'
               ]
               const data1 = this.formatJson(filterVal, list1)
               excel.export_json_to_excel({ header: tHeader, data: data1, filename: '车辆记录', autoWidth: true, bookType: 'xlsx' })
             })
-          })
         })
-      },
-      formatJson(filterVal, jsonData) {
-        return jsonData.map(v =>
-          filterVal.map(j => {
-            if (j === 'timestamp') { return parseTime(v[j]) } else { return v[j] }
-          })
-        )
-      }
+      })
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j === 'timestamp') { return parseTime(v[j]) } else { return v[j] }
+        })
+      )
     }
   }
+}
 </script>
 
 <style>

+ 3 - 2
src/views/report/consume/index.vue

@@ -204,7 +204,8 @@ export default {
       findAllDepart: [],
       requestParams: [
         { name: 'findAllDepart', offset: 0, pagecount: 0, params: [this.$store.state.user.pastureid] },
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getdataListParm: {
         name: 'getPartConsume',
@@ -260,7 +261,7 @@ export default {
   methods: {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
       })
     },

+ 154 - 196
src/views/report/energyConsum/index.vue

@@ -8,23 +8,25 @@
       <el-select v-model="tableObj.parammaps.pastureName" placeholder="牧场" style="width: 140px;" class="filter-item" @change="change_pasture1">
         <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.name" />
       </el-select>
-     
-    
-      <el-date-picker v-model="tableObj.parammaps.date" type="monthrange" range-separator="至"
-      start-placeholder="开始月份"
-      end-placeholder="结束月份" style="width:240px;top:-3px;"  />
 
-      
+      <el-date-picker
+        v-model="tableObj.parammaps.date"
+        type="monthrange"
+        range-separator="至"
+        start-placeholder="开始月份"
+        end-placeholder="结束月份"
+        style="width:240px;top:-3px;"
+      />
 
       <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
       <div>
         <el-button v-if="isElecAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
-        <el-button v-if="isElecAdd2" v-waves class="filter-item" type="info" icon="el-icon-tickets"  @click="handleDownloadTemp">模板</el-button>
+        <el-button v-if="isElecAdd2" v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
         <el-button v-if="isElecExport" v-waves class="filter-item" type="success" icon="el-icon-download" @click="form_export">导出</el-button>
         <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
           <el-button v-if="isElecImport" v-waves class="filter-item" type="warning" icon="el-icon-upload2" @click="form_search">导入</el-button>
         </el-upload>
-         
+
       </div>
     </div>
 
@@ -47,12 +49,12 @@
           <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="中心"  min-width="110px" align="center">
+      <el-table-column label="中心" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.center   }}</span>
+          <span>{{ scope.row.center }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="能源消耗统计(牧场)"  min-width="110px" align="center">
+      <el-table-column label="能源消耗统计(牧场)" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.pastureName }}</span>
         </template>
@@ -62,117 +64,116 @@
           <span>{{ scope.row.date }}</span>
         </template>
       </el-table-column>
- 
-      <el-table-column label="全群饲养头日"  min-width="110px" align="center">
+
+      <el-table-column label="全群饲养头日" min-width="110px" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.firstday }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="牧场外购电量(度)"  min-width="110px"align="center">
+      <el-table-column label="牧场外购电量(度)" min-width="110px"align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mcwgdl   }}</span>
+          <span>{{ scope.row.mcwgdl }}</span>
         </template>
       </el-table-column>
       <el-table-column label="沼气发电量(度)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.zqfdl   }}</span>
+          <span>{{ scope.row.zqfdl }}</span>
         </template>
       </el-table-column>
       <el-table-column label="牧场外购水量(吨)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mcwgsl  }}</span>
+          <span>{{ scope.row.mcwgsl }}</span>
         </template>
       </el-table-column>
       <el-table-column label="牧场自备井取水量(吨)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mczbjqsl   }}</span>
+          <span>{{ scope.row.mczbjqsl }}</span>
         </template>
       </el-table-column>
       <el-table-column label="牧场柴油用量(升)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mccyyl  }}</span>
+          <span>{{ scope.row.mccyyl }}</span>
         </template>
       </el-table-column>
       <el-table-column label="牧场煤炭用量(吨)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mcmtyl  }}</span>
+          <span>{{ scope.row.mcmtyl }}</span>
         </template>
       </el-table-column>
       <el-table-column label="生物质颗粒用量(吨)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.swzklyl   }}</span>
+          <span>{{ scope.row.swzklyl }}</span>
         </template>
       </el-table-column>
 
       <el-table-column label="牧场天然气用量(方)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mctrqyl   }}</span>
+          <span>{{ scope.row.mctrqyl }}</span>
         </template>
       </el-table-column>
       <el-table-column label="牧场总用电量(度)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mczydl    }}</span>
+          <span>{{ scope.row.mczydl }}</span>
         </template>
       </el-table-column>
       <el-table-column label="牧场总用水量(吨)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mczysl     }}</span>
+          <span>{{ scope.row.mczysl }}</span>
         </template>
       </el-table-column>
       <el-table-column label="牧场电费单价(元/度)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mcdfdj  }}</span>
+          <span>{{ scope.row.mcdfdj }}</span>
         </template>
       </el-table-column>
       <el-table-column label="牧场水费单价(元/吨)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mcsfdj     }}</span>
+          <span>{{ scope.row.mcsfdj }}</span>
         </template>
       </el-table-column>
 
       <el-table-column label="牧场柴油单价(元/升)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mccydj  }}</span>
+          <span>{{ scope.row.mccydj }}</span>
         </template>
       </el-table-column>
-   
+
       <el-table-column label="牧场煤炭单价(元/吨)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mcmtdj     }}</span>
+          <span>{{ scope.row.mcmtdj }}</span>
         </template>
       </el-table-column>
       <el-table-column label="牧场天然气单价(元/吨)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.mctrqdj      }}</span>
+          <span>{{ scope.row.mctrqdj }}</span>
         </template>
       </el-table-column>
       <el-table-column label="生物质颗粒单价(元/吨)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.swzkldj       }}</span>
+          <span>{{ scope.row.swzkldj }}</span>
         </template>
       </el-table-column>
       <el-table-column label="单头牛用电量(度/头日)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.dtnydl        }}</span>
+          <span>{{ scope.row.dtnydl }}</span>
         </template>
       </el-table-column>
       <el-table-column label="单头牛用水量(吨/头日)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.dtnysl       }}</span>
+          <span>{{ scope.row.dtnysl }}</span>
         </template>
       </el-table-column>
       <el-table-column label="单头牛用油量(升/头日)" min-width="110px" align="center">
         <template slot-scope="scope">
-          <span>{{ scope.row.dtnyyl      }}</span>
+          <span>{{ scope.row.dtnyyl }}</span>
         </template>
       </el-table-column>
- 
-    
+
       </el-table-column>
       <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
         <template slot-scope="{row}">
           <el-button v-if="isElecModify" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
-   
+
           <el-button v-if="isElecModify" size="mini" type="danger" @click="form_delete(row)">删除</el-button>
         </template>
       </el-table-column>
@@ -182,157 +183,148 @@
     <!-- 弹出层新增or修改 -->
     <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
       <el-form ref="temp" :rules="rules" :model="temp" label-position="right" label-width="110px">
-        
+
         <el-row>
-           
+
           <el-col :span="8">
 
-            <el-form-item label="能源消耗统计(牧场):" prop="pastureId" v-show="dialogStatus==='create'">
-                <el-select v-model="temp.pastureId" placeholder="牧场"   class="filter-item" @change="change_pasture2" style="width:100%">
-                  <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
+            <el-form-item v-show="dialogStatus==='create'" label="能源消耗统计(牧场):" prop="pastureId">
+              <el-select v-model="temp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" @change="change_pasture2">
+                <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
 
-            <el-form-item label="能源消耗统计(牧场):" prop="pastureId" v-show="dialogStatus==='update'">
-                <el-input ref="pastureName" v-model="temp.pastureName"  disabled />
+            <el-form-item v-show="dialogStatus==='update'" label="能源消耗统计(牧场):" prop="pastureId">
+              <el-input ref="pastureName" v-model="temp.pastureName" disabled />
             </el-form-item>
 
-
           </el-col>
-          
 
           <el-col :span="8">
             <el-form-item label="录入时间:" prop="date">
-              <el-date-picker v-model="temp.date" type="month" placeholder="录入时间"  style="width:100%;" />
+              <el-date-picker v-model="temp.date" type="month" placeholder="录入时间" style="width:100%;" />
             </el-form-item>
           </el-col>
 
-  
-
           <el-col :span="8">
             <el-form-item label="全群饲养头日:" prop="firstday">
-              <el-input ref="firstday" v-model="temp.firstday" :disabled="dialogStatus==='see'"  />
+              <el-input ref="firstday" v-model="temp.firstday" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
- 
 
-           
-        </el-row>
-        <el-row>
-          
-          
         </el-row>
+        <el-row />
         <el-row>
           <el-col :span="8">
             <el-form-item label="牧场外购电量(度):" prop="mcwgdl">
-              <el-input ref="mcwgdl" v-model="temp.mcwgdl"  :disabled="dialogStatus==='see'" />
+              <el-input ref="mcwgdl" v-model="temp.mcwgdl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="沼气发电量(度):" prop="zqfdl">
-              <el-input ref="zqfdl" v-model="temp.zqfdl"  :disabled="dialogStatus==='see'" />
+              <el-input ref="zqfdl" v-model="temp.zqfdl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="牧场外购水量(吨):" prop="mcwgsl">
-              <el-input ref="mcwgsl" v-model="temp.mcwgsl" :disabled="dialogStatus==='see'"  />
+              <el-input ref="mcwgsl" v-model="temp.mcwgsl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="8">
             <el-form-item label="牧场自备井取水量(度):" prop="mczbjqsl">
-              <el-input ref="mczbjqsl" v-model="temp.mczbjqsl"  :disabled="dialogStatus==='see'" />
+              <el-input ref="mczbjqsl" v-model="temp.mczbjqsl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="牧场柴油用量(升):" prop="mccyyl">
-              <el-input ref="mccyyl" v-model="temp.mccyyl"  :disabled="dialogStatus==='see'" />
+              <el-input ref="mccyyl" v-model="temp.mccyyl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="牧场煤炭用量(吨):" prop="mcmtyl">
-              <el-input ref="mcmtyl" v-model="temp.mcmtyl" :disabled="dialogStatus==='see'"  />
+              <el-input ref="mcmtyl" v-model="temp.mcmtyl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="8">
             <el-form-item label="生物质颗粒用量(吨):" prop="swzklyl">
-              <el-input ref="swzklyl" v-model="temp.swzklyl"  :disabled="dialogStatus==='see'" />
+              <el-input ref="swzklyl" v-model="temp.swzklyl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="牧场天然气用量(方):" prop="mctrqyl">
-              <el-input ref="mctrqyl" v-model="temp.mctrqyl"  :disabled="dialogStatus==='see'" />
+              <el-input ref="mctrqyl" v-model="temp.mctrqyl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="牧场总电量(吨):" prop="mczydl">
-              <el-input ref="mczydl" v-model="temp.mczydl" :disabled="dialogStatus==='see'"  />
+              <el-input ref="mczydl" v-model="temp.mczydl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="8">
             <el-form-item label="牧场总用水量(吨):" prop="mczysl">
-              <el-input ref="mczysl" v-model="temp.mczysl"  :disabled="dialogStatus==='see'" />
+              <el-input ref="mczysl" v-model="temp.mczysl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="牧场电费单价(元/度):" prop="mcdfdj ">
-              <el-input ref="mcdfdj " v-model="temp.mcdfdj "  :disabled="dialogStatus==='see'" />
+              <el-input ref="mcdfdj " v-model="temp.mcdfdj " :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="牧场水费单价(元/吨):" prop="mcsfdj">
-              <el-input ref="mcsfdj" v-model="temp.mcsfdj" :disabled="dialogStatus==='see'"  />
+              <el-input ref="mcsfdj" v-model="temp.mcsfdj" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="8">
             <el-form-item label="牧场柴油单价量(元/升):" prop="mccydj">
-              <el-input ref="mccydj" v-model="temp.mccydj"  :disabled="dialogStatus==='see'" />
+              <el-input ref="mccydj" v-model="temp.mccydj" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="牧场煤炭单价(元/吨):" prop="mcmtdj">
-              <el-input ref="mcmtdj" v-model="temp.mcmtdj"  :disabled="dialogStatus==='see'" />
+              <el-input ref="mcmtdj" v-model="temp.mcmtdj" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="牧场天然气单价(元/方):" prop="mctrqdj">
-              <el-input ref="mctrqdj" v-model="temp.mctrqdj" :disabled="dialogStatus==='see'"  />
+              <el-input ref="mctrqdj" v-model="temp.mctrqdj" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="8">
             <el-form-item label="生物质颗粒单价(元/吨):" prop="swzkldj">
-              <el-input ref="swzkldj" v-model="temp.swzkldj"  :disabled="dialogStatus==='see'" />
+              <el-input ref="swzkldj" v-model="temp.swzkldj" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="单头牛用电量价(度/头日):" prop="dtnydl">
-              <el-input ref="dtnydl" v-model="temp.dtnydl"  :disabled="dialogStatus==='see'" />
+              <el-input ref="dtnydl" v-model="temp.dtnydl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="单头牛用水量价(吨/头日):" prop="dtnysl">
-              <el-input ref="dtnysl" v-model="temp.dtnysl" :disabled="dialogStatus==='see'"  />
+              <el-input ref="dtnysl" v-model="temp.dtnysl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="8">
             <el-form-item label="单头牛用油量(升/头日):" prop="dtnyyl">
-              <el-input ref="dtnyyl" v-model="temp.dtnyyl" :disabled="dialogStatus==='see'"  />
+              <el-input ref="dtnyyl" v-model="temp.dtnyyl" :disabled="dialogStatus==='see'" />
             </el-form-item>
           </el-col>
-          
+
         </el-row>
-         
+
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button v-if="dialogStatus==='create'" ref="createb" type="success" :disabled="isokDisable" @click="add_dialog_save_again()">保存并新增</el-button>
@@ -340,8 +332,7 @@
         <el-button @click="dialogFormVisible = false;get_table_data()">取消并关闭</el-button>
       </div>
     </el-dialog>
-    
-   
+
   </div>
 </template>
 
@@ -374,8 +365,7 @@ export default {
       list: null,
       total: 0,
       listLoading: true,
- 
-   
+
       requestParam: {
         name: 'insertElectricity',
         offset: 0,
@@ -393,7 +383,7 @@ export default {
         pagecount: 10,
         returntype: 'Map',
         parammaps: {
-            pastureName: Cookies.get('pasturename'),  date: '',  startdate: '',  enddate: '',  
+          pastureName: Cookies.get('pasturename'), date: '', startdate: '', enddate: ''
         }
       },
       downLoadObj: {
@@ -403,26 +393,26 @@ export default {
         pagecount: 0,
         returntype: 'Map',
         parammaps: {
-            pastureName: Cookies.get('pasturename'),  date: '',  startdate: '',  enddate: '',  
+          pastureName: Cookies.get('pasturename'), date: '', startdate: '', enddate: ''
         }
       },
-      downLoadList:[],
+      downLoadList: [],
       // 2-3:下拉框请求后数据加入[]
       useTypes: [{ id: 0, name: '1级表' }, { id: 1, name: '2级表' }, { id: 2, name: '3级表' }],
       getDictByName: [],
       findAllAssetType: [],
-     
- 
+
       pastureList: [],
-      departList1:[],
-      departList2:[],
+      departList1: [],
+      departList2: [],
       findAllEmploye: [],
       // 2-1.请求下拉框接口
       requestParams: [
         { name: 'getDictByName', offset: 0, pagecount: 0, params: ['电表类型'] },
         { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam1: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -439,11 +429,11 @@ export default {
         parammaps: { }
       },
 
-      temp: { 
-        "pastureName": '',
-        "pastureId": '',
-        "date": parseTime(new Date(), '{y}-{m}'),
-        "firstday": "","mcwgdl": "","zqfdl": "","mcwgsl": "","mczbjqsl": "","mccyyl": "","mcmtyl": "","swzklyl": "","mctrqyl": "","mczydl": "","mczysl": "","mcdfdj": "0","mcsfdj": "","mccydj": "","mcmtdj": "","mctrqdj": "","swzkldj": "","dtnydl": "","dtnysl": "0","dtnyyl": ""
+      temp: {
+        'pastureName': '',
+        'pastureId': '',
+        'date': parseTime(new Date(), '{y}-{m}'),
+        'firstday': '', 'mcwgdl': '', 'zqfdl': '', 'mcwgsl': '', 'mczbjqsl': '', 'mccyyl': '', 'mcmtyl': '', 'swzklyl': '', 'mctrqyl': '', 'mczydl': '', 'mczysl': '', 'mcdfdj': '0', 'mcsfdj': '', 'mccydj': '', 'mcmtdj': '', 'mctrqdj': '', 'swzkldj': '', 'dtnydl': '', 'dtnysl': '0', 'dtnyyl': ''
       },
       dialogFormVisible: false,
       dialogStatus: '',
@@ -456,14 +446,14 @@ export default {
       dialogFormDosageRecord: false,
       totalDosageRecord: 0,
       listDosageRecord: [],
-    
+
       getDosageRecordListParm: {
         name: 'getBiomassList',
         page: 1,
         offset: 1,
         pagecount: 10,
         returntype: 'Map',
-        parammaps: { "departmentId": ""}
+        parammaps: { 'departmentId': '' }
       },
       dosageRecordTemp: {},
       // 校验规则
@@ -487,10 +477,10 @@ export default {
         //     }
         //   }, 0)
         // }, trigger: 'blur' }],
-      
+
         // startTime: [{ required: true, message: '必填', trigger: 'blur' }]
       },
-    
+
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       buttons: [],
@@ -498,7 +488,7 @@ export default {
       percentage: 1,
       dialogFormDelete: false,
       deleteTemp: {},
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
 
@@ -542,11 +532,11 @@ export default {
     },
     get_auto_buttons() {
       // 新增
-      const ElecAdd = 'energyConsum:add' 
+      const ElecAdd = 'energyConsum:add'
       const isElecAdd = checkButtons(this.$store.state.user.buttons, ElecAdd)
       this.isElecAdd = isElecAdd
 
-      const ElecAdd2 = 'energyConsum:moban' 
+      const ElecAdd2 = 'energyConsum:moban'
       const isElecAdd2 = checkButtons(this.$store.state.user.buttons, ElecAdd2)
       this.isElecAdd2 = isElecAdd2
       // 导出
@@ -579,7 +569,7 @@ export default {
         }
       }, 0)
     },
-   
+
     form_export() {
       this.downLoadObj.parammaps = this.tableObj.parammaps
       GetDataByName(this.downLoadObj).then(response => {
@@ -594,7 +584,7 @@ export default {
             tHeader: [
               '能源消耗统计(牧场)', '月份', '全群饲养头日', '牧场外购电量(度)', '沼气发电量(度)', '牧场外购水量(吨)', '牧场自备井取水量(吨)', '牧场柴油用量(升)', '牧场煤炭用量(吨)', '生物质颗粒用量(吨)', '牧场天然气用量(方)', '牧场总用电量(度)', '牧场总用水量(吨)', '牧场电费单价(元/度)', '牧场水费单价(元/吨)', '牧场柴油单价(元/升)', '牧场煤炭单价(元/吨)', '牧场天然气单价(元/方)', '生物质颗粒单价(元/吨)', '单头牛用电量(度/头日)', '单头牛用水量(吨/头日)', '单头牛用油量(升/头日)'
             ],
-            filterVal: ['pastureName', 'date', 'firstday', 'mcwgdl', 'zqfdl', 'mcwgsl', 'mczbjqsl', 'mccyyl', 'mcmtyl', 'swzklyl', 'mctrqyl', 'mczydl', 'mczysl', 'mcdfdj', 'mcsfdj', 'mccydj', 'mcmtdj', 'mctrqdj', 'swzkldj', 'dtnydl', 'dtnysl', 'dtnyyl'  ],
+            filterVal: ['pastureName', 'date', 'firstday', 'mcwgdl', 'zqfdl', 'mcwgsl', 'mczbjqsl', 'mccyyl', 'mcmtyl', 'swzklyl', 'mctrqyl', 'mczydl', 'mczysl', 'mcdfdj', 'mcsfdj', 'mccydj', 'mcmtdj', 'mctrqdj', 'swzkldj', 'dtnydl', 'dtnysl', 'dtnyyl'],
             tableDatas: this.downLoadList,
             sheetName: 'SheetJS'
           }
@@ -603,9 +593,6 @@ export default {
       })
     },
 
-
-    
-
     formatJson(filterVal, jsonData) {
       return jsonData.map(v =>
         filterVal.map(j => {
@@ -634,35 +621,30 @@ export default {
            import('@/vendor/Export2Excel').then(excel => {
              const list1 = res.data.result
              const tHeader = [
-             '能源消耗统计(牧场)', '月份', '全群饲养头日', '牧场外购电量(度)', '沼气发电量(度)', '牧场外购水量(吨)', '牧场自备井取水量(吨)', '牧场柴油用量(升)', '牧场煤炭用量(吨)', '生物质颗粒用量(吨)', '牧场天然气用量(方)', '牧场总用电量(度)', '牧场总用水量(吨)', '牧场电费单价(元/度)', '牧场水费单价(元/吨)', '牧场柴油单价(元/升)', '牧场煤炭单价(元/吨)', '牧场天然气单价(元/方)', '生物质颗粒单价(元/吨)', '单头牛用电量(度/头日)', '单头牛用水量(吨/头日)', '单头牛用油量(升/头日)'
+               '能源消耗统计(牧场)', '月份', '全群饲养头日', '牧场外购电量(度)', '沼气发电量(度)', '牧场外购水量(吨)', '牧场自备井取水量(吨)', '牧场柴油用量(升)', '牧场煤炭用量(吨)', '生物质颗粒用量(吨)', '牧场天然气用量(方)', '牧场总用电量(度)', '牧场总用水量(吨)', '牧场电费单价(元/度)', '牧场水费单价(元/吨)', '牧场柴油单价(元/升)', '牧场煤炭单价(元/吨)', '牧场天然气单价(元/方)', '生物质颗粒单价(元/吨)', '单头牛用电量(度/头日)', '单头牛用水量(吨/头日)', '单头牛用油量(升/头日)'
              ]
              const filterVal = [
-             '能源消耗统计(牧场)', '月份', '全群饲养头日', '牧场外购电量(度)', '沼气发电量(度)', '牧场外购水量(吨)', '牧场自备井取水量(吨)', '牧场柴油用量(升)', '牧场煤炭用量(吨)', '生物质颗粒用量(吨)', '牧场天然气用量(方)', '牧场总用电量(度)', '牧场总用水量(吨)', '牧场电费单价(元/度)', '牧场水费单价(元/吨)', '牧场柴油单价(元/升)', '牧场煤炭单价(元/吨)', '牧场天然气单价(元/方)', '生物质颗粒单价(元/吨)', '单头牛用电量(度/头日)', '单头牛用水量(吨/头日)', '单头牛用油量(升/头日)', 'error_msg'
+               '能源消耗统计(牧场)', '月份', '全群饲养头日', '牧场外购电量(度)', '沼气发电量(度)', '牧场外购水量(吨)', '牧场自备井取水量(吨)', '牧场柴油用量(升)', '牧场煤炭用量(吨)', '生物质颗粒用量(吨)', '牧场天然气用量(方)', '牧场总用电量(度)', '牧场总用水量(吨)', '牧场电费单价(元/度)', '牧场水费单价(元/吨)', '牧场柴油单价(元/升)', '牧场煤炭单价(元/吨)', '牧场天然气单价(元/方)', '生物质颗粒单价(元/吨)', '单头牛用电量(度/头日)', '单头牛用水量(吨/头日)', '单头牛用油量(升/头日)', 'error_msg'
              ]
              const data1 = this.formatJson(filterVal, list1)
              excel.export_json_to_excel({ header: tHeader, data: data1, filename: '导入报错信息', autoWidth: true, bookType: 'xlsx' })
            })
-
-           
         }
       } else {
         this.$notify({ title: '失败', message: '上传失败', type: 'danger', duration: 2000 })
       }
     },
-   
-  
-   
-  
+
     // 1-1: table&搜索
     get_table_data() {
-      if(this.tableObj.parammaps.pastureName == '现代牧业'){
-        this.tableObj.parammaps.pastureName =''
+      if (this.tableObj.parammaps.pastureName == '现代牧业') {
+        this.tableObj.parammaps.pastureName = ''
       }
       this.listLoading = true
       GetDataByName(this.tableObj).then(response => {
         if (response.data.list == null) {
           this.list = []
-           this.total = 0
+          this.total = 0
         } else {
           this.list = response.data.list
           this.pageNum = response.data.pageNum
@@ -681,13 +663,13 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.getDictByName = response.data.getDictByName.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.pastureList = response.data.findAllPasture.list
+        this.pastureList = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.get_departList1()
         this.get_departList2()
       })
     },
-    
+
     change_pasture1(item) {
       this.getDepartParam1.parammaps.pastureId = this.pastureList.find(obj => obj.name == item).id
       this.tableObj.parammaps.departName = ''
@@ -699,7 +681,6 @@ export default {
       })
     },
 
-
     change_pasture2(item) {
       this.getDepartParam2.parammaps.pastureId = item
       this.temp.departmentId = ''
@@ -714,82 +695,63 @@ export default {
     form_search() {
       this.listLoading = true
       this.tableObj.offset = 1
-      if(this.tableObj.parammaps.date == null || this.tableObj.parammaps.date == ""){
-        this.tableObj.parammaps.date =''
-        this.tableObj.parammaps.startdate =''
-        this.tableObj.parammaps.enddate =''
+      if (this.tableObj.parammaps.date == null || this.tableObj.parammaps.date == '') {
+        this.tableObj.parammaps.date = ''
+        this.tableObj.parammaps.startdate = ''
+        this.tableObj.parammaps.enddate = ''
       } else {
-        this.tableObj.parammaps.startdate =parseTime(this.tableObj.parammaps.date[0], '{y}-{m}')
-        this.tableObj.parammaps.enddate =parseTime(this.tableObj.parammaps.date[1], '{y}-{m}')
-
-        
+        this.tableObj.parammaps.startdate = parseTime(this.tableObj.parammaps.date[0], '{y}-{m}')
+        this.tableObj.parammaps.enddate = parseTime(this.tableObj.parammaps.date[1], '{y}-{m}')
       }
       console.log(this.tableObj.parammaps)
 
- 
-    
       this.get_table_data()
     },
 
-
-    change_emp(item){
+    change_emp(item) {
       console.log('记录人', item)
       this.$set(this.temp, 'inputid', item)
       this.$forceUpdate()
     },
-   
-    form_reset() {
 
-    
- 
-      this.temp = { 
-        "pastureName": '',
-        "pastureId": '',
-        "date": parseTime(new Date(), '{y}-{m}'),
-        "firstday": "","mcwgdl": "","zqfdl": "","mcwgsl": "","mczbjqsl": "","mccyyl": "","mcmtyl": "","swzklyl": "","mctrqyl": "","mczydl": "","mczysl": "","mcdfdj": "","mcsfdj": "","mccydj": "","mcmtdj": "","mctrqdj": "","swzkldj": "","dtnydl": "","dtnysl": "","dtnyyl": ""
+    form_reset() {
+      this.temp = {
+        'pastureName': '',
+        'pastureId': '',
+        'date': parseTime(new Date(), '{y}-{m}'),
+        'firstday': '', 'mcwgdl': '', 'zqfdl': '', 'mcwgsl': '', 'mczbjqsl': '', 'mccyyl': '', 'mcmtyl': '', 'swzklyl': '', 'mctrqyl': '', 'mczydl': '', 'mczysl': '', 'mcdfdj': '', 'mcsfdj': '', 'mccydj': '', 'mcmtdj': '', 'mctrqdj': '', 'swzkldj': '', 'dtnydl': '', 'dtnysl': '', 'dtnyyl': ''
       }
-
-
-      
     },
     form_add() {
       this.form_reset()
       this.dialogStatus = 'create'
       this.dialogFormVisible = true
-       
+
       this.$nextTick(() => {
         this.$refs['temp'].clearValidate()
       })
- 
     },
-   
-    
+
     add_dialog_save() {
-      console.log("this.temp=====>",this.temp)
+      console.log('this.temp=====>', this.temp)
       this.isokDisable = true
       setTimeout(() => {
         this.isokDisable = false
       }, 1000)
       this.$refs['temp'].validate(valid => {
         if (valid) {
-
-
-
-          this.temp.date =   parseTime(this.temp.date, '{y}-{m}') 
+          this.temp.date = parseTime(this.temp.date, '{y}-{m}')
           var send_data = {
-            "common": {  "returnmap": "0"  },
-            "data": [
-               {
-                  "name": "insertEnergy",   "type": "e",
-                  "parammaps": this.temp
-                }
+            'common': { 'returnmap': '0' },
+            'data': [
+              {
+                'name': 'insertEnergy', 'type': 'e',
+                'parammaps': this.temp
+              }
             ]
           }
 
-          
-          
           ExecDataByConfig(send_data).then(response => {
-  
             if (response.msg === 'fail') {
               this.$notify({
                 title: '保存失败',
@@ -819,18 +781,17 @@ export default {
       }, 1000)
       this.$refs['temp'].validate(valid => {
         if (valid) {
-
-          this.temp.date =   parseTime(this.temp.date, '{y}-{m}') 
+          this.temp.date = parseTime(this.temp.date, '{y}-{m}')
           var send_data = {
-            "common": {  "returnmap": "0"  },
-            "data": [
-               {
-                  "name": "insertEnergy",   "type": "e",
-                  "parammaps": this.temp
-                }
+            'common': { 'returnmap': '0' },
+            'data': [
+              {
+                'name': 'insertEnergy', 'type': 'e',
+                'parammaps': this.temp
+              }
             ]
           }
-          
+
           ExecDataByConfig(send_data).then(response => {
             console.log('保存发送参数', this.postDataPramas)
             if (response.msg === 'fail') {
@@ -854,8 +815,7 @@ export default {
       })
     },
     form_edit(row) {
-
-      console.log("row=======",row)
+      console.log('row=======', row)
       this.temp = Object.assign({}, row) // copy obj
       this.dialogStatus = 'update'
       this.dialogFormVisible = true
@@ -866,17 +826,17 @@ export default {
     edit_dialog_save() {
       this.$refs['temp'].validate(valid => {
         if (valid) {
-          this.temp.date =   parseTime(this.temp.date, '{y}-{m}') 
+          this.temp.date = parseTime(this.temp.date, '{y}-{m}')
           var send_data = {
-            "common": {  "returnmap": "0"  },
-            "data": [
-               {
-                  "name": "editEnergyList",   "type": "e",
-                  "parammaps": this.temp
-                }
+            'common': { 'returnmap': '0' },
+            'data': [
+              {
+                'name': 'editEnergyList', 'type': 'e',
+                'parammaps': this.temp
+              }
             ]
           }
-          
+
           ExecDataByConfig(send_data).then(response => {
             if (response.msg === 'fail') {
               this.$notify({
@@ -906,15 +866,14 @@ export default {
         type: 'warning'
       })
         .then(() => {
-          
           var send_data = {
-              "common": {  "returnmap": "0"  },
-              "data": [
-                 {
-                 "name": "deleteEnergy", "type": "e",
-                  "parammaps": { "id":row.id  }
-                 }
-              ]
+            'common': { 'returnmap': '0' },
+            'data': [
+              {
+                'name': 'deleteEnergy', 'type': 'e',
+                'parammaps': { 'id': row.id }
+              }
+            ]
           }
           ExecDataByConfig(send_data).then(() => {
             this.get_table_data()
@@ -933,7 +892,7 @@ export default {
           })
         })
     },
-     
+
     // 导出模板
     handleDownloadTemp() {
       this.requestParam.name = 'pStockDownTemp'
@@ -942,25 +901,24 @@ export default {
           import('@/vendor/Export2Excel').then(excel => {
             const list1 = response.data.list
             const tHeader = [
-            '能源消耗统计(牧场)', '月份', '全群饲养头日', '牧场外购电量(度)', '沼气发电量(度)', '牧场外购水量(吨)', '牧场自备井取水量(吨)', '牧场柴油用量(升)', '牧场煤炭用量(吨)', '生物质颗粒用量(吨)', '牧场天然气用量(方)', '牧场总用电量(度)', '牧场总用水量(吨)', '牧场电费单价(元/度)', '牧场水费单价(元/吨)', '牧场柴油单价(元/升)', '牧场煤炭单价(元/吨)', '牧场天然气单价(元/方)', '生物质颗粒单价(元/吨)', '单头牛用电量(度/头日)', '单头牛用水量(吨/头日)', '单头牛用油量(升/头日)'
+              '能源消耗统计(牧场)', '月份', '全群饲养头日', '牧场外购电量(度)', '沼气发电量(度)', '牧场外购水量(吨)', '牧场自备井取水量(吨)', '牧场柴油用量(升)', '牧场煤炭用量(吨)', '生物质颗粒用量(吨)', '牧场天然气用量(方)', '牧场总用电量(度)', '牧场总用水量(吨)', '牧场电费单价(元/度)', '牧场水费单价(元/吨)', '牧场柴油单价(元/升)', '牧场煤炭单价(元/吨)', '牧场天然气单价(元/方)', '生物质颗粒单价(元/吨)', '单头牛用电量(度/头日)', '单头牛用水量(吨/头日)', '单头牛用油量(升/头日)'
             ]
             const filterVal = [
-            '能源消耗统计(牧场)', '月份', '全群饲养头日', '牧场外购电量(度)', '沼气发电量(度)', '牧场外购水量(吨)', '牧场自备井取水量(吨)', '牧场柴油用量(升)', '牧场煤炭用量(吨)', '生物质颗粒用量(吨)', '牧场天然气用量(方)', '牧场总用电量(度)', '牧场总用水量(吨)', '牧场电费单价(元/度)', '牧场水费单价(元/吨)', '牧场柴油单价(元/升)', '牧场煤炭单价(元/吨)', '牧场天然气单价(元/方)', '生物质颗粒单价(元/吨)', '单头牛用电量(度/头日)', '单头牛用水量(吨/头日)', '单头牛用油量(升/头日)'
+              '能源消耗统计(牧场)', '月份', '全群饲养头日', '牧场外购电量(度)', '沼气发电量(度)', '牧场外购水量(吨)', '牧场自备井取水量(吨)', '牧场柴油用量(升)', '牧场煤炭用量(吨)', '生物质颗粒用量(吨)', '牧场天然气用量(方)', '牧场总用电量(度)', '牧场总用水量(吨)', '牧场电费单价(元/度)', '牧场水费单价(元/吨)', '牧场柴油单价(元/升)', '牧场煤炭单价(元/吨)', '牧场天然气单价(元/方)', '生物质颗粒单价(元/吨)', '单头牛用电量(度/头日)', '单头牛用水量(吨/头日)', '单头牛用油量(升/头日)'
             ]
             const data1 = this.formatJson(filterVal, list1)
             excel.export_json_to_excel({
               header: tHeader,
               data: data1,
               filename: '模板',
-          
+
               autoWidth: true,
               bookType: 'xlsx'
             })
           })
         })
       })
-    },
-  
+    }
 
   }
 }

+ 3 - 2
src/views/report/farmEquipment/index.vue

@@ -342,7 +342,8 @@ export default {
       },
       findAllPasture: [],
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       yearDate: new Date(),
       month: '',
@@ -600,7 +601,7 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
       })
     },
     changePastureName(item) {

+ 3 - 3
src/views/report/inventorySpareParts/index.vue

@@ -23,8 +23,8 @@
         :row-style="rowStyle"
         :cell-style="cellStyle"
         class="elTable table-fixed"
-        @sort-change="tableSort"
         :max-height="myHeight"
+        @sort-change="tableSort"
       >
         <el-table-column label="序号" align="center" type="index" width="50px">
           <template slot-scope="scope">
@@ -88,7 +88,7 @@ export default {
       downLoadList: [],
       isPercentage: false,
       percentage: 1,
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
   created() {
@@ -101,7 +101,7 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
       })
     },
     get_table_data() {

+ 12 - 11
src/views/report/inventorySummary/index.vue

@@ -5,7 +5,7 @@
       <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
     </div>
     <div class="filter-container">
-      <el-date-picker v-model="monthDate" type="monthrange" :clearable="false" range-separator="至" start-placeholder="开始月份" class="filter-item" end-placeholder="结束月份"  @change="changeTime" />
+      <el-date-picker v-model="monthDate" type="monthrange" :clearable="false" range-separator="至" start-placeholder="开始月份" class="filter-item" end-placeholder="结束月份" @change="changeTime" />
       <el-select v-model="isZeroStock" placeholder="是否零库存" class="filter-item" style="width: 120px;" @change="changeIsZeroStock">
         <el-option v-for="item in isZeroStockList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
@@ -24,8 +24,8 @@
         :row-style="rowStyle"
         class="elTable"
         :cell-style="tableCellStyle"
-        @sort-change="tableSort"
         :max-height="myHeight"
+        @sort-change="tableSort"
       >
         <el-table-column label="序号" align="center" type="index" width="50px">
           <template slot-scope="scope">
@@ -117,14 +117,15 @@ export default {
   directives: { waves },
   data() {
     return {
-      monthDate:[parseTime(new Date(), '{y}-{m}'), parseTime(new Date(), '{y}-{m}')],
-      isZeroStock:0,
-      isZeroStockList:[{id:0,'name':'非零库存'},{id:1,'name':'零库存'}],
+      monthDate: [parseTime(new Date(), '{y}-{m}'), parseTime(new Date(), '{y}-{m}')],
+      isZeroStock: 0,
+      isZeroStockList: [{ id: 0, 'name': '非零库存' }, { id: 1, 'name': '零库存' }],
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       types: [{ id: 0, name: '按供应商' }, { id: 1, name: '按备件类别' }],
       findAllPasture: [],
-      requestParams: [{ name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}],
+      requestParams: [{ name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}],
       tableKey: 0,
       list: [],
       total: 0,
@@ -177,7 +178,7 @@ export default {
           }
         }
       },
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
 
@@ -198,7 +199,7 @@ export default {
 
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
       })
     },
     changeTime() {
@@ -213,7 +214,7 @@ export default {
       }
       this.get_table_data()
     },
-    changeIsZeroStock(item){
+    changeIsZeroStock(item) {
       this.get_table_data()
     },
     get_table_data() {
@@ -320,8 +321,8 @@ export default {
             console.log('导出table数据', this.downLoadList)
             const ExcelDatas = [
               {
-                tHeader:['牧场','库存标准','实际库存','差异','出库金额'	,'期初库存'	,'期末库存' ,'库存周转率'],
-                filterVal: ['pastureName', 'standard', 'psCountje', 'differentje', 'ckje', 'earlymonth','endofmonthje','rateofturnover'],
+                tHeader: ['牧场', '库存标准', '实际库存', '差异', '出库金额', '期初库存', '期末库存', '库存周转率'],
+                filterVal: ['pastureName', 'standard', 'psCountje', 'differentje', 'ckje', 'earlymonth', 'endofmonthje', 'rateofturnover'],
 
                 // tHeader: ['牧场', '供应商', '备件总数量', '总金额'],
                 // filterVal: ['pastureName', 'providerName', 'psCount', 'psSum'],

+ 4 - 4
src/views/report/inventorySummary/index1.vue

@@ -26,8 +26,8 @@
         :row-style="rowStyle"
         class="elTable"
         :cell-style="tableCellStyle"
-        @sort-change="tableSort"
         :max-height="myHeight"
+        @sort-change="tableSort"
       >
         <el-table-column label="序号" align="center" type="index" width="50px">
           <template slot-scope="scope">
@@ -73,8 +73,8 @@
         style="width: 100%;"
         :row-style="rowStyle"
         class="elTable"
-        @sort-change="tableSort2"
         :max-height="myHeight"
+        @sort-change="tableSort2"
       >
         <el-table-column label="序号" align="center" type="index" width="50px">
           <template slot-scope="scope">
@@ -170,7 +170,7 @@ export default {
           }
         }
       },
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
 
@@ -191,7 +191,7 @@ export default {
 
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
       })
     },
     get_table_data() {

+ 11 - 15
src/views/report/inventoryTurnover/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
- 
+
     <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
       <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
       <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
@@ -31,18 +31,18 @@
             <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
           </template>
         </el-table-column>
-     
+
         <el-table-column label="牧场" prop="name" min-width="130px" align="center" />
         <el-table-column label="月份" sortable prop="date" align="center" min-width="150px" />
-       
+
         <el-table-column label="库存周转率" min-width="130px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.rateofturnover }}</span><br>
           </template>
         </el-table-column>
-        <el-table-column label="期初"   prop="earlymonthje" align="center" min-width="150px" />
-        <el-table-column label="期末"   prop="endofmonthje" align="center" min-width="150px" />
-   
+        <el-table-column label="期初" prop="earlymonthje" align="center" min-width="150px" />
+        <el-table-column label="期末" prop="endofmonthje" align="center" min-width="150px" />
+
       </el-table>
       <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
     </div>
@@ -67,7 +67,8 @@ export default {
       rules: {},
       findAllPasture: [],
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getdataListParm: {
         name: 'getRateOfTurnover',
@@ -100,7 +101,7 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
       })
     },
     get_table_data() {
@@ -150,18 +151,13 @@ export default {
           }, 2000)
         }
 
-
-       
-  
-
-
         this.$nextTick(() => {
           this.downLoadList = response.data.list
           console.log(this.downLoadList)
           const ExcelDatas = [
             {
-              tHeader: ['月份', '月份', '库存周转率', '期初', '期末' ],
-              filterVal: ['name', 'date', 'rateofturnover', 'earlymonthje', 'endofmonthje' ],
+              tHeader: ['月份', '月份', '库存周转率', '期初', '期末'],
+              filterVal: ['name', 'date', 'rateofturnover', 'earlymonthje', 'endofmonthje'],
               tableDatas: this.downLoadList,
               sheetName: '库存周转率报表'
             }

+ 15 - 18
src/views/report/maintenanceCategoryAnalysis/index.vue

@@ -35,8 +35,8 @@
         :row-style="rowStyle"
         :cell-style="tableCellStyle"
         class="elTable table-fixed"
-        @sort-change="tableSort1"
         :max-height="myHeight"
+        @sort-change="tableSort1"
       >
         <el-table-column label="序号" align="center" type="index" width="50px">
           <template slot-scope="scope">
@@ -86,8 +86,8 @@
           :row-style="rowStyle"
           :cell-style="tableCellStyle2"
           class="elTable table-fixed"
-          @sort-change="tableSort2"
           :max-height="350"
+          @sort-change="tableSort2"
         >
           <el-table-column label="序号" align="center" type="index" width="50px" />
           <el-table-column label="牧场" min-width="130px" align="center">
@@ -135,8 +135,8 @@
           :row-style="rowStyle"
           :cell-style="cellStyle"
           class="elTable table-fixed"
-          @sort-change="tableSort3"
           :max-height="350"
+          @sort-change="tableSort3"
         >
           <el-table-column label="序号" align="center" type="index" width="50px">
             <template slot-scope="scope">
@@ -204,8 +204,8 @@ export default {
             year: parseTime(new Date(), '{y}'),
             month: parseTime(new Date(), '{m}'),
             eqClassName: '',
-            PastureName:  '',
-            DepartmentName: '',
+            PastureName: '',
+            DepartmentName: ''
           }
         },
         getBarChartParm: {
@@ -238,7 +238,7 @@ export default {
           parammaps: {
             year: '',
             month: '',
-            eqClassName: '',
+            eqClassName: ''
           }
         },
         getBarChartParm: {
@@ -247,8 +247,8 @@ export default {
             receiveTime: '2021-03',
             pastureName: Cookies.get('pasturename'),
             deptName: '牧场办公室',
-            PastureName:  '',
-            DepartmentName: '',
+            PastureName: '',
+            DepartmentName: ''
           }
         },
         barChart: null,
@@ -293,7 +293,7 @@ export default {
       getPastureidParm: { name: 'getPastureid' },
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 200
+      myHeight: document.documentElement.clientHeight - 85 - 200
     }
   },
   watch: {
@@ -312,8 +312,8 @@ export default {
     }
   },
   created() {
-   // this.getPastureid()
-   this.get_select_list()
+    // this.getPastureid()
+    this.get_select_list()
     this.get_table_data()
   },
   mounted() {
@@ -339,7 +339,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         this.equipmentCategoryList = response.data.geteqclasslistSection.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart3.list
       })
     },
@@ -365,7 +365,7 @@ export default {
         if (this.table.get_table_dataParm.PastureName.length > 0 && this.table.get_table_dataParm.DepartmentName.length > 0) {
           console.log(this.table.get_table_dataParm.PastureName)
           this.table.get_table_dataParm.DepartmentName = []
-          this.table.get_table_dataParm.parammaps.DepartmentName = ""
+          this.table.get_table_dataParm.parammaps.DepartmentName = ''
           this.checkPasture = '1'
           this.checkDepartment = ''
         } else if (this.table.get_table_dataParm.PastureName.length > 0 && this.table.get_table_dataParm.DepartmentName.length == 0) {
@@ -532,11 +532,8 @@ export default {
     get_table_data() {
       this.table.listLoading = true
 
-
-      this.table.get_table_dataParm.parammaps.PastureName =  this.table.get_table_dataParm.PastureName.join()
-      this.table.get_table_dataParm.parammaps.DepartmentName =  this.table.get_table_dataParm.DepartmentName.join()
-
-
+      this.table.get_table_dataParm.parammaps.PastureName = this.table.get_table_dataParm.PastureName.join()
+      this.table.get_table_dataParm.parammaps.DepartmentName = this.table.get_table_dataParm.DepartmentName.join()
 
       GetDataByName(this.table.get_table_dataParm).then(response => {
         if (response.data.list !== null) {

+ 53 - 60
src/views/report/maintenanceCycle/index.vue

@@ -5,7 +5,7 @@
       <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
     </div>
     <div class="filter-container">
-      <el-select   v-model="table.getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;">
+      <el-select v-model="table.getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;">
         <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
       </el-select>
       <el-date-picker
@@ -22,7 +22,8 @@
         end-placeholder="结束时间"
       />
       <el-input v-model="table.getdataListParm.parammaps.BXname" placeholder="报修人" style="width: 200px;" class="filter-item" />
-      <el-date-picker v-if="tableIputShow1"
+      <el-date-picker
+        v-if="tableIputShow1"
         ref="BXinputDatetime"
         v-model="table.getdataListParm.parammaps.BXinputDatetime"
         class="inputDatetime"
@@ -34,7 +35,8 @@
         start-placeholder="报修开始时间"
         end-placeholder="报修结束时间"
       />
-      <el-date-picker v-if="tableIputShow1"
+      <el-date-picker
+        v-if="tableIputShow1"
         ref="JDinputDatetime"
         v-model="table.getdataListParm.parammaps.JDinputDatetime"
         class="inputDatetime"
@@ -46,7 +48,8 @@
         start-placeholder="接单开始时间"
         end-placeholder="接单结束时间"
       />
-      <el-date-picker v-if="tableIputShow1"
+      <el-date-picker
+        v-if="tableIputShow1"
         ref="useSHinputDatetime"
         v-model="table.getdataListParm.parammaps.useSHinputDatetime"
         class="inputDatetime"
@@ -62,7 +65,8 @@
       <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
       <el-button class="filter-item" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
     </div>
-    <el-table v-if="tableShow1"
+    <el-table
+      v-if="tableShow1"
       :key="table.tableKey"
       v-loading="table.listLoading"
       element-loading-text="给我一点时间"
@@ -99,7 +103,8 @@
     <pagination v-if="tableShow1" v-show="table.total>0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="get_table_data" />
 
     <!-- 等后端接口  -->
-    <el-table v-if="tableShow2"
+    <el-table
+      v-if="tableShow2"
       :key="table2.tableKey"
       v-loading="table2.listLoading"
       element-loading-text="给我一点时间"
@@ -114,14 +119,14 @@
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
-          <span>{{ scope.$index  + 1 }}</span>
+          <span>{{ scope.$index + 1 }}</span>
         </template>
       </el-table-column>
       <el-table-column label="牧场" min-width="90px" align="center" prop="pastureName" />
 
       <el-table-column label="设备名称" min-width="90px" align="center" prop="eqClassName" />
       <el-table-column label="维修次数" min-width="90px" align="center" prop="count" />
-      <el-table-column label="平均维修时间(MTTR)" min-width="70px"  sortable align="center" prop="mttr" />
+      <el-table-column label="平均维修时间(MTTR)" min-width="70px" sortable align="center" prop="mttr" />
       <el-table-column label="无故障时间(MTTF)" min-width="90px" sortable align="center" prop="mttf" />
       <el-table-column label="平均故障间隔时间(MTBF)" min-width="90px" sortable align="center" prop="mtbf" />
     </el-table>
@@ -133,7 +138,7 @@
 <script>
 import waves from '@/directive/waves' // waves directive
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination
-import { GetDataByName, GetDataByNames,postJson} from '@/api/common'
+import { GetDataByName, GetDataByNames, postJson } from '@/api/common'
 import { parseTime, json2excel } from '@/utils/index.js'
 import Cookies from 'js-cookie'
 export default {
@@ -144,9 +149,9 @@ export default {
     return {
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
-      tableIputShow1:true,
-      tableShow1:true,
-      tableShow2:false,
+      tableIputShow1: true,
+      tableShow1: true,
+      tableShow2: false,
       table: {
         tableKey: 0,
         list: [],
@@ -156,7 +161,7 @@ export default {
           name: 'getAlleqWX',
           page: 1, offset: 1, pagecount: 10, returntype: 'Map',
           parammaps: {
-            BXname:'',
+            BXname: '',
             BXinputDatetime: '', SGTimeStart: '', SGTimeEnd: '',
             JDinputDatetime: '', JDTimeStart: '', JDTimeEnd: '',
             useSHinputDatetime: '', useSHTimeStart: '', useSHTimeEnd: '',
@@ -166,26 +171,26 @@ export default {
       },
       selectData: '',
       pickerMinDate: '',
-      pickerRange:3600 * 1000 * 24 * 365,
+      pickerRange: 3600 * 1000 * 24 * 365,
       pickerOptions: {
-        onPick:({maxDate,minDate }) => {
+        onPick: ({ maxDate, minDate }) => {
           if (minDate && this.pickerMinDate) {
             this.pickerMinDate = null
           } else if (minDate) {
             this.pickerMinDate = minDate.getTime()
           }
-       },
+        },
         disabledDate: (time) => {
           if (this.pickerMinDate) {
-              return (time.getTime() > (this.pickerMinDate + this.pickerRange))  ||(time.getTime() < (this.pickerMinDate - this.pickerRange))
+            return (time.getTime() > (this.pickerMinDate + this.pickerRange)) || (time.getTime() < (this.pickerMinDate - this.pickerRange))
           }
-        return false
-        },
+          return false
+        }
       },
       table2: {
         tableKey: 0,
         list: [
-          {id:1}
+          { id: 1 }
         ],
         total: 0,
         listLoading: false,
@@ -193,17 +198,16 @@ export default {
           name: 'maintain',
           page: 1, offset: 1, pagecount: 10, returntype: 'Map',
           parammaps: {
-            eqClassId:'',
+            eqClassId: '',
             pastureName: Cookies.get('pasturename'),
-             startTime: parseTime(new Date(), '{y}-{m}-{d}'),
-            endTime: parseTime(new Date(), '{y}-{m}-{d}'),
-            inputDatetime2: [ parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')],
-            pastureId: "",
+            startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+            endTime: parseTime(new Date(), '{y}-{m}-{d}'),
+            inputDatetime2: [parseTime(new Date(), '{y}-{m}-{d}'), parseTime(new Date(), '{y}-{m}-{d}')],
+            pastureId: ''
           }
         }
       },
 
-
       downLoadParm: {},
       downLoadList: [],
       isPercentage: false,
@@ -211,14 +215,13 @@ export default {
       findAllPasture: [],
       requestParams: [
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'getEqClassBengbu', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'getEqClassBengbu', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
-      myHeight:document.documentElement.clientHeight - 85- 200
+      myHeight: document.documentElement.clientHeight - 85 - 200
     }
   },
 
-
-
   created() {
     this.get_select_list()
     this.get_table_data()
@@ -228,7 +231,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         if (response.data.list !== null) {
-          this.findAllPasture = response.data.findAllPasture.list
+          this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         }
       })
     },
@@ -268,32 +271,26 @@ export default {
 
     get_table_data2() {
       this.table2.listLoading = true
-          let url = "authdata/maintain"
-          let data = this.table2.getdataListParm.parammaps
-
-          postJson(url,data).then(response => {
-            console.log('table数据', response.data.list)
-              if (response.data.length !== 0) {
-                this.table2.list = response.data
-
-              } else {
-                this.table2.list = []
-
-              }
-
-              setTimeout(() => {
-                this.table2.listLoading = false
-              }, 100)
-          })
+      const url = 'authdata/maintain'
+      const data = this.table2.getdataListParm.parammaps
 
+      postJson(url, data).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.length !== 0) {
+          this.table2.list = response.data
+        } else {
+          this.table2.list = []
+        }
 
+        setTimeout(() => {
+          this.table2.listLoading = false
+        }, 100)
+      })
     },
     form_search() {
       this.table.listLoading = true
       this.table.getdataListParm.offset = 1
 
-
-
       if (this.table.getdataListParm.parammaps.BXinputDatetime !== [] && this.table.getdataListParm.parammaps.BXinputDatetime !== '' && this.table.getdataListParm.parammaps.BXinputDatetime !== null) {
         if (this.table.getdataListParm.parammaps.BXinputDatetime.length !== 0) {
           this.table.getdataListParm.parammaps.BXTimeStart = parseTime(this.table.getdataListParm.parammaps.BXinputDatetime[0], '{y}-{m}-{d}')
@@ -324,8 +321,7 @@ export default {
         this.table.getdataListParm.parammaps.useSHTimeStart = ''
         this.table.getdataListParm.parammaps.useSHTimeEnd = ''
       }
-      //this.get_table_data()
-
+      // this.get_table_data()
 
       if (this.table2.getdataListParm.parammaps.inputDatetime2 !== [] && this.table2.getdataListParm.parammaps.inputDatetime2 !== '' && this.table2.getdataListParm.parammaps.inputDatetime2 !== null) {
         if (this.table2.getdataListParm.parammaps.inputDatetime2.length !== 0) {
@@ -338,13 +334,12 @@ export default {
         this.table2.getdataListParm.parammaps.endTime = ''
       }
 
-
       this.table2.getdataListParm.parammaps.pastureName = this.table.getdataListParm.parammaps.pastureName
 
-      //选了类别,就执行第二个表格
-      //等后端接口
+      // 选了类别,就执行第二个表格
+      // 等后端接口
       console.log(this.table2.getdataListParm.parammaps.eqClassId)
-      if(this.table2.getdataListParm.parammaps.eqClassId != ""){
+      if (this.table2.getdataListParm.parammaps.eqClassId != '') {
         this.tableShow2 = true
         this.tableShow1 = false
         this.tableIputShow1 = false
@@ -355,10 +350,8 @@ export default {
         this.tableIputShow1 = true
         this.get_table_data()
       }
-
     },
 
-    
     handleDownload() {
       this.$alert('维修周期效率统计正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
       this.isPercentage = true
@@ -387,8 +380,8 @@ export default {
           this.downLoadParm.list = response.data.list
           var excelDatas = [
             {
-              tHeader: ['牧场', '单号', '设备类别', '设备名称', '设备内部编号', '报修日期', '接单间隔', '接单日期', '维修人',  '总维修时长', '完成维修日期', '确认间隔', '使用人确认时间'],
-              filterVal: ['pastureName', 'repairCode', 'eqClassName', 'eqName', 'eqCode', 'BXTime', 'BxAndJd', 'JDTime', 'pickname',  'WxAndJS', 'JSTime', 'JSAnduseSH', 'useSHTime'],
+              tHeader: ['牧场', '单号', '设备类别', '设备名称', '设备内部编号', '报修日期', '接单间隔', '接单日期', '维修人', '总维修时长', '完成维修日期', '确认间隔', '使用人确认时间'],
+              filterVal: ['pastureName', 'repairCode', 'eqClassName', 'eqName', 'eqCode', 'BXTime', 'BxAndJd', 'JDTime', 'pickname', 'WxAndJS', 'JSTime', 'JSAnduseSH', 'useSHTime'],
               tableDatas: this.downLoadParm.list,
               sheetName: 'Sheet'
             }

+ 3 - 2
src/views/report/maintenanceCycle/index1.vue

@@ -121,7 +121,8 @@ export default {
       percentage: 1,
       findAllPasture: [],
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ]
     }
   },
@@ -135,7 +136,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         if (response.data.list !== null) {
-          this.findAllPasture = response.data.findAllPasture.list
+          this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         }
       })
     },

+ 77 - 87
src/views/report/maintenanceFault/index.vue

@@ -5,17 +5,30 @@
       <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
     </div>
     <div class="filter-container">
-      <el-select  v-if="isPasture || isType3" v-model="tableObj.getdataListParm.parammaps.pastureName" placeholder="牧场" style="width: 140px;" class="filter-item" >
+      <el-select v-if="isPasture || isType3" v-model="tableObj.getdataListParm.parammaps.pastureName" placeholder="牧场" style="width: 140px;" class="filter-item">
         <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.name" />
       </el-select>
-      <el-select  v-if="isPasture || isType" v-model="tableObj.getdataListParm.parammaps.eqClassId" placeholder="设备类别" style="width: 140px;" class="filter-item" clearable>
+      <el-select v-if="isPasture || isType" v-model="tableObj.getdataListParm.parammaps.eqClassId" placeholder="设备类别" style="width: 140px;" class="filter-item" clearable>
         <el-option v-for="item in eqClassList" :key="item.id" :label="item.remark" :value="item.id" />
       </el-select>
-      <el-select  v-if=" isType3" v-model="tableObj.getdataListParm.parammaps.eqClassId" placeholder="设备类别" style="width: 140px;" class="filter-item" clearable>
+      <el-select v-if=" isType3" v-model="tableObj.getdataListParm.parammaps.eqClassId" placeholder="设备类别" style="width: 140px;" class="filter-item" clearable>
         <el-option v-for="item in eqClassList3" :key="item.id" :label="item.remark" :value="item.id" />
       </el-select>
-      <el-date-picker v-if="isPasture" ref="inputDatetime" v-model="tableObj.getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 280px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" />
-      <el-input  v-if="isType2" v-model="tableObj.getdataListParm.parammaps.eqName" placeholder="设备名称" style="width: 200px;" class="filter-item" />
+      <el-date-picker
+        v-if="isPasture"
+        ref="inputDatetime"
+        v-model="tableObj.getdataListParm.parammaps.inputDatetime"
+        class="inputDatetime"
+        type="datetimerange"
+        style="width: 280px;top:-3px;"
+        format="yyyy-MM-dd"
+        value-format="yyyy-MM-dd"
+        range-separator="至"
+start-placeholder="开始日期"
+        end-placeholder="结束日期"
+        :clearable="false"
+      />
+      <el-input v-if="isType2" v-model="tableObj.getdataListParm.parammaps.eqName" placeholder="设备名称" style="width: 200px;" class="filter-item" />
       <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
       <el-button class="filter-item" type="success" icon="el-icon-upload2" @click="form_export">导出</el-button>
     </div>
@@ -34,8 +47,8 @@
       :row-style="rowStyle"
       :cell-style="tableCellStyle"
       class="elTable"
-      @sort-change="tableSort1"
       :max-height="myHeight"
+      @sort-change="tableSort1"
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
@@ -47,56 +60,55 @@
           <a @click="table_click1(row)">{{ row.pastureName }}</a>
         </template>
       </el-table-column>
-      <el-table-column  v-if="isPasture" :key="5" label="设备二级分类名称" sortable min-width="140px" align="center">
+      <el-table-column v-if="isPasture" :key="5" label="设备二级分类名称" sortable min-width="140px" align="center">
         <template slot-scope="{row}">
-          <a @click="table_click4(row)" style="text-decoration: underline;">{{ row.eqClassName }}</a>
+          <a style="text-decoration: underline;" @click="table_click4(row)">{{ row.eqClassName }}</a>
         </template>
       </el-table-column>
-      <el-table-column  v-if="isType" :key="5" label="设备三级分类名称"  sortable min-width="140px" align="center">
+      <el-table-column v-if="isType" :key="5" label="设备三级分类名称" sortable min-width="140px" align="center">
         <template slot-scope="{row}">
           <a @click="table_click2(row)">{{ row.eqClassName }}</a>
         </template>
       </el-table-column>
-      <el-table-column  v-if="isType2" label="设备名称" sortable min-width="140px" align="center">
+      <el-table-column v-if="isType2" label="设备名称" sortable min-width="140px" align="center">
         <template slot-scope="{row}">
           <span>{{ row.eqName }}</span>
         </template>
       </el-table-column>
-      <el-table-column  v-if="isType2" label="设备内部编号" sortable min-width="140px" align="center">
+      <el-table-column v-if="isType2" label="设备内部编号" sortable min-width="140px" align="center">
         <template slot-scope="{row}">
           <span>{{ row.eqCode }}</span>
         </template>
       </el-table-column>
 
-      <el-table-column  v-if="isType3" :key="5" label="牧场"  sortable min-width="140px" align="center" prop="pastureName" />
-      <el-table-column  v-if="isType3" :key="5" label="设备三级分类名称"  sortable min-width="140px" align="center">
+      <el-table-column v-if="isType3" :key="5" label="牧场" sortable min-width="140px" align="center" prop="pastureName" />
+      <el-table-column v-if="isType3" :key="5" label="设备三级分类名称" sortable min-width="140px" align="center">
         <template slot-scope="{row}">
           <span>{{ row.eqClassName }}</span>
         </template>
       </el-table-column>
 
-      <el-table-column   :key="6" label="维修次数" sortable min-width="140px" align="center">
+      <el-table-column :key="6" label="维修次数" sortable min-width="140px" align="center">
         <template slot-scope="{row}">
           <span>{{ row.count }}</span>
         </template>
       </el-table-column>
-      <el-table-column   :key="7" label="平均维修时间/h(MTTR)" sortable min-width="140px" align="center">
+      <el-table-column :key="7" label="平均维修时间/h(MTTR)" sortable min-width="140px" align="center">
         <template slot-scope="{row}">
           <span>{{ row.mttr }}</span>
         </template>
       </el-table-column>
-      <el-table-column   :key="8" label="无故障时间/h(MTTF)" sortable min-width="140px" align="center">
+      <el-table-column :key="8" label="无故障时间/h(MTTF)" sortable min-width="140px" align="center">
         <template slot-scope="{row}">
           <span>{{ row.mttf }}</span>
         </template>
       </el-table-column>
-      <el-table-column   :key="9" label="平均故障间隔时间/h(MTBF)" sortable min-width="140px" align="center">
+      <el-table-column :key="9" label="平均故障间隔时间/h(MTBF)" sortable min-width="140px" align="center">
         <template slot-scope="{row}">
           <span>{{ row.mtbf }}</span>
         </template>
       </el-table-column>
 
-
     </el-table>
     <pagination v-show="tableObj.total>0" :total="tableObj.total" :page.sync="tableObj.getdataListParm.parammaps.offset" :limit.sync="tableObj.getdataListParm.parammaps.pagecount" @pagination="get_table_data" />
   </div>
@@ -106,7 +118,7 @@
 <script>
 import waves from '@/directive/waves' // waves directive
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination
-import {  GetDataByName, GetDataByNames, GetMaintain, PostDataByName, checkButtons, ExecDataByConfig, GetAccount, getRecuData } from '@/api/common'
+import { GetDataByName, GetDataByNames, GetMaintain, PostDataByName, checkButtons, ExecDataByConfig, GetAccount, getRecuData } from '@/api/common'
 
 import { parseTime, json2excel, sortChange } from '@/utils/index.js'
 import TreeSelect from '@/components/TreeSelect'
@@ -125,15 +137,15 @@ export default {
         }
       },
       isTitle: false,
-      isTitle3:false,
+      isTitle3: false,
       isTitle2: false,
       isPasture: true,
       isType: false,
       isType2: false,
-      isType3:false,
+      isType3: false,
       pastureName: '',
       eqName: '',
-      eqClassName:'',
+      eqClassName: '',
       eqNameList: [],
       pastureList: [],
       eqClassList: [],
@@ -168,14 +180,13 @@ export default {
           name: 'pasture',
           returntype: 'Map',
           parammaps: {
-            eqClassId: '',  startTime: '',pastureName: '', pastureId:"",
-            endTime: '',level: 1,page: 1,  offset: 1, pagecount: 10,eqName:"",
+            eqClassId: '', startTime: '', pastureName: '', pastureId: '',
+            endTime: '', level: 1, page: 1, offset: 1, pagecount: 10, eqName: '',
             inputDatetime: []
           }
         }
       },
 
-
       disabled: false,
       placeholder: '请选择设备类别',
       nodeKey: 'id',
@@ -196,7 +207,7 @@ export default {
       downLoadList: [],
       isPercentage: false,
       percentage: 1,
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
 
@@ -209,32 +220,23 @@ export default {
   methods: {
 
     get_select_list() {
-      var send_data =  [
+      var send_data = [
 
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'getEqClassBengbu', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'section': '2' }}
 
-
       ]
 
-
-
       GetDataByNames(send_data).then(response => {
-
-        this.pastureList = response.data.findAllPasture.list
+        this.pastureList = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.eqClassList = response.data.getEqClassBengbu.list
-
       })
 
-      GetDataByName( { name: 'getEqClassBengbu', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'section': '2' }}).then(response => {
-
+      GetDataByName({ name: 'getEqClassBengbu', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'section': '2' }}).then(response => {
         this.eqClassList2 = response.data.list
-
       })
-      GetDataByName( { name: 'getEqClassBengbu', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'section': '3' }}).then(response => {
-
+      GetDataByName({ name: 'getEqClassBengbu', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'section': '3' }}).then(response => {
         this.eqClassList3 = response.data.list
-
       })
     },
 
@@ -290,12 +292,12 @@ export default {
       this.get_table_data()
     },
     tableCellStyle({ row, column, rowIndex, columnIndex }) {
-      if (row.name !== '现代牧业' && row.name !== '集团' && row.name !== '一中心' &&  row.name !== '二中心' &&  row.name !== '三中心' && row.typename == null && columnIndex === 1 && this.isPasture == true) {
+      if (row.name !== '现代牧业' && row.name !== '集团' && row.name !== '一中心' && row.name !== '二中心' && row.name !== '三中心' && row.typename == null && columnIndex === 1 && this.isPasture == true) {
         return {
           textDecoration: 'underline'
         }
       }
-      if (this.isType == true  ) {
+      if (this.isType == true) {
         if (row.typename !== null && columnIndex == 1) {
           return {
             textDecoration: 'underline'
@@ -303,7 +305,7 @@ export default {
         }
       }
 
-      if (this.isType2 == true  ) {
+      if (this.isType2 == true) {
         return {
           textDecoration: 'none'
         }
@@ -318,8 +320,8 @@ export default {
         this.tableObj.getdataListParm.parammaps.offset = 1
         this.tableObj.getdataListParm.parammaps.pastureId = row.pastureId
         this.tableObj.getdataListParm.parammaps.pastureName = row.pastureName
-        this.tableObj.getdataListParm.parammaps.level = "2"
-        this.tableObj.getdataListParm.parammaps.eqClassId = ""
+        this.tableObj.getdataListParm.parammaps.level = '2'
+        this.tableObj.getdataListParm.parammaps.eqClassId = ''
         this.get_table_data()
         this.isPasture = false
         this.isType = true
@@ -328,16 +330,16 @@ export default {
         this.isTitle2 = false
         this.isType3 = false
       }
-      this.eqClassList =  this.eqClassList3
+      this.eqClassList = this.eqClassList3
     },
     table_click2(row) {
       this.tableObj.getdataListParm.parammaps.offset = 1
       this.typename = row.eqClassName
       this.tableObj.getdataListParm.parammaps.pastureId = row.pastureId
       this.tableObj.getdataListParm.parammaps.pastureName = row.pastureName
-      this.tableObj.getdataListParm.parammaps.level = "3"
+      this.tableObj.getdataListParm.parammaps.level = '3'
       this.tableObj.getdataListParm.parammaps.eqClassId = row.eqClassId
-      this.tableObj.getdataListParm.parammaps.eqName = ""
+      this.tableObj.getdataListParm.parammaps.eqName = ''
       this.get_table_data()
       this.isPasture = false
       this.isType = false
@@ -357,15 +359,15 @@ export default {
       }
     },
     goFirst() {
-      console.log("goFirst")
+      console.log('goFirst')
       this.tableObj.getdataListParm.offset = 1
       this.tableObj.getdataListParm.parammaps.eqClassPIdStr = ''
-      this.tableObj.getdataListParm.parammaps.level = "1"
+      this.tableObj.getdataListParm.parammaps.level = '1'
       this.tableObj.getdataListParm.parammaps.eqName = ''
       this.tableObj.getdataListParm.parammaps.eqClassId = ''
       this.tableObj.getdataListParm.parammaps.pastureId = ''
       this.tableObj.getdataListParm.parammaps.pastureName = ''
-      this.eqClassList =  this.eqClassList2
+      this.eqClassList = this.eqClassList2
       this.get_table_data()
       this.isType = false
       this.isType2 = false
@@ -375,34 +377,30 @@ export default {
       this.isPasture = true
       this.isType3 = false
       this.isTitle3 = false
-      GetDataByName( { name: 'getEqClassBengbu', offset: 0, pagecount: 0, returntype: 'Map', parammaps: {
-        'section': '3','pid':'' }}).then(response => {
-
+      GetDataByName({ name: 'getEqClassBengbu', offset: 0, pagecount: 0, returntype: 'Map', parammaps: {
+        'section': '3', 'pid': '' }}).then(response => {
         this.eqClassList3 = response.data.list
-
       })
     },
     goSecond() {
-      console.log("goSecond")
+      console.log('goSecond')
       this.isType = true
       this.isType2 = false
       this.isTitle = true
       this.isTitle2 = false
       this.tableObj.getdataListParm.offset = 1
-      this.tableObj.getdataListParm.parammaps.level = "2"
+      this.tableObj.getdataListParm.parammaps.level = '2'
       this.tableObj.getdataListParm.parammaps.eqName = ''
       this.tableObj.getdataListParm.parammaps.eqClassId = ''
       this.tableObj.getdataListParm.parammaps.pastureId = ''
       this.tableObj.getdataListParm.parammaps.pastureName = ''
 
-      this.eqClassList =  this.eqClassList3
+      this.eqClassList = this.eqClassList3
       // this.tableObj.getdataListParm.parammaps.pastureid = this.tableObj.getdataListParm.parammaps.pastureid
       this.get_table_data()
     },
 
-
     form_export() {
-
       if (Cookies.get('pastureid') == 18) {
         this.tableObj.getdataListParm.parammaps.pastureId = ''
       } else {
@@ -410,7 +408,6 @@ export default {
       }
 
       if (this.isPasture) {
-
         console.log('设备导出')
         this.$alert('维修故障统计正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
         this.isPercentage = true
@@ -428,14 +425,13 @@ export default {
         this.downLoadParm.getdataListParm.pagecount = 0
         this.downLoadParm.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
 
+        //   this.tableObj.listLoading = true
+        // this.tableObj.getdataListParm.offset = 1
+        // this.tableObj.getdataListParm.parammaps.startTime = this.tableObj.getdataListParm.parammaps.inputDatetime[0]
+        // this.tableObj.getdataListParm.parammaps.endTime = this.tableObj.getdataListParm.parammaps.inputDatetime[1]
 
-      //   this.tableObj.listLoading = true
-      // this.tableObj.getdataListParm.offset = 1
-      // this.tableObj.getdataListParm.parammaps.startTime = this.tableObj.getdataListParm.parammaps.inputDatetime[0]
-      // this.tableObj.getdataListParm.parammaps.endTime = this.tableObj.getdataListParm.parammaps.inputDatetime[1]
-
-      this.downLoadParm.getdataListParm.parammaps.pagecount = ""
-      GetMaintain(this.downLoadParm.getdataListParm.parammaps ).then(response => {
+        this.downLoadParm.getdataListParm.parammaps.pagecount = ''
+        GetMaintain(this.downLoadParm.getdataListParm.parammaps).then(response => {
           if (response.data !== '') {
             this.percentage = 99
             setTimeout(() => {
@@ -447,7 +443,7 @@ export default {
             var excelDatas = [
               {
                 tHeader: ['牧场', '设备二级分类名称', '维修次数', '平均维修时间/h(MTTR)', '无故障时间/h(MTTF)', '平均故障间隔时间/h(MTBF)'],
-                filterVal: ['pastureName', 'eqClassName', 'count', 'mttr', 'mttf', 'mtbf' ],
+                filterVal: ['pastureName', 'eqClassName', 'count', 'mttr', 'mttf', 'mtbf'],
                 tableDatas: this.downLoadParm.list,
                 sheetName: '设备'
               }
@@ -455,9 +451,7 @@ export default {
             json2excel(excelDatas, '维修故障统计', true, 'xlsx')
           })
         })
-      } else if(this.isType){
-
-
+      } else if (this.isType) {
         console.log('设备导出')
         this.$alert('维修故障统计正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
         this.isPercentage = true
@@ -475,9 +469,9 @@ export default {
         this.downLoadParm.getdataListParm.pagecount = 0
         this.downLoadParm.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
 
-        this.downLoadParm.getdataListParm.parammaps.pagecount = ""
+        this.downLoadParm.getdataListParm.parammaps.pagecount = ''
 
-      GetMaintain(this.downLoadParm.getdataListParm.parammaps ).then(response => {
+        GetMaintain(this.downLoadParm.getdataListParm.parammaps).then(response => {
           if (response.data !== '') {
             this.percentage = 99
             setTimeout(() => {
@@ -488,8 +482,8 @@ export default {
             this.downLoadParm.list = response.data
             var excelDatas = [
               {
-                tHeader: [ '设备三级分类名称', '维修次数', '平均维修时间/h(MTTR)', '无故障时间/h(MTTF)', '平均故障间隔时间/h(MTBF)'],
-                filterVal: [ 'eqClassName', 'count', 'mttr', 'mttf', 'mtbf' ],
+                tHeader: ['设备三级分类名称', '维修次数', '平均维修时间/h(MTTR)', '无故障时间/h(MTTF)', '平均故障间隔时间/h(MTBF)'],
+                filterVal: ['eqClassName', 'count', 'mttr', 'mttf', 'mtbf'],
                 tableDatas: this.downLoadParm.list,
                 sheetName: '设备'
               }
@@ -497,7 +491,6 @@ export default {
             json2excel(excelDatas, '维修故障统计', true, 'xlsx')
           })
         })
-
       } else {
         console.log('设备导出')
         this.$alert('维修故障统计正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
@@ -516,9 +509,8 @@ export default {
         this.downLoadParm.getdataListParm.pagecount = 0
         this.downLoadParm.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
 
-
-        this.downLoadParm.getdataListParm.parammaps.pagecount = ""
-      GetMaintain(this.downLoadParm.getdataListParm.parammaps ).then(response => {
+        this.downLoadParm.getdataListParm.parammaps.pagecount = ''
+        GetMaintain(this.downLoadParm.getdataListParm.parammaps).then(response => {
           if (response.data !== '') {
             this.percentage = 99
             setTimeout(() => {
@@ -529,8 +521,8 @@ export default {
             this.downLoadParm.list = response.data
             var excelDatas = [
               {
-                tHeader: [   '设备名称','设备内部编号','维修次数', '平均维修时间/h(MTTR)', '无故障时间/h(MTTF)', '平均故障间隔时间/h(MTBF)'],
-                filterVal: [ '维修次数','维修次数',  'count', 'mttr', 'mttf', 'mtbf' ],
+                tHeader: ['设备名称', '设备内部编号', '维修次数', '平均维修时间/h(MTTR)', '无故障时间/h(MTTF)', '平均故障间隔时间/h(MTBF)'],
+                filterVal: ['维修次数', '维修次数', 'count', 'mttr', 'mttf', 'mtbf'],
                 tableDatas: this.downLoadParm.list,
                 sheetName: '设备'
               }
@@ -540,7 +532,7 @@ export default {
         })
       }
     },
-    table_click4(row){
+    table_click4(row) {
       this.isTitle3 = true
       this.isType3 = true
       this.isTitle2 = false
@@ -549,15 +541,13 @@ export default {
       this.isType2 = false
       this.eqClassName = row.eqClassName
       this.tableObj.getdataListParm.parammaps.offset = 1
-      this.tableObj.getdataListParm.parammaps.level = "2"
+      this.tableObj.getdataListParm.parammaps.level = '2'
       this.tableObj.getdataListParm.parammaps.eqClassPIdStr = row.eqId
       this.tableObj.getdataListParm.parammaps.eqClassId = ''
       this.get_table_data()
-      GetDataByName( { name: 'getEqClassBengbu', offset: 0, pagecount: 0, returntype: 'Map', parammaps: {
-        'section': '3','pid':row.eqId }}).then(response => {
-
+      GetDataByName({ name: 'getEqClassBengbu', offset: 0, pagecount: 0, returntype: 'Map', parammaps: {
+        'section': '3', 'pid': row.eqId }}).then(response => {
         this.eqClassList3 = response.data.list
-
       })
     }
 

+ 2 - 2
src/views/report/purchaseAndwarehousing/index.vue

@@ -138,7 +138,7 @@ export default {
       requestParams: [
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
       ],
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
 
@@ -151,7 +151,7 @@ export default {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         if (response.data.list !== null) {
-          this.findAllPasture = response.data.findAllPasture.list
+          this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         }
       })
     },

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 263 - 266
src/views/report/queryCombustion/index.vue


+ 225 - 226
src/views/report/queryElec/index.vue

@@ -10,12 +10,12 @@
       <p style="position: absolute;top:-12px;left:40%;color:rgb(130, 165, 252);background:rgb(230, 243, 255);border:1px solid rgb(130, 165, 252);padding:10px;border-radius:10px">
         集团用电量:{{ total }}度
       </p>
-       <el-radio-group v-model="radio1" class="group" @change="changeGroup">
-          <el-radio :label="'集团'">集团</el-radio>
-          <el-radio :label="'一中心'"></el-radio>
-          <el-radio :label="'二中心'"></el-radio>
-          <el-radio :label="'三中心'"></el-radio>
-        </el-radio-group>
+      <el-radio-group v-model="radio1" class="group" @change="changeGroup">
+        <el-radio :label="'集团'">集团</el-radio>
+        <el-radio :label="'一中心'" />
+        <el-radio :label="'二中心'" />
+        <el-radio :label="'三中心'" />
+      </el-radio-group>
       <el-col :span="24">
         <div id="chart1" style="width: 100%;height:400px;" />
       </el-col>
@@ -40,16 +40,16 @@
     <el-row style="position: relative;">
       <el-col :span="12">
         <div style="height: 50px;">
-          <el-select style="float: right;margin-right: 20px;" v-model="pastureName" multiple :multiple-limit="5" collapse-tags placeholder="牧场" @change="changePasture()">
-            <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
+          <el-select v-model="pastureName" style="float: right;margin-right: 20px;" multiple :multiple-limit="5" collapse-tags placeholder="牧场" @change="changePasture()">
+            <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.name" />
           </el-select>
         </div>
         <div id="chart4" style="width: 100%;height:400px;" />
       </el-col>
       <el-col :span="12">
         <div style="height: 50px;">
-          <el-select style="float: right;margin-right: 20px;" v-model="getChart5Parm.parammaps.deptName" placeholder="部门" @change="changeDept('5')">
-            <el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
+          <el-select v-model="getChart5Parm.parammaps.deptName" style="float: right;margin-right: 20px;" placeholder="部门" @change="changeDept('5')">
+            <el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.name" />
           </el-select>
         </div>
         <div id="chart5" style="width: 100%;height:400px;" />
@@ -70,21 +70,21 @@
 
 <script>
 import echarts from 'echarts'
-import { GetDataByName,GetDataByNames, GetReportform, checkButtons,getJson } from '@/api/common'
+import { GetDataByName, GetDataByNames, GetReportform, checkButtons, getJson } from '@/api/common'
 import Cookies from 'js-cookie'
 import { parseTime } from '@/utils/index.js'
 export default {
   name: 'QueryWater',
   data() {
     return {
-      monthDate: [new Date(),new Date()],
+      monthDate: [new Date(), new Date()],
       year: new Date().getFullYear(),
       month: new Date().getMonth() < 9 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1,
-      pastureList:[],
-      deptList:[{id:0,name:'挤奶处'},{id:1,name:'犊牛处'},{id:2,name:'办公室'},{id:3,name:'饲养处'},{id:4,name:'兽医处'},{id:5,name:'品控处'},{id:6,name:'设备处'}],
+      pastureList: [],
+      deptList: [{ id: 0, name: '挤奶处' }, { id: 1, name: '犊牛处' }, { id: 2, name: '办公室' }, { id: 3, name: '饲养处' }, { id: 4, name: '兽医处' }, { id: 5, name: '品控处' }, { id: 6, name: '设备处' }],
       total: '',
-      radio1:'集团',
-      pastureName:'',
+      radio1: '集团',
+      pastureName: '',
       isChart1: [],
       chart_data1: {},
       getChart1Parm: {
@@ -114,7 +114,6 @@ export default {
         }
       },
 
-
       isChart4: [],
       chart_data4: {},
       getChart4Parm: {
@@ -132,7 +131,7 @@ export default {
         parammaps: {
           receiveTime: new Date().getFullYear(),
           pastureName: Cookies.get('pasturename'),
-          deptName:''
+          deptName: ''
         }
       },
 
@@ -162,7 +161,7 @@ export default {
           receiveTime: new Date().getFullYear(),
           pastureName: Cookies.get('pasturename')
         }
-      },
+      }
     }
   },
   created() {
@@ -181,42 +180,42 @@ export default {
   },
   methods: {
     get_select_list() {
-      var send_data =  [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+      var send_data = [
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
       ]
       this.pastureList = []
       GetDataByNames(send_data).then(response => {
-        response.data.findAllPasture.list.forEach((item)=>{
-          if(item.name !== '现代牧业'){
+        response.data.getPastureRoleList.list.forEach((item) => {
+          if (item.name !== '现代牧业') {
             this.pastureList.push(item)
           }
         })
       })
     },
-    changeGroup(){
+    changeGroup() {
       this.getChart1()
       this.getChart2()
       this.getChart3()
       this.getChart8()
     },
-    changeMonth(){
-     if(this.isChart1){
-       this.getChart1()
-       this.getChart2()
-       this.getChart3()
-       this.getChart8()
-     }else{
-       this.pastureName = [Cookies.get('pasturename')]
-       this.getChart4()
-       this.getChart6()
-     }
+    changeMonth() {
+      if (this.isChart1) {
+        this.getChart1()
+        this.getChart2()
+        this.getChart3()
+        this.getChart8()
+      } else {
+        this.pastureName = [Cookies.get('pasturename')]
+        this.getChart4()
+        this.getChart6()
+      }
     },
-    changePasture(){
+    changePasture() {
       this.getChart4()
       this.getChart6()
     },
-    changeDept(item){
-      if(item == 5){
+    changeDept(item) {
+      if (item == 5) {
         this.getChart5()
       }
     },
@@ -225,12 +224,12 @@ export default {
       const chart1 = 'report:queryWater:pastures'
       const isChart1 = checkButtons(this.$store.state.user.buttons, chart1)
       this.isChart1 = isChart1
-      if(this.isChart1){
+      if (this.isChart1) {
         this.getChart1()
         this.getChart2()
         this.getChart3()
         this.getChart8()
-      }else{
+      } else {
         this.pastureName = [Cookies.get('pasturename')]
         this.getChart4()
         this.getChart6()
@@ -238,27 +237,27 @@ export default {
     },
     // 各牧场年度用电量对比
     getChart1() {
-      let url = '/authdata/electricity/nowelectricity?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
+      const url = '/authdata/electricity/nowelectricity?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
       let radio = ''
-      if(this.radio1 == '集团'){
+      if (this.radio1 == '集团') {
         radio = ''
-      }else{
+      } else {
         radio = this.radio1
       }
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-      getJson(url,data).then(response => {
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio
+      getJson(url, data).then(response => {
         console.log('各牧场年度用电量对比==>图1', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data1.data1 = response.data.nowYear
           this.chart_data1.data2 = response.data.lastYear
           this.chart_data1.xdata = response.data.pasture
           this.pastureName = [response.data.pasture[0]]
           this.total = response.data.all
-        }else{
+        } else {
           this.chart_data1.data1 = []
           this.chart_data1.data2 = []
           this.chart_data1.xdata = []
@@ -271,26 +270,26 @@ export default {
     },
     // 单头牛电量
     getChart2() {
-      let url = '/authdata/electricity/singlecow?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
+      const url = '/authdata/electricity/singlecow?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
       let radio = ''
-      if(this.radio1 == '集团'){
+      if (this.radio1 == '集团') {
         radio = ''
-      }else{
+      } else {
         radio = this.radio1
       }
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-      getJson(url,data).then(response => {
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio
+      getJson(url, data).then(response => {
         console.log('单头牛电量===>图2', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data2.data1 = response.data.nowYear
           this.chart_data2.data2 = response.data.lastYear
           this.chart_data2.xdata = response.data.pasture
           this.chart_data2.line = response.data.line
-        }else{
+        } else {
           this.chart_data2.data1 = []
           this.chart_data2.data2 = []
           this.chart_data2.xdata = []
@@ -302,28 +301,28 @@ export default {
 
     // 单头牛电费
     getChart3() {
-      let url = '/authdata/electricity/electricityrate?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
+      const url = '/authdata/electricity/electricityrate?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
       let radio = ''
-      if(this.radio1 == '集团'){
+      if (this.radio1 == '集团') {
         radio = ''
-      }else{
+      } else {
         radio = this.radio1
       }
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-      getJson(url,data).then(response => {
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio
+      getJson(url, data).then(response => {
         console.log('单头牛电费==>图3', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data3.data1 = response.data.actual
           this.chart_data3.xdata = response.data.pasture
           this.chart_data3.line = response.data.line
-        }else{
+        } else {
           this.chart_data3.data1 = []
           this.chart_data3.xdata = []
-          this.chart_data3.line =0
+          this.chart_data3.line = 0
         }
         this.roadChart3(this.chart_data3)
       })
@@ -332,132 +331,132 @@ export default {
     // XX牧场每月单头牛用电量对比
     getChart4() {
       this.getChart5Parm.parammaps.deptName = this.deptList[0].name
-      let url = '/authdata/electricity/perhead?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
+      const url = '/authdata/electricity/perhead?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
       let radio = ''
-      if(this.radio1 == '集团'){
+      if (this.radio1 == '集团') {
         radio = ''
-      }else{
+      } else {
         radio = this.radio1
       }
-      let pastureId = []
+      const pastureId = []
       // console.log(this.pastureList,'pastureList')
-      this.pastureList.forEach((item)=>{
-        if(this.pastureName){
-          this.pastureName.forEach((item1)=>{
-            if(item.name == item1){
+      this.pastureList.forEach((item) => {
+        if (this.pastureName) {
+          this.pastureName.forEach((item1) => {
+            if (item.name == item1) {
               pastureId.push(item.id)
             }
           })
         }
       })
-      console.log(pastureId,'pastureId')
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-                + '&pastureId=' + pastureId.toString()
-      getJson(url,data).then(response => {
+      console.log(pastureId, 'pastureId')
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio +
+                '&pastureId=' + pastureId.toString()
+      getJson(url, data).then(response => {
         console.log('牧场每月单头牛用电量对比==>图5', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data4.data1 = response.data.data3
           this.chart_data4.data_name = response.data.data1
           this.chart_data4.xdata = response.data.data2
-        }else{
+        } else {
           this.chart_data4.data1 = []
           this.chart_data4.data_name = []
           this.chart_data4.xdata = []
-          this.chart_data4.line =0
+          this.chart_data4.line = 0
         }
-        if(response.data.data1 == null){
+        if (response.data.data1 == null) {
           this.chart_data4.data_name = []
         }
-        if(response.data.data2 == null ){
+        if (response.data.data2 == null) {
           this.chart_data4.xdata = []
           this.getChart5Parm.parammaps.date = ''
-        }else{
+        } else {
           this.getChart5Parm.parammaps.date = response.data.data2[0]
         }
-        if(response.data.data3 == null){
+        if (response.data.data3 == null) {
           this.chart_data4.data1 = []
         }
 
-        console.log(this.chart_data4,'chart_data4')
+        console.log(this.chart_data4, 'chart_data4')
         this.roadChart4(this.chart_data4)
         this.getChart5()
       })
     },
     // XX月部门统计
     getChart5() {
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}') + '-01'
-      let date = this.monthDate[1];
-      let year = date.getFullYear()
-      let month = date.getMonth() + 1
-      let lastDay = new Date(year, month, 0).getDate();
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}') + '-' + lastDay
-      let data = {
-        name:"getdeptSumMonthElec",
-        parammaps:{
-          startTime:startTime,
-          endTime:endTime,
-          pastureName:this.pastureName.toString(),
-          deptname:this.getChart5Parm.parammaps.deptName,
-        },
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}') + '-01'
+      const date = this.monthDate[1]
+      const year = date.getFullYear()
+      const month = date.getMonth() + 1
+      const lastDay = new Date(year, month, 0).getDate()
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}') + '-' + lastDay
+      const data = {
+        name: 'getdeptSumMonthElec',
+        parammaps: {
+          startTime: startTime,
+          endTime: endTime,
+          pastureName: this.pastureName.toString(),
+          deptname: this.getChart5Parm.parammaps.deptName
+        }
       }
       GetDataByName(data).then(response => {
         console.log('XX月部门统计==>图6', response)
-        let data1 = []
-        let xdata = []
-        if(response.data){
-          response.data.list.forEach((item)=>{
+        const data1 = []
+        const xdata = []
+        if (response.data) {
+          response.data.list.forEach((item) => {
             data1.push(item.value)
             xdata.push(item.name)
           })
         }
         this.chart_data5 = {
-          data1:data1,
-          xdata:xdata
+          data1: data1,
+          xdata: xdata
         }
         this.roadChart5(this.chart_data5)
       })
     },
     // XX牧场XX年每月用电量对比
     getChart6() {
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}') + '-01'
-      let date = this.monthDate[1];
-      let year = date.getFullYear()
-      let month = date.getMonth() + 1
-      let lastDay = new Date(year, month, 0).getDate();
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}') + '-' + lastDay
-      let data = {
-        name:"getPastureSumMonthElec",
-        parammaps:{
-          startTime:startTime,
-          endTime:endTime,
-          pastureName:this.pastureName.toString(),
-        },
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}') + '-01'
+      const date = this.monthDate[1]
+      const year = date.getFullYear()
+      const month = date.getMonth() + 1
+      const lastDay = new Date(year, month, 0).getDate()
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}') + '-' + lastDay
+      const data = {
+        name: 'getPastureSumMonthElec',
+        parammaps: {
+          startTime: startTime,
+          endTime: endTime,
+          pastureName: this.pastureName.toString()
+        }
       }
       GetReportform(data).then(response => {
         console.log('牧场每月用电量对比==>图7', response)
         // this.chart_data6 = response.data.chart_data
-        if(response.data){
+        if (response.data) {
           this.chart_data6 = {
-            data1:response.data.chart_data.lastYear,
-            data2:response.data.chart_data.nowYear,
-            xdata:response.data.chart_data.months,
-            data_name:response.data.chart_data.pastureName
+            data1: response.data.chart_data.lastYear,
+            data2: response.data.chart_data.nowYear,
+            xdata: response.data.chart_data.months,
+            data_name: response.data.chart_data.pastureName
           }
-        }else{
+        } else {
           this.chart_data6 = {
-            data1:[],
-            data2:[],
-            xdata:[],
-            data_name:[]
+            data1: [],
+            data2: [],
+            xdata: [],
+            data_name: []
           }
         }
-        if(response.data.chart_data.months){
+        if (response.data.chart_data.months) {
           this.getChart7Parm.parammaps.date = response.data.chart_data.months[0]
-        }else{
+        } else {
           this.getChart7Parm.parammaps.date = ''
         }
 
@@ -467,30 +466,30 @@ export default {
     },
     // XX月每日用电量
     getChart7() {
-      let startTime = this.getChart7Parm.parammaps.date
-      let endTime = this.getChart7Parm.parammaps.date
-      let data = {
-        name:"getPastureSumDayElec",
-        parammaps:{
-          startTime:startTime,
-          endTime:endTime,
-          pastureName:this.pastureName.toString(),
-        },
+      const startTime = this.getChart7Parm.parammaps.date
+      const endTime = this.getChart7Parm.parammaps.date
+      const data = {
+        name: 'getPastureSumDayElec',
+        parammaps: {
+          startTime: startTime,
+          endTime: endTime,
+          pastureName: this.pastureName.toString()
+        }
       }
       GetReportform(data).then(response => {
         console.log('XX月每日用电量==>图8', response)
         // this.chart_data7 = response.data.chart_data
-        if(response.data){
+        if (response.data) {
           this.chart_data7 = {
-            data1:response.data.chart_data.nowYear,
-            data_name:this.pastureName,
-            xdata:response.data.chart_data.day
+            data1: response.data.chart_data.nowYear,
+            data_name: this.pastureName,
+            xdata: response.data.chart_data.day
           }
-        }else{
+        } else {
           this.chart_data7 = {
-            data1:[],
-            data_name:[],
-            xdata:[]
+            data1: [],
+            data_name: [],
+            xdata: []
           }
         }
         this.roadChart7(this.chart_data7)
@@ -498,24 +497,24 @@ export default {
     },
     // 电费完成率
     getChart8() {
-      let url = '/authdata/electricity/ratecomplete?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
-      let radio = ''
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-      getJson(url,data).then(response => {
+      const url = '/authdata/electricity/ratecomplete?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
+      const radio = ''
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio
+      getJson(url, data).then(response => {
         console.log('电费完成率==>图4', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data8.data1 = response.data.actual
           this.chart_data8.data2 = response.data.budget
           this.chart_data8.data3 = response.data.complete
           this.chart_data8.xdata = response.data.pasture
-        }else{
+        } else {
           this.chart_data8.data1 = []
-          this.chart_data8.data2= []
-          this.chart_data8.data3= []
+          this.chart_data8.data2 = []
+          this.chart_data8.data3 = []
           this.chart_data8.xdata = []
         }
         this.roadChart8(this.chart_data8)
@@ -536,20 +535,20 @@ export default {
         },
         color: ['#61A5E8', '#9933FF'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        xAxis: [{ type: 'category', name: '牧场', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
         yAxis: [{ type: 'value', name: '用量(度)', axisLabel: { formatter: '{value}万' }}],
         series: [
           {
             name: '今年用量',
             type: 'bar',
             data: chart_data.data1,
-            barMaxWidth:20,
+            barMaxWidth: 20,
             emphasis: { label: { show: true, position: 'inside' }}
           },
           {
             name: '去年同期',
             type: 'bar',
-            barMaxWidth:20,
+            barMaxWidth: 20,
             data: chart_data.data2,
             emphasis: { label: { show: true, position: 'inside' }}
           }
@@ -574,27 +573,27 @@ export default {
       }
       this.chart2 = echarts.init(document.getElementById('chart2'))
       var option = {
-        title: { text: '单头牛电量', left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: '单头牛电量', left: 'center', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: ['实际费用', '去年同期'],
           right: 40
         },
-        color:  ['#61A5E8', '#9933FF','#FFB800'],
+        color: ['#61A5E8', '#9933FF', '#FFB800'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value', name: '用量(度)'}],
+        xAxis: [{ type: 'category', name: '牧场', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '用量(度)' }],
         series: [
           {
             name: '实际费用',
             type: 'bar',
             data: chart_data.data1,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20,
-            markLine:{
-              data:[ {yAxis:chart_data.line} ],
+            barMaxWidth: 20,
+            markLine: {
+              data: [{ yAxis: chart_data.line }],
               lineStyle: {
-                  color: '#FFB800'
+                color: '#FFB800'
               }
             }
           },
@@ -603,7 +602,7 @@ export default {
             type: 'bar',
             data: chart_data.data2,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20
+            barMaxWidth: 20
           }
 
         ]
@@ -624,7 +623,7 @@ export default {
       }
       this.chart3 = echarts.init(document.getElementById('chart3'))
       var option = {
-        title: { text: '单头牛电费', left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: '单头牛电费', left: 'center', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: ['实际费用'],
@@ -632,22 +631,22 @@ export default {
         },
         color: ['#61A5E8'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value', name: '费用(元)'}],
+        xAxis: [{ type: 'category', name: '牧场', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '费用(元)' }],
         series: [
           {
             name: '实际费用',
             type: 'bar',
             data: chart_data.data1,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20,
-            markLine:{
-              data:[ {yAxis:chart_data.line} ],
+            barMaxWidth: 20,
+            markLine: {
+              data: [{ yAxis: chart_data.line }],
               lineStyle: {
-                  color: '#FFB800'
+                color: '#FFB800'
               }
             }
-          },
+          }
 
         ]
       }
@@ -669,20 +668,20 @@ export default {
       // var text = '各牧场' + parseTime(this.monthDate, '{y}') + '年每月单头牛用电量对比'
       var text = '牧场每月单头牛用电量对比'
       var option = {
-        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
+        title: { text: text, left: 'left', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: chart_data.data_name,
           left: 40,
-          bottom:0
+          bottom: 0
         },
-        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
+        color: ['#eb123a', '#eba612', '#124feb', '#15ab2e', '#b20fdb'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '月份',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value', name: '用量(度)'}],
+        xAxis: [{ type: 'category', name: '月份', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '用量(度)' }],
         series: (function() {
           var serie = []
-          if(chart_data.data1 !== null){
+          if (chart_data.data1 !== null) {
             for (var i = 0; i < chart_data.data1.length; i++) {
               var item = {
                 name: chart_data.data_name[i],
@@ -713,23 +712,23 @@ export default {
       this.chart5 = echarts.init(document.getElementById('chart5'))
       var text = this.getChart5Parm.parammaps.date + '月部门统计'
       var option = {
-        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
+        title: { text: text, left: 'left', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           right: 40,
-          bottom:0
+          bottom: 0
         },
         color: ['#2dc0e8', '#769cfc'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '部门',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value',name: '用量(度)', axisLabel: { formatter:'{value} 万'}}],
+        xAxis: [{ type: 'category', name: '部门', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '用量(度)', axisLabel: { formatter: '{value} 万' }}],
         series: [
           {
             type: 'bar',
             data: chart_data.data1,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20
-          },
+            barMaxWidth: 20
+          }
         ]
       }
       this.chart5.setOption(option)
@@ -749,20 +748,20 @@ export default {
       this.chart6 = echarts.init(document.getElementById('chart6'))
       var text = '牧场每月用电量对比'
       var option = {
-        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
+        title: { text: text, left: 'left', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: chart_data.data_name,
           right: 40,
-          bottom:0
+          bottom: 0
         },
-        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
+        color: ['#eb123a', '#eba612', '#124feb', '#15ab2e', '#b20fdb'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '月份',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value',name: '电量(度)'}],
+        xAxis: [{ type: 'category', name: '月份', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '电量(度)' }],
         series: (function() {
           var serie = []
-          if(chart_data.data1 !== null){
+          if (chart_data.data1 !== null) {
             for (var i = 0; i < chart_data.data1.length; i++) {
               var item = {
                 name: chart_data.data_name[i],
@@ -804,27 +803,27 @@ export default {
     },
     // XX月每日用电量
     roadChart7(chart_data) {
-      console.log(chart_data,'chart_data')
+      console.log(chart_data, 'chart_data')
       if (this.chart7 != null) {
         this.chart7.dispose()
       }
       this.chart7 = echarts.init(document.getElementById('chart7'))
       var text = this.getChart7Parm.parammaps.date + '月每日用电量'
       var option = {
-        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
+        title: { text: text, left: 'left', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: chart_data.data_name,
           left: 40,
-          bottom:0
+          bottom: 0
         },
-        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
+        color: ['#eb123a', '#eba612', '#124feb', '#15ab2e', '#b20fdb'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '日',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value', name: '电量(度)'}],
+        xAxis: [{ type: 'category', name: '日', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '电量(度)' }],
         series: (function() {
           var serie = []
-          if(chart_data.data1 !== null){
+          if (chart_data.data1 !== null) {
             for (var i = 0; i < chart_data.data1.length; i++) {
               var item = {
                 name: chart_data.data_name[i],
@@ -853,23 +852,23 @@ export default {
       }
       this.chart8 = echarts.init(document.getElementById('chart8'))
       var option = {
-        title: { text: '电费完成率',left:'center', textStyle: { color: '#769cfc' }},
+        title: { text: '电费完成率', left: 'center', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
-          data: ['实际费用', '预算','完成率'],
+          data: ['实际费用', '预算', '完成率'],
           right: 40
         },
-        color: ['#61A5E8', '#7ECF51','#FFFF00'],
+        color: ['#61A5E8', '#7ECF51', '#FFFF00'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        xAxis: [{ type: 'category', name: '牧场', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
         yAxis: [
           { type: 'value', name: '费用(元)', axisLabel: { formatter: '{value}' }},
-          { type: 'value', name: '', axisLabel: { formatter: '{value}%' },splitLine:{show: false}}
+          { type: 'value', name: '', axisLabel: { formatter: '{value}%' }, splitLine: { show: false }}
         ],
         series: [
-          { name: '实际费用', type: 'bar', data: chart_data.data1, barMaxWidth:20, emphasis: { label: { show: true, position: 'inside' }} },
-          { name: '预算', type: 'bar', barMaxWidth:20, data: chart_data.data2, emphasis: { label: { show: true, position: 'inside' }} },
-          { name: '完成率', type: 'line',yAxisIndex: 1, data: chart_data.data3, emphasis: { label: { show: true, position: 'inside' }} }
+          { name: '实际费用', type: 'bar', data: chart_data.data1, barMaxWidth: 20, emphasis: { label: { show: true, position: 'inside' }}},
+          { name: '预算', type: 'bar', barMaxWidth: 20, data: chart_data.data2, emphasis: { label: { show: true, position: 'inside' }}},
+          { name: '完成率', type: 'line', yAxisIndex: 1, data: chart_data.data3, emphasis: { label: { show: true, position: 'inside' }}}
         ]
       }
       this.chart8.setOption(option)
@@ -880,7 +879,7 @@ export default {
       this.chart8.on('click', function(param, i) {
         // console.log(param)
       })
-    },
+    }
   }
 }
 </script>

+ 248 - 251
src/views/report/queryRepair/index.vue

@@ -4,21 +4,21 @@
       <div class="block">
         <el-date-picker v-model="monthDate" :clearable="false" type="monthrange" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" @change="changeMonth()" />
         <el-select v-model="type" placeholder="类型" @change="changeType">
-          <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
+          <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id" />
         </el-select>
       </div>
     </div>
 
     <el-row v-if="isChart1" style="position: relative;">
       <p style="position: absolute;top:-12px;left:40%;color:rgb(130, 165, 252);background:rgb(230, 243, 255);border:1px solid rgb(130, 165, 252);padding:10px;border-radius:10px">
-        集团{{costTypeName}}:{{ total }}万元
+        集团{{ costTypeName }}:{{ total }}万元
       </p>
-       <el-radio-group v-model="radio1" class="group" @change="changeGroup">
-          <el-radio :label="'集团'">集团</el-radio>
-          <el-radio :label="'一中心'"></el-radio>
-          <el-radio :label="'二中心'"></el-radio>
-          <el-radio :label="'三中心'"></el-radio>
-        </el-radio-group>
+      <el-radio-group v-model="radio1" class="group" @change="changeGroup">
+        <el-radio :label="'集团'">集团</el-radio>
+        <el-radio :label="'一中心'" />
+        <el-radio :label="'二中心'" />
+        <el-radio :label="'三中心'" />
+      </el-radio-group>
       <el-col :span="24">
         <div id="chart1" style="width: 100%;height:400px;" />
       </el-col>
@@ -36,8 +36,8 @@
       </el-col>
       <el-col :span="12">
         <div style="height: 50px;">
-          <el-select style="float: right;margin-right: 20px;" v-model="getChart5Parm.parammaps.deptName" placeholder="部门" @change="changeDept('5')">
-            <el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
+          <el-select v-model="getChart5Parm.parammaps.deptName" style="float: right;margin-right: 20px;" placeholder="部门" @change="changeDept('5')">
+            <el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.name" />
           </el-select>
         </div>
         <div id="chart5" style="width: 100%;height:400px;" />
@@ -47,16 +47,16 @@
     <el-row style="position: relative;">
       <el-col :span="12">
         <div style="height: 50px;">
-          <el-select style="float: right;margin-right: 20px;" v-model="pastureName" multiple :multiple-limit="5" collapse-tags placeholder="牧场" @change="changePasture()">
-            <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
+          <el-select v-model="pastureName" style="float: right;margin-right: 20px;" multiple :multiple-limit="5" collapse-tags placeholder="牧场" @change="changePasture()">
+            <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.name" />
           </el-select>
         </div>
         <div id="chart6" style="width: 100%;height:400px;" />
       </el-col>
       <el-col :span="12">
         <div style="height: 50px;">
-          <el-select style="float: right;margin-right: 20px;" v-model="getChart7Parm.parammaps.deptName" placeholder="部门" @change="changeDept('7')">
-            <el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
+          <el-select v-model="getChart7Parm.parammaps.deptName" style="float: right;margin-right: 20px;" placeholder="部门" @change="changeDept('7')">
+            <el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.name" />
           </el-select>
         </div>
         <div id="chart7" style="width: 100%;height:400px;" />
@@ -65,62 +65,62 @@
 
     <el-dialog title="详情" :visible.sync="dialogFormVisibleCard" width="90%" :close-on-click-modal="false">
       <div class="app-contentcard">
-      <el-form ref="rowSeeData" :model="rowSeeData" label-position="right" label-width="120px" style="width: 100%;margin:0 auto;">
-        <div class="filter-container">
-          <el-input v-model="getdataListParmSee.parammaps.eqName" placeholder="设备内部编号" clearable class="filter-item" style="width: 130px" />
-          <el-input v-model="getdataListParmSee.parammaps.assetCode" placeholder="资产编号" clearable class="filter-item" style="width: 130px" />
-          <el-date-picker ref="inputDatetime" v-model="getdataListParmSee.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="领用开始日期" end-placeholder="领用结束日期" />
+        <el-form ref="rowSeeData" :model="rowSeeData" label-position="right" label-width="120px" style="width: 100%;margin:0 auto;">
+          <div class="filter-container">
+            <el-input v-model="getdataListParmSee.parammaps.eqName" placeholder="设备内部编号" clearable class="filter-item" style="width: 130px" />
+            <el-input v-model="getdataListParmSee.parammaps.assetCode" placeholder="资产编号" clearable class="filter-item" style="width: 130px" />
+            <el-date-picker ref="inputDatetime" v-model="getdataListParmSee.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="领用开始日期" end-placeholder="领用结束日期" />
 
-          <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_searchDelivery">搜索</el-button>
-          <el-button class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownloadDelivery">导出</el-button>
+            <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_searchDelivery">搜索</el-button>
+            <el-button class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownloadDelivery">导出</el-button>
+          </div>
+        </el-form>
+        <el-table
+          :key="tableKey"
+          v-loading="listLoadingSee"
+          element-loading-text="给我一点时间"
+          :data="listSee"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable"
+        >
+          <el-table-column label="序号" align="center" type="index" width="50px">
+            <template slot-scope="scope">
+              <span>{{ scope.$index + (pageNumSee-1) * pageSizeSee + 1 }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="资产编号" min-width="110px" align="center" prop="assetCode" />
+          <el-table-column label="设备名称" min-width="110px" align="center" prop="eqName" />
+          <el-table-column label="设备内部编号" min-width="110px" align="center" prop="eqCode" />
+          <el-table-column label="设备规格" min-width="110px" align="center" prop="eqSpecification" />
+          <el-table-column label="领用日期" min-width="110px" align="center" prop="receiveTime" />
+          <el-table-column label="领用部门" min-width="110px" align="center" prop="deptName" />
+          <el-table-column label="备件编号" min-width="110px" align="center" prop="partCode" />
+          <el-table-column label="备件名称" min-width="110px" align="center" prop="partName" />
+          <el-table-column label="备件规格" min-width="110px" align="center" prop="specification" />
+          <el-table-column label="备件品牌" min-width="110px" align="center" prop="brandName" />
+          <el-table-column label="计量单位" min-width="110px" align="center" prop="unit" />
+          <el-table-column label="出库数量" min-width="110px" align="center" prop="checkoutNumber" />
+          <el-table-column label="退库数量" min-width="110px" align="center" prop="quitNumber" />
+          <el-table-column label="单价" min-width="110px" align="center" prop="price" />
+          <el-table-column label="总价" min-width="110px" align="center" prop="sumPrice" />
+        </el-table>
+        <pagination v-show="totalSee>=0" :total="totalSee" :page.sync="getdataListParmSee.offset" :limit.sync="getdataListParmSee.pagecount" @pagination="get_table_dataSee" />
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
+          <el-button @click="dialogFormVisibleCard = false">关闭</el-button>
         </div>
-      </el-form>
-      <el-table
-        :key="tableKey"
-        v-loading="listLoadingSee"
-        element-loading-text="给我一点时间"
-        :data="listSee"
-        border
-        fit
-        highlight-current-row
-        style="width: 100%;"
-        :row-style="rowStyle"
-        :cell-style="cellStyle"
-        class="elTable"
-      >
-        <el-table-column label="序号" align="center" type="index" width="50px">
-          <template slot-scope="scope">
-            <span>{{ scope.$index + (pageNumSee-1) * pageSizeSee + 1 }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="资产编号" min-width="110px" align="center" prop="assetCode" />
-        <el-table-column label="设备名称" min-width="110px" align="center" prop="eqName" />
-        <el-table-column label="设备内部编号" min-width="110px" align="center" prop="eqCode" />
-        <el-table-column label="设备规格" min-width="110px" align="center" prop="eqSpecification" />
-        <el-table-column label="领用日期" min-width="110px" align="center" prop="receiveTime" />
-        <el-table-column label="领用部门" min-width="110px" align="center" prop="deptName" />
-        <el-table-column label="备件编号" min-width="110px" align="center" prop="partCode" />
-        <el-table-column label="备件名称" min-width="110px" align="center" prop="partName" />
-        <el-table-column label="备件规格" min-width="110px" align="center" prop="specification" />
-        <el-table-column label="备件品牌" min-width="110px" align="center" prop="brandName" />
-        <el-table-column label="计量单位" min-width="110px" align="center" prop="unit" />
-        <el-table-column label="出库数量" min-width="110px" align="center" prop="checkoutNumber" />
-        <el-table-column label="退库数量" min-width="110px" align="center" prop="quitNumber" />
-        <el-table-column label="单价" min-width="110px" align="center" prop="price" />
-        <el-table-column label="总价" min-width="110px" align="center" prop="sumPrice" />
-    </el-table>
-    <pagination v-show="totalSee>=0" :total="totalSee" :page.sync="getdataListParmSee.offset" :limit.sync="getdataListParmSee.pagecount" @pagination="get_table_dataSee" />
-    <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
-      <el-button @click="dialogFormVisibleCard = false">关闭</el-button>
-    </div>
-  </div>
-  </el-dialog>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import echarts from 'echarts'
-import { GetDataByName,GetDataByNames, GetReportform, checkButtons,getJson } from '@/api/common'
+import { GetDataByName, GetDataByNames, GetReportform, checkButtons, getJson } from '@/api/common'
 import Cookies from 'js-cookie'
 import { parseTime } from '@/utils/index.js'
 import Pagination from '@/components/Pagination' // secondary package based on el-pagination
@@ -129,18 +129,18 @@ export default {
   components: { Pagination },
   data() {
     return {
-      monthDate: [new Date(),new Date()],
-      costTypeName:'所有维修费',
-      type:'',
+      monthDate: [new Date(), new Date()],
+      costTypeName: '所有维修费',
+      type: '',
       year: new Date().getFullYear(),
       month: new Date().getMonth() < 9 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1,
-      pastureList:[],
-      deptList:[{id:0,name:'挤奶处'},{id:1,name:'犊牛处'},{id:2,name:'办公室'},{id:3,name:'饲养处'},{id:4,name:'兽医处'},{id:5,name:'品控处'},{id:6,name:'设备处'}],
+      pastureList: [],
+      deptList: [{ id: 0, name: '挤奶处' }, { id: 1, name: '犊牛处' }, { id: 2, name: '办公室' }, { id: 3, name: '饲养处' }, { id: 4, name: '兽医处' }, { id: 5, name: '品控处' }, { id: 6, name: '设备处' }],
       // typeList:[{id:0,name:'全部费用'},{id:1,name:'制造费用'},{id:2,name:'直接费用'},{id:3,name:'管理费用'}],
       typeList: [{ id: '', name: '全部费用' }, { id: '挤奶处', name: '直接费用' }, { id: '牧场办公室', name: '管理费用' }, { id: 1, name: '制造费用' }],
       total: '',
-      radio1:'集团',
-      pastureName:'',
+      radio1: '集团',
+      pastureName: '',
       isChart1: [],
       chart_data1: {},
       getChart1Parm: {
@@ -170,7 +170,6 @@ export default {
         }
       },
 
-
       isChart4: [],
       chart_data4: {},
       getChart4Parm: {
@@ -188,7 +187,7 @@ export default {
         parammaps: {
           receiveTime: new Date().getFullYear(),
           pastureName: Cookies.get('pasturename'),
-          deptName:''
+          deptName: ''
         }
       },
 
@@ -208,7 +207,7 @@ export default {
         parammaps: {
           receiveTime: new Date().getFullYear(),
           pastureName: Cookies.get('pasturename'),
-          deptName:''
+          deptName: ''
         }
       },
       isChart8: [],
@@ -248,7 +247,7 @@ export default {
           pastureId: Cookies.get('pastureid'),
           pastureName: Cookies.get('pasturename')
         }
-      },
+      }
     }
   },
   created() {
@@ -263,19 +262,19 @@ export default {
   },
   methods: {
     get_select_list() {
-      var send_data =  [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': 18 }},
+      var send_data = [
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': 18 }}
       ]
       this.pastureList = []
       GetDataByNames(send_data).then(response => {
-        response.data.findAllPasture.list.forEach((item)=>{
-          if(item.name !== '现代牧业'){
+        response.data.getPastureRoleList.list.forEach((item) => {
+          if (item.name !== '现代牧业') {
             this.pastureList.push(item)
           }
         })
       })
     },
-    changeType(item){
+    changeType(item) {
       console.log(item)
       if (item == '挤奶处') {
         this.costTypeName = '直接维修费'
@@ -289,37 +288,37 @@ export default {
       } else {
         this.costTypeName = '所有维修费'
       }
-      if(this.isChart1){
+      if (this.isChart1) {
         this.getChart1()
         this.getChart2()
-      }else{
+      } else {
         this.getChart4()
         this.getChart6()
       }
     },
-    changeGroup(){
+    changeGroup() {
       this.getChart1()
       this.getChart2()
       this.getChart4()
     },
-    changeMonth(){
-      if(this.isChart1){
+    changeMonth() {
+      if (this.isChart1) {
         this.getChart1()
         this.getChart2()
-      }else{
+      } else {
         this.pastureName = [Cookies.get('pasturename')]
         this.getChart4()
         this.getChart6()
       }
     },
-    changePasture(){
+    changePasture() {
       // this.getChart4()
       this.getChart6()
     },
-    changeDept(item){
-      if(item == 5){
+    changeDept(item) {
+      if (item == 5) {
         this.getChart5()
-      }else if(item == 7){
+      } else if (item == 7) {
         this.getChart7()
       }
     },
@@ -328,10 +327,10 @@ export default {
       const chart1 = 'report:queryWater:pastures'
       const isChart1 = checkButtons(this.$store.state.user.buttons, chart1)
       this.isChart1 = isChart1
-      if(this.isChart1){
+      if (this.isChart1) {
         this.getChart1()
         this.getChart2()
-      }else{
+      } else {
         this.pastureName = [Cookies.get('pasturename')]
         this.getChart4()
         this.getChart6()
@@ -339,28 +338,28 @@ export default {
     },
     // 各牧场维修费用对比
     getChart1() {
-      let url = '/authdata/repair/nowelectricity?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
+      const url = '/authdata/repair/nowelectricity?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
       let radio = ''
-      if(this.radio1 == '集团'){
+      if (this.radio1 == '集团') {
         radio = ''
-      }else{
+      } else {
         radio = this.radio1
       }
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-                + '&departmentName=' + this.type
-      getJson(url,data).then(response => {
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio +
+                '&departmentName=' + this.type
+      getJson(url, data).then(response => {
         console.log('各牧场维修费用对比==>图1', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data1.data1 = response.data.nowYear
           this.chart_data1.data2 = response.data.lastYear
           this.chart_data1.xdata = response.data.pasture
           this.pastureName = [response.data.pasture[0]]
           this.total = response.data.all
-        }else{
+        } else {
           this.chart_data1.data1 = []
           this.chart_data1.data2 = []
           this.chart_data1.xdata = []
@@ -373,26 +372,26 @@ export default {
     },
     // 单头牛维修费用
     getChart2() {
-      let url = '/authdata/repair/singlecow?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
+      const url = '/authdata/repair/singlecow?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
       let radio = ''
-      if(this.radio1 == '集团'){
+      if (this.radio1 == '集团') {
         radio = ''
-      }else{
+      } else {
         radio = this.radio1
       }
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-      getJson(url,data).then(response => {
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio
+      getJson(url, data).then(response => {
         console.log('单头牛维修费用==>图2', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data2.data1 = response.data.nowYear
           this.chart_data2.data2 = response.data.lastYear
           this.chart_data2.xdata = response.data.pasture
           this.chart_data2.line = response.data.line
-        }else{
+        } else {
           this.chart_data2.data1 = []
           this.chart_data2.data2 = []
           this.chart_data2.xdata = []
@@ -402,47 +401,45 @@ export default {
       })
     },
 
-
-
     // XX牧场每月维修费对比
     getChart4() {
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}') + '-01'
-      let date = this.monthDate[1];
-      let year = date.getFullYear()
-      let month = date.getMonth() + 1
-      let lastDay = new Date(year, month, 0).getDate();
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}') + '-' + lastDay
-      let data = {
-        name:"getPastureSumMonth",
-        parammaps:{
-          startTime:startTime,
-          endTime:endTime,
-          pastureName:this.pastureName.toString(),
-          departmentName:this.type
-        },
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}') + '-01'
+      const date = this.monthDate[1]
+      const year = date.getFullYear()
+      const month = date.getMonth() + 1
+      const lastDay = new Date(year, month, 0).getDate()
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}') + '-' + lastDay
+      const data = {
+        name: 'getPastureSumMonth',
+        parammaps: {
+          startTime: startTime,
+          endTime: endTime,
+          pastureName: this.pastureName.toString(),
+          departmentName: this.type
+        }
       }
       GetReportform(data).then(response => {
         console.log('XX牧场每月维修费对比==>图3', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data4 = {
-            data1:response.data.chart_data.lastYear,
-            data2:response.data.chart_data.nowYear,
-            data3:response.data.chart_data.monthBudgetList,
-            xdata:response.data.chart_data.months,
-            data_name:['去年同期用量','今年用量','预算']
+            data1: response.data.chart_data.lastYear,
+            data2: response.data.chart_data.nowYear,
+            data3: response.data.chart_data.monthBudgetList,
+            xdata: response.data.chart_data.months,
+            data_name: ['去年同期用量', '今年用量', '预算']
           }
-        }else{
+        } else {
           this.chart_data4 = {
-            data1:[],
-            data2:[],
-            data3:[],
-            xdata:[],
-            data_name:['去年同期用量','今年用量','预算']
+            data1: [],
+            data2: [],
+            data3: [],
+            xdata: [],
+            data_name: ['去年同期用量', '今年用量', '预算']
           }
         }
-        if(response.data.chart_data.months){
+        if (response.data.chart_data.months) {
           this.getChart5Parm.parammaps.date = response.data.chart_data.months[0]
-        }else{
+        } else {
           this.getChart5Parm.parammaps.date = ''
         }
         this.roadChart4(this.chart_data4)
@@ -452,33 +449,33 @@ export default {
     },
     // XX月部门统计
     getChart5() {
-      console.log(this.getChart5Parm.parammaps.deptName,'deptName')
-      let startTime = parseTime(this.getChart5Parm.parammaps.date,'{y}-{m}')
-      let date =  new Date(this.getChart5Parm.parammaps.date);
-      let year = date.getFullYear()
-      let month = date.getMonth() + 1
-      let lastDay = new Date(year, month, 0).getDate();
-      let endTime = parseTime(this.getChart5Parm.parammaps.date,'{y}-{m}')
-      let data = {
-        name:"geteqclassSumMonth",
-        parammaps:{
-          startTime:startTime,
-          endTime:endTime,
-          pastureName:this.pastureName.toString(),
-          deptName:this.getChart5Parm.parammaps.deptName,
-        },
+      console.log(this.getChart5Parm.parammaps.deptName, 'deptName')
+      const startTime = parseTime(this.getChart5Parm.parammaps.date, '{y}-{m}')
+      const date = new Date(this.getChart5Parm.parammaps.date)
+      const year = date.getFullYear()
+      const month = date.getMonth() + 1
+      const lastDay = new Date(year, month, 0).getDate()
+      const endTime = parseTime(this.getChart5Parm.parammaps.date, '{y}-{m}')
+      const data = {
+        name: 'geteqclassSumMonth',
+        parammaps: {
+          startTime: startTime,
+          endTime: endTime,
+          pastureName: this.pastureName.toString(),
+          deptName: this.getChart5Parm.parammaps.deptName
+        }
       }
       GetReportform(data).then(response => {
         console.log('XX部门维修费用==>图4', response)
-        if(response.data.chart_data){
+        if (response.data.chart_data) {
           this.chart_data5 = {
-            data1:response.data.chart_data.eqCost,
-            xdata:response.data.chart_data.typeName
+            data1: response.data.chart_data.eqCost,
+            xdata: response.data.chart_data.typeName
           }
-        }else{
+        } else {
           this.chart_data5 = {
-            data1:[],
-            xdata:[]
+            data1: [],
+            xdata: []
           }
         }
         this.roadChart5(this.chart_data5)
@@ -486,51 +483,51 @@ export default {
     },
     // XX牧场XX年每月用电量对比
     getChart6() {
-      let url = '/authdata/repair/perhead?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
+      const url = '/authdata/repair/perhead?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
       let radio = ''
-      if(this.radio1 == '集团'){
+      if (this.radio1 == '集团') {
         radio = ''
-      }else{
+      } else {
         radio = this.radio1
       }
-      let pastureId = []
-      this.pastureList.forEach((item)=>{
-        if(this.pastureName){
-          this.pastureName.forEach((item1)=>{
-            if(item.name == item1){
+      const pastureId = []
+      this.pastureList.forEach((item) => {
+        if (this.pastureName) {
+          this.pastureName.forEach((item1) => {
+            if (item.name == item1) {
               pastureId.push(item.id)
             }
           })
         }
       })
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-                + '&pastureId=' + pastureId.toString()
-      getJson(url,data).then(response => {
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio +
+                '&pastureId=' + pastureId.toString()
+      getJson(url, data).then(response => {
         console.log('牧场每月单头牛维修费对比==>图5', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data6.data1 = response.data.data3
           this.chart_data6.data_name = response.data.data1
           this.chart_data6.xdata = response.data.data2
-        }else{
+        } else {
           this.chart_data6.data1 = []
           this.chart_data6.data_name = []
           this.chart_data6.xdata = []
-          this.chart_data6.line =0
+          this.chart_data6.line = 0
         }
-        if(response.data.data1 == null){
+        if (response.data.data1 == null) {
           this.chart_data6.data_name = []
         }
-        if(response.data.data2 == null ){
+        if (response.data.data2 == null) {
           this.chart_data6.xdata = []
           this.getChart7Parm.parammaps.date = ''
-        }else{
+        } else {
           this.getChart7Parm.parammaps.date = response.data.data2[0]
         }
-        if(response.data.data3 == null){
+        if (response.data.data3 == null) {
           this.chart_data6.data1 = []
         }
         this.roadChart6(this.chart_data6)
@@ -540,43 +537,43 @@ export default {
     },
     // XX月部门统计
     getChart7() {
-      let startTime = parseTime(this.getChart7Parm.parammaps.date,'{y}-{m}') + '-01'
-      let date =  new Date(this.getChart7Parm.parammaps.date);
-      let year = date.getFullYear()
-      let month = date.getMonth() + 1
-      let lastDay = new Date(year, month, 0).getDate();
-      let endTime = parseTime(this.getChart7Parm.parammaps.date,'{y}-{m}') + '-' + lastDay
-      let data = {
-        name:"getdeptSumMonth",
-        parammaps:{
-          startTime:startTime,
-          endTime:endTime,
-          pastureName:this.pastureName.toString(),
-          departmentName:this.getChart7Parm.parammaps.deptName
-        },
+      const startTime = parseTime(this.getChart7Parm.parammaps.date, '{y}-{m}') + '-01'
+      const date = new Date(this.getChart7Parm.parammaps.date)
+      const year = date.getFullYear()
+      const month = date.getMonth() + 1
+      const lastDay = new Date(year, month, 0).getDate()
+      const endTime = parseTime(this.getChart7Parm.parammaps.date, '{y}-{m}') + '-' + lastDay
+      const data = {
+        name: 'getdeptSumMonth',
+        parammaps: {
+          startTime: startTime,
+          endTime: endTime,
+          pastureName: this.pastureName.toString(),
+          departmentName: this.getChart7Parm.parammaps.deptName
+        }
       }
       GetDataByName(data).then(response => {
         console.log('XX月部门统计==>图6', response)
         // this.chart_data7 = response.data.chart_data
-        if(response.data){
+        if (response.data) {
           var data1 = []
           var data2 = []
           var xdata = []
-          response.data.list.forEach((item)=>{
+          response.data.list.forEach((item) => {
             data1.push(item.value)
             data2.push(item.monthBudget)
             xdata.push(item.name)
           })
           this.chart_data7 = {
-            data1:data1,
-            data2:data2,
-            xdata:xdata
+            data1: data1,
+            data2: data2,
+            xdata: xdata
           }
-        }else{
+        } else {
           this.chart_data7 = {
-            data1:[],
-            data2:[],
-            xdata:[]
+            data1: [],
+            data2: [],
+            xdata: []
           }
         }
         this.roadChart7(this.chart_data7)
@@ -598,20 +595,20 @@ export default {
         },
         color: ['#61A5E8', '#9933FF'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        xAxis: [{ type: 'category', name: '牧场', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
         yAxis: [{ type: 'value', name: '费用(元)', axisLabel: { formatter: '{value}万' }}],
         series: [
           {
             name: '实际费用',
             type: 'bar',
             data: chart_data.data1,
-            barMaxWidth:20,
+            barMaxWidth: 20,
             emphasis: { label: { show: true, position: 'inside' }}
           },
           {
             name: '预算',
             type: 'bar',
-            barMaxWidth:20,
+            barMaxWidth: 20,
             data: chart_data.data2,
             emphasis: { label: { show: true, position: 'inside' }}
           }
@@ -636,27 +633,27 @@ export default {
       }
       this.chart2 = echarts.init(document.getElementById('chart2'))
       var option = {
-        title: { text: '单头牛维修费用', left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: '单头牛维修费用', left: 'center', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: ['实际费用', '预算'],
           right: 40
         },
-        color:  ['#61A5E8', '#9933FF','#FFB800'],
+        color: ['#61A5E8', '#9933FF', '#FFB800'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value', name: '费用(元)'}],
+        xAxis: [{ type: 'category', name: '牧场', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '费用(元)' }],
         series: [
           {
             name: '实际费用',
             type: 'bar',
             data: chart_data.data1,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20,
-            markLine:{
-              data:[ {yAxis:chart_data.line} ],
+            barMaxWidth: 20,
+            markLine: {
+              data: [{ yAxis: chart_data.line }],
               lineStyle: {
-                  color: '#FFB800'
+                color: '#FFB800'
               }
             }
           },
@@ -665,7 +662,7 @@ export default {
             type: 'bar',
             data: chart_data.data2,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20
+            barMaxWidth: 20
           }
 
         ]
@@ -681,24 +678,24 @@ export default {
     },
     // XX牧场每月维修费对比
     roadChart4(chart_data) {
-      console.log(chart_data,'666')
+      console.log(chart_data, '666')
       if (this.chart4 != null) {
         this.chart4.dispose()
       }
       this.chart4 = echarts.init(document.getElementById('chart4'))
-      var text = this.pastureName +'每月维修费对比'
+      var text = this.pastureName + '每月维修费对比'
       var option = {
-        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
+        title: { text: text, left: 'left', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: chart_data.data_name,
           left: 40,
-          bottom:0
+          bottom: 0
         },
-        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
+        color: ['#eb123a', '#eba612', '#124feb', '#15ab2e', '#b20fdb'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '月份',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value', name: '费用(元)'}],
+        xAxis: [{ type: 'category', name: '月份', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '费用(元)' }],
         series: [{
           name: '去年同期用量',
           type: 'line',
@@ -708,7 +705,7 @@ export default {
           name: '今年用量',
           type: 'line',
           data: chart_data.data2[0]
-        },{
+        }, {
           name: '预算',
           type: 'line',
           data: chart_data.data3[0]
@@ -733,23 +730,23 @@ export default {
       this.chart5 = echarts.init(document.getElementById('chart5'))
       var text = this.pastureName + this.getChart5Parm.parammaps.deptName + '维修费用'
       var option = {
-        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
+        title: { text: text, left: 'left', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           right: 40,
-          bottom:0
+          bottom: 0
         },
         color: ['#2dc0e8', '#769cfc'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '设备',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value',name: '费用(元)', axisLabel: { formatter:'{value} 万'}}],
+        xAxis: [{ type: 'category', name: '设备', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '费用(元)', axisLabel: { formatter: '{value} 万' }}],
         series: [
           {
             type: 'bar',
             data: chart_data.data1,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20
-          },
+            barMaxWidth: 20
+          }
         ]
       }
       this.chart5.setOption(option)
@@ -773,20 +770,20 @@ export default {
       this.chart6 = echarts.init(document.getElementById('chart6'))
       var text = '牧场每月单头牛维修费对比'
       var option = {
-        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
+        title: { text: text, left: 'left', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: chart_data.data_name,
           right: 40,
-          bottom:0
+          bottom: 0
         },
-        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
+        color: ['#eb123a', '#eba612', '#124feb', '#15ab2e', '#b20fdb'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '月份',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value',name: '费用(元)'}],
+        xAxis: [{ type: 'category', name: '月份', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '费用(元)' }],
         series: (function() {
           var serie = []
-          if(chart_data.data1 !== null){
+          if (chart_data.data1 !== null) {
             for (var i = 0; i < chart_data.data1.length; i++) {
               var item = {
                 name: chart_data.data_name[i],
@@ -812,38 +809,38 @@ export default {
     },
     // XX月部门统计
     roadChart7(chart_data) {
-      console.log(chart_data,'chart_data')
+      console.log(chart_data, 'chart_data')
       if (this.chart7 != null) {
         this.chart7.dispose()
       }
       this.chart7 = echarts.init(document.getElementById('chart7'))
       var text = this.getChart7Parm.parammaps.date + '月部门统计'
       var option = {
-        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
+        title: { text: text, left: 'left', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
-          data: ['实际','预算'],
+          data: ['实际', '预算'],
           left: 40,
-          bottom:0
+          bottom: 0
         },
         color: ['#61A5E8', '#9933FF'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '部门',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value', name: '费用(元)'}],
+        xAxis: [{ type: 'category', name: '部门', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '费用(元)' }],
         series: [
           {
             name: '实际',
             type: 'bar',
             data: chart_data.data1,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20
+            barMaxWidth: 20
           },
           {
             name: '预算',
             type: 'bar',
             data: chart_data.data2,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20
+            barMaxWidth: 20
           }
         ]
       }
@@ -924,7 +921,7 @@ export default {
           json2excel(ExcelDatas, '设备维修费用', true, 'xlsx')
         })
       })
-    },
+    }
   }
 }
 </script>

+ 215 - 216
src/views/report/queryWater/index.vue

@@ -10,12 +10,12 @@
       <p style="position: absolute;top:-12px;left:40%;color:rgb(130, 165, 252);background:rgb(230, 243, 255);border:1px solid rgb(130, 165, 252);padding:10px;border-radius:10px">
         集团用水量:{{ total }}吨
       </p>
-       <el-radio-group v-model="radio1" class="group" @change="changeGroup">
-          <el-radio :label="'集团'">集团</el-radio>
-          <el-radio :label="'一中心'"></el-radio>
-          <el-radio :label="'二中心'"></el-radio>
-          <el-radio :label="'三中心'"></el-radio>
-        </el-radio-group>
+      <el-radio-group v-model="radio1" class="group" @change="changeGroup">
+        <el-radio :label="'集团'">集团</el-radio>
+        <el-radio :label="'一中心'" />
+        <el-radio :label="'二中心'" />
+        <el-radio :label="'三中心'" />
+      </el-radio-group>
       <el-col :span="24">
         <div id="chart1" style="width: 100%;height:400px;" />
       </el-col>
@@ -40,16 +40,16 @@
     <el-row style="position: relative;">
       <el-col :span="12">
         <div style="height: 50px;">
-          <el-select style="float: right;margin-right: 20px;" v-model="pastureName" multiple :multiple-limit="5" collapse-tags placeholder="牧场" @change="changePasture()">
-            <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
+          <el-select v-model="pastureName" style="float: right;margin-right: 20px;" multiple :multiple-limit="5" collapse-tags placeholder="牧场" @change="changePasture()">
+            <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.name" />
           </el-select>
         </div>
         <div id="chart4" style="width: 100%;height:400px;" />
       </el-col>
       <el-col :span="12">
         <div style="height: 50px;">
-          <el-select style="float: right;margin-right: 20px;" v-model="getChart5Parm.parammaps.deptName" placeholder="部门" @change="changeDept('5')">
-            <el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
+          <el-select v-model="getChart5Parm.parammaps.deptName" style="float: right;margin-right: 20px;" placeholder="部门" @change="changeDept('5')">
+            <el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.name" />
           </el-select>
         </div>
         <div id="chart5" style="width: 100%;height:400px;" />
@@ -70,21 +70,21 @@
 
 <script>
 import echarts from 'echarts'
-import { GetDataByName,GetDataByNames, GetReportform, checkButtons,getJson } from '@/api/common'
+import { GetDataByName, GetDataByNames, GetReportform, checkButtons, getJson } from '@/api/common'
 import Cookies from 'js-cookie'
 import { parseTime } from '@/utils/index.js'
 export default {
   name: 'QueryWater',
   data() {
     return {
-      monthDate: [new Date(),new Date()],
+      monthDate: [new Date(), new Date()],
       year: new Date().getFullYear(),
       month: new Date().getMonth() < 9 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1,
-      pastureList:[],
-      deptList:[{id:0,name:'挤奶处'},{id:1,name:'犊牛处'},{id:2,name:'办公室'},{id:3,name:'饲养处'},{id:4,name:'兽医处'},{id:5,name:'品控处'},{id:6,name:'设备处'}],
+      pastureList: [],
+      deptList: [{ id: 0, name: '挤奶处' }, { id: 1, name: '犊牛处' }, { id: 2, name: '办公室' }, { id: 3, name: '饲养处' }, { id: 4, name: '兽医处' }, { id: 5, name: '品控处' }, { id: 6, name: '设备处' }],
       total: '',
-      radio1:'集团',
-      pastureName:'',
+      radio1: '集团',
+      pastureName: '',
       isChart1: [],
       chart_data1: {},
       getChart1Parm: {
@@ -114,7 +114,6 @@ export default {
         }
       },
 
-
       isChart4: [],
       chart_data4: {},
       getChart4Parm: {
@@ -132,7 +131,7 @@ export default {
         parammaps: {
           receiveTime: new Date().getFullYear(),
           pastureName: Cookies.get('pasturename'),
-          deptName:''
+          deptName: ''
         }
       },
 
@@ -162,7 +161,7 @@ export default {
           receiveTime: new Date().getFullYear(),
           pastureName: Cookies.get('pasturename')
         }
-      },
+      }
     }
   },
   created() {
@@ -177,42 +176,42 @@ export default {
   },
   methods: {
     get_select_list() {
-      var send_data =  [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+      var send_data = [
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
       ]
       this.pastureList = []
       GetDataByNames(send_data).then(response => {
-        response.data.findAllPasture.list.forEach((item)=>{
-          if(item.name !== '现代牧业'){
+        response.data.getPastureRoleList.list.forEach((item) => {
+          if (item.name !== '现代牧业') {
             this.pastureList.push(item)
           }
         })
       })
     },
-    changeGroup(){
+    changeGroup() {
       this.getChart1()
       this.getChart2()
       this.getChart3()
       this.getChart8()
     },
-    changeMonth(){
-      if(this.isChart1){
+    changeMonth() {
+      if (this.isChart1) {
         this.getChart1()
         this.getChart2()
         this.getChart3()
         this.getChart8()
-      }else{
+      } else {
         this.pastureName = [Cookies.get('pasturename')]
         this.getChart4()
         this.getChart6()
       }
     },
-    changePasture(){
+    changePasture() {
       this.getChart4()
       this.getChart6()
     },
-    changeDept(item){
-      if(item == 5){
+    changeDept(item) {
+      if (item == 5) {
         this.getChart5()
       }
     },
@@ -221,12 +220,12 @@ export default {
       const chart1 = 'report:queryWater:pastures'
       const isChart1 = checkButtons(this.$store.state.user.buttons, chart1)
       this.isChart1 = isChart1
-      if(this.isChart1){
+      if (this.isChart1) {
         this.getChart1()
         this.getChart2()
         this.getChart3()
         this.getChart8()
-      }else{
+      } else {
         this.pastureName = [Cookies.get('pasturename')]
         this.getChart4()
         this.getChart6()
@@ -234,27 +233,27 @@ export default {
     },
     // 各牧场年度用水量对比
     getChart1() {
-      let url = '/authdata/water/nowwater?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
+      const url = '/authdata/water/nowwater?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
       let radio = ''
-      if(this.radio1 == '集团'){
+      if (this.radio1 == '集团') {
         radio = ''
-      }else{
+      } else {
         radio = this.radio1
       }
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-      getJson(url,data).then(response => {
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio
+      getJson(url, data).then(response => {
         console.log('各牧场年度用水量对比==>图1', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data1.data1 = response.data.nowYear
           this.chart_data1.data2 = response.data.lastYear
           this.chart_data1.xdata = response.data.pasture
           this.pastureName = [response.data.pasture[0]]
           this.total = response.data.all
-        }else{
+        } else {
           this.chart_data1.data1 = []
           this.chart_data1.data2 = []
           this.chart_data1.xdata = []
@@ -267,26 +266,26 @@ export default {
     },
     // 单头牛水量
     getChart2() {
-      let url = '/authdata/water/singlecow?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
+      const url = '/authdata/water/singlecow?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
       let radio = ''
-      if(this.radio1 == '集团'){
+      if (this.radio1 == '集团') {
         radio = ''
-      }else{
+      } else {
         radio = this.radio1
       }
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-      getJson(url,data).then(response => {
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio
+      getJson(url, data).then(response => {
         console.log('单头牛水量==>图2', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data2.data1 = response.data.nowYear
           this.chart_data2.data2 = response.data.lastYear
           this.chart_data2.xdata = response.data.pasture
           this.chart_data2.line = response.data.line
-        }else{
+        } else {
           this.chart_data2.data1 = []
           this.chart_data2.data2 = []
           this.chart_data2.xdata = []
@@ -298,28 +297,28 @@ export default {
 
     // 单头牛水费
     getChart3() {
-      let url = '/authdata/water/waterrate?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
+      const url = '/authdata/water/waterrate?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
       let radio = ''
-      if(this.radio1 == '集团'){
+      if (this.radio1 == '集团') {
         radio = ''
-      }else{
+      } else {
         radio = this.radio1
       }
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-      getJson(url,data).then(response => {
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio
+      getJson(url, data).then(response => {
         console.log('单头牛水费==>图3', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data3.data1 = response.data.actual
           this.chart_data3.xdata = response.data.pasture
           this.chart_data3.line = response.data.line
-        }else{
+        } else {
           this.chart_data3.data1 = []
           this.chart_data3.xdata = []
-          this.chart_data3.line =0
+          this.chart_data3.line = 0
         }
         this.roadChart3(this.chart_data3)
       })
@@ -328,53 +327,53 @@ export default {
     // 牧场每月单头牛用水量对比
     getChart4() {
       this.getChart5Parm.parammaps.deptName = this.deptList[0].name
-      let url = '/authdata/water/perhead?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
+      const url = '/authdata/water/perhead?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
       let radio = ''
-      if(this.radio1 == '集团'){
+      if (this.radio1 == '集团') {
         radio = ''
-      }else{
+      } else {
         radio = this.radio1
       }
-      let pastureId = []
-      console.log(this.pastureList,'pastureList')
-      this.pastureList.forEach((item)=>{
-        if(this.pastureName){
-          this.pastureName.forEach((item1)=>{
-            if(item.name == item1){
+      const pastureId = []
+      console.log(this.pastureList, 'pastureList')
+      this.pastureList.forEach((item) => {
+        if (this.pastureName) {
+          this.pastureName.forEach((item1) => {
+            if (item.name == item1) {
               pastureId.push(item.id)
             }
           })
         }
       })
-      console.log(pastureId,'pastureId')
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-                + '&pastureId=' + pastureId.toString()
-      getJson(url,data).then(response => {
+      console.log(pastureId, 'pastureId')
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio +
+                '&pastureId=' + pastureId.toString()
+      getJson(url, data).then(response => {
         console.log('牧场每月单头牛用水量对比==>图5', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data4.data1 = response.data.data3
           this.chart_data4.data_name = response.data.data1
           this.chart_data4.xdata = response.data.data2
-        }else{
+        } else {
           this.chart_data4.data1 = []
           this.chart_data4.data_name = []
           this.chart_data4.xdata = []
-          this.chart_data4.line =0
+          this.chart_data4.line = 0
         }
-        if(response.data.data1 == null){
+        if (response.data.data1 == null) {
           this.chart_data4.data_name = []
         }
-        if(response.data.data2 == null ){
+        if (response.data.data2 == null) {
           this.chart_data4.xdata = []
           this.getChart5Parm.parammaps.date = ''
-        }else{
+        } else {
           this.getChart5Parm.parammaps.date = response.data.data2[0]
         }
-        if(response.data.data3 == null){
+        if (response.data.data3 == null) {
           this.chart_data4.data1 = []
         }
         this.roadChart4(this.chart_data4)
@@ -383,75 +382,75 @@ export default {
     },
     // XX月部门统计
     getChart5() {
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}') + '-01'
-      let date = this.monthDate[1];
-      let year = date.getFullYear()
-      let month = date.getMonth() + 1
-      let lastDay = new Date(year, month, 0).getDate();
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}') + '-' + lastDay
-      let data = {
-        name:"getdeptSumMonthWater",
-        parammaps:{
-          startTime:startTime,
-          endTime:endTime,
-          pastureName:this.pastureName.toString(),
-          deptname:this.getChart5Parm.parammaps.deptName,
-        },
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}') + '-01'
+      const date = this.monthDate[1]
+      const year = date.getFullYear()
+      const month = date.getMonth() + 1
+      const lastDay = new Date(year, month, 0).getDate()
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}') + '-' + lastDay
+      const data = {
+        name: 'getdeptSumMonthWater',
+        parammaps: {
+          startTime: startTime,
+          endTime: endTime,
+          pastureName: this.pastureName.toString(),
+          deptname: this.getChart5Parm.parammaps.deptName
+        }
       }
       GetDataByName(data).then(response => {
         console.log('XX月部门统计==>图6', response)
-        let data1 = []
-        let xdata = []
-        if(response.data){
-          response.data.list.forEach((item)=>{
+        const data1 = []
+        const xdata = []
+        if (response.data) {
+          response.data.list.forEach((item) => {
             data1.push(item.value)
             xdata.push(item.name)
           })
         }
         this.chart_data5 = {
-          data1:data1,
-          xdata:xdata
+          data1: data1,
+          xdata: xdata
         }
         this.roadChart5(this.chart_data5)
       })
     },
     // XX牧场XX年每月用水量对比
     getChart6() {
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}') + '-01'
-      let date = this.monthDate[1];
-      let year = date.getFullYear()
-      let month = date.getMonth() + 1
-      let lastDay = new Date(year, month, 0).getDate();
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}') + '-' + lastDay
-      let data = {
-        name:"getPastureSumMonthWater",
-        parammaps:{
-          startTime:startTime,
-          endTime:endTime,
-          pastureName:this.pastureName.toString(),
-        },
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}') + '-01'
+      const date = this.monthDate[1]
+      const year = date.getFullYear()
+      const month = date.getMonth() + 1
+      const lastDay = new Date(year, month, 0).getDate()
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}') + '-' + lastDay
+      const data = {
+        name: 'getPastureSumMonthWater',
+        parammaps: {
+          startTime: startTime,
+          endTime: endTime,
+          pastureName: this.pastureName.toString()
+        }
       }
       GetReportform(data).then(response => {
         console.log('牧场每月用水量对比==>图7', response)
         // this.chart_data6 = response.data.chart_data
-        if(response.data){
+        if (response.data) {
           this.chart_data6 = {
-            data1:response.data.chart_data.nowYear,
+            data1: response.data.chart_data.nowYear,
             // data2:response.data.chart_data.nowYear,
-            xdata:response.data.chart_data.months,
-            data_name:response.data.chart_data.pastureName
+            xdata: response.data.chart_data.months,
+            data_name: response.data.chart_data.pastureName
           }
-        }else{
+        } else {
           this.chart_data6 = {
-            data1:[],
-            data2:[],
-            xdata:[],
-            data_name:[]
+            data1: [],
+            data2: [],
+            xdata: [],
+            data_name: []
           }
         }
-        if(response.data.chart_data.months){
+        if (response.data.chart_data.months) {
           this.getChart7Parm.parammaps.date = response.data.chart_data.months[0]
-        }else{
+        } else {
           this.getChart7Parm.parammaps.date = ''
         }
 
@@ -461,30 +460,30 @@ export default {
     },
     // XX月每日用水量
     getChart7() {
-      let startTime = this.getChart7Parm.parammaps.date
-      let endTime = this.getChart7Parm.parammaps.date
-      let data = {
-        name:"getPastureSumDayWater",
-        parammaps:{
-          startTime:startTime,
-          endTime:endTime,
-          pastureName:this.pastureName.toString(),
-        },
+      const startTime = this.getChart7Parm.parammaps.date
+      const endTime = this.getChart7Parm.parammaps.date
+      const data = {
+        name: 'getPastureSumDayWater',
+        parammaps: {
+          startTime: startTime,
+          endTime: endTime,
+          pastureName: this.pastureName.toString()
+        }
       }
       GetReportform(data).then(response => {
         console.log('XX月每日用水量==>图8', response)
         // this.chart_data7 = response.data.chart_data
-        if(response.data){
+        if (response.data) {
           this.chart_data7 = {
-            data1:response.data.chart_data.nowYear,
-            data_name:this.pastureName,
-            xdata:response.data.chart_data.day
+            data1: response.data.chart_data.nowYear,
+            data_name: this.pastureName,
+            xdata: response.data.chart_data.day
           }
-        }else{
+        } else {
           this.chart_data7 = {
-            data1:[],
-            data_name:[],
-            xdata:[]
+            data1: [],
+            data_name: [],
+            xdata: []
           }
         }
         this.roadChart7(this.chart_data7)
@@ -492,24 +491,24 @@ export default {
     },
     // 水费完成率
     getChart8() {
-      let url = '/authdata/water/ratecomplete?'
-      let startTime = parseTime(this.monthDate[0],'{y}-{m}')
-      let endTime = parseTime(this.monthDate[1],'{y}-{m}')
-      let radio = ''
-      let data = 'startTime=' + startTime
-                + '&endTime=' + endTime
-                + '&center=' + radio
-      getJson(url,data).then(response => {
+      const url = '/authdata/water/ratecomplete?'
+      const startTime = parseTime(this.monthDate[0], '{y}-{m}')
+      const endTime = parseTime(this.monthDate[1], '{y}-{m}')
+      const radio = ''
+      const data = 'startTime=' + startTime +
+                '&endTime=' + endTime +
+                '&center=' + radio
+      getJson(url, data).then(response => {
         console.log('水费完成率==>图4', response)
-        if(response.data){
+        if (response.data) {
           this.chart_data8.data1 = response.data.actual
           this.chart_data8.data2 = response.data.budget
           this.chart_data8.data3 = response.data.complete
           this.chart_data8.xdata = response.data.pasture
-        }else{
+        } else {
           this.chart_data8.data1 = []
-          this.chart_data8.data2= []
-          this.chart_data8.data3= []
+          this.chart_data8.data2 = []
+          this.chart_data8.data3 = []
           this.chart_data8.xdata = []
         }
         this.roadChart8(this.chart_data8)
@@ -530,20 +529,20 @@ export default {
         },
         color: ['#61A5E8', '#9933FF'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        xAxis: [{ type: 'category', name: '牧场', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
         yAxis: [{ type: 'value', name: '用量(吨)', axisLabel: { formatter: '{value}万' }}],
         series: [
           {
             name: '今年用量',
             type: 'bar',
             data: chart_data.data1,
-            barMaxWidth:20,
+            barMaxWidth: 20,
             emphasis: { label: { show: true, position: 'inside' }}
           },
           {
             name: '去年同期',
             type: 'bar',
-            barMaxWidth:20,
+            barMaxWidth: 20,
             data: chart_data.data2,
             emphasis: { label: { show: true, position: 'inside' }}
           }
@@ -568,25 +567,25 @@ export default {
       }
       this.chart2 = echarts.init(document.getElementById('chart2'))
       var option = {
-        title: { text: '单头牛水量', left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: '单头牛水量', left: 'center', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: ['实际用量', '去年同期'],
           right: 40
         },
-        color:  ['#61A5E8', '#9933FF','#FFB800'],
+        color: ['#61A5E8', '#9933FF', '#FFB800'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value', name: '用量(吨)'}],
+        xAxis: [{ type: 'category', name: '牧场', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '用量(吨)' }],
         series: [
           {
             name: '实际用量',
             type: 'bar',
             data: chart_data.data1,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20,
-            markLine:{
-              data:[ {yAxis:chart_data.line} ],
+            barMaxWidth: 20,
+            markLine: {
+              data: [{ yAxis: chart_data.line }],
               lineStyle: {
                 color: '#FFB800'
               }
@@ -597,7 +596,7 @@ export default {
             type: 'bar',
             data: chart_data.data2,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20
+            barMaxWidth: 20
           }
 
         ]
@@ -618,7 +617,7 @@ export default {
       }
       this.chart3 = echarts.init(document.getElementById('chart3'))
       var option = {
-        title: { text: '单头牛水费', left:'center',textStyle: { color: '#769cfc' }},
+        title: { text: '单头牛水费', left: 'center', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: ['实际费用'],
@@ -626,22 +625,22 @@ export default {
         },
         color: ['#61A5E8'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value', name: '费用(元)'}],
+        xAxis: [{ type: 'category', name: '牧场', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '费用(元)' }],
         series: [
           {
             name: '实际费用',
             type: 'bar',
             data: chart_data.data1,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20,
-            markLine:{
-              data:[ {yAxis:chart_data.line} ],
+            barMaxWidth: 20,
+            markLine: {
+              data: [{ yAxis: chart_data.line }],
               lineStyle: {
-                  color: '#FFB800'
+                color: '#FFB800'
               }
             }
-          },
+          }
 
         ]
       }
@@ -662,20 +661,20 @@ export default {
       // var text = '各牧场' + parseTime(this.monthDate, '{y}') + '年每月单头牛用水量对比'
       var text = '牧场每月单头牛用水量对比'
       var option = {
-        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
+        title: { text: text, left: 'left', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: chart_data.data_name,
           left: 40,
-          bottom:0
+          bottom: 0
         },
-        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
+        color: ['#eb123a', '#eba612', '#124feb', '#15ab2e', '#b20fdb'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '月份',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value', name: '用量(吨)'}],
+        xAxis: [{ type: 'category', name: '月份', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '用量(吨)' }],
         series: (function() {
           var serie = []
-          if(chart_data.data1 !== null){
+          if (chart_data.data1 !== null) {
             for (var i = 0; i < chart_data.data1.length; i++) {
               var item = {
                 name: chart_data.data_name[i],
@@ -707,23 +706,23 @@ export default {
       this.chart5 = echarts.init(document.getElementById('chart5'))
       var text = this.getChart5Parm.parammaps.date + '月部门统计'
       var option = {
-        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
+        title: { text: text, left: 'left', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           right: 40,
-          bottom:0
+          bottom: 0
         },
         color: ['#2dc0e8', '#769cfc'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '部门',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value',name: '用量(吨)', axisLabel: { formatter:'{value} 万'}}],
+        xAxis: [{ type: 'category', name: '部门', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '用量(吨)', axisLabel: { formatter: '{value} 万' }}],
         series: [
           {
             type: 'bar',
             data: chart_data.data1,
             emphasis: { label: { show: true, position: 'inside' }},
-            barMaxWidth:20
-          },
+            barMaxWidth: 20
+          }
         ]
       }
       this.chart5.setOption(option)
@@ -743,20 +742,20 @@ export default {
       this.chart6 = echarts.init(document.getElementById('chart6'))
       var text = '牧场每月用水量对比'
       var option = {
-        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
+        title: { text: text, left: 'left', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: chart_data.data_name,
           right: 40,
-          bottom:0
+          bottom: 0
         },
-        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
+        color: ['#eb123a', '#eba612', '#124feb', '#15ab2e', '#b20fdb'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '月份',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value',name: '水量(吨)'}],
+        xAxis: [{ type: 'category', name: '月份', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '水量(吨)' }],
         series: (function() {
           var serie = []
-          if(chart_data.data1 !== null){
+          if (chart_data.data1 !== null) {
             for (var i = 0; i < chart_data.data1.length; i++) {
               var item = {
                 name: chart_data.data_name[i],
@@ -798,27 +797,27 @@ export default {
     },
     // XX月每日用水量
     roadChart7(chart_data) {
-      console.log(chart_data,'chart_data')
+      console.log(chart_data, 'chart_data')
       if (this.chart7 != null) {
         this.chart7.dispose()
       }
       this.chart7 = echarts.init(document.getElementById('chart7'))
       var text = this.getChart7Parm.parammaps.date + '月每日用水量'
       var option = {
-        title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
+        title: { text: text, left: 'left', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
           data: chart_data.data_name,
           left: 40,
-          bottom:0
+          bottom: 0
         },
-        color: ['#eb123a','#eba612','#124feb','#15ab2e','#b20fdb'],
+        color: ['#eb123a', '#eba612', '#124feb', '#15ab2e', '#b20fdb'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '日',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
-        yAxis: [{ type: 'value', name: '水量(吨)'}],
+        xAxis: [{ type: 'category', name: '日', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        yAxis: [{ type: 'value', name: '水量(吨)' }],
         series: (function() {
           var serie = []
-          if(chart_data.data1 !== null){
+          if (chart_data.data1 !== null) {
             for (var i = 0; i < chart_data.data1.length; i++) {
               var item = {
                 name: chart_data.data_name[i],
@@ -847,23 +846,23 @@ export default {
       }
       this.chart8 = echarts.init(document.getElementById('chart8'))
       var option = {
-        title: { text: '水费完成率',left:'center', textStyle: { color: '#769cfc' }},
+        title: { text: '水费完成率', left: 'center', textStyle: { color: '#769cfc' }},
         tooltip: { trigger: 'axis' },
         legend: {
-          data: ['实际费用', '预算','完成率'],
+          data: ['实际费用', '预算', '完成率'],
           right: 40
         },
-        color: ['#61A5E8', '#7ECF51','#FFFF00'],
+        color: ['#61A5E8', '#7ECF51', '#FFFF00'],
         grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
-        xAxis: [{ type: 'category',  name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
+        xAxis: [{ type: 'category', name: '牧场', data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
         yAxis: [
           { type: 'value', name: '费用(元)', axisLabel: { formatter: '{value}' }},
-          { type: 'value', name: '', axisLabel: { formatter: '{value}%' },splitLine:{show: false}}
+          { type: 'value', name: '', axisLabel: { formatter: '{value}%' }, splitLine: { show: false }}
         ],
         series: [
-          { name: '实际费用', type: 'bar', data: chart_data.data1, barMaxWidth:20, emphasis: { label: { show: true, position: 'inside' }} },
-          { name: '预算', type: 'bar', barMaxWidth:20, data: chart_data.data2, emphasis: { label: { show: true, position: 'inside' }} },
-          { name: '完成率', type: 'line',yAxisIndex: 1, data: chart_data.data3, emphasis: { label: { show: true, position: 'inside' }} }
+          { name: '实际费用', type: 'bar', data: chart_data.data1, barMaxWidth: 20, emphasis: { label: { show: true, position: 'inside' }}},
+          { name: '预算', type: 'bar', barMaxWidth: 20, data: chart_data.data2, emphasis: { label: { show: true, position: 'inside' }}},
+          { name: '完成率', type: 'line', yAxisIndex: 1, data: chart_data.data3, emphasis: { label: { show: true, position: 'inside' }}}
         ]
       }
       this.chart8.setOption(option)
@@ -874,7 +873,7 @@ export default {
       this.chart8.on('click', function(param, i) {
         console.log(param)
       })
-    },
+    }
   }
 }
 </script>

+ 52 - 63
src/views/report/repairRecord/index.vue

@@ -13,20 +13,18 @@
       </el-select>
       <el-input v-model="getdataListParm.parammaps.empname" placeholder="姓名" style="width: 200px;" class="filter-item" />
       <el-date-picker
-            ref="inputDatetime"
-            v-model="getdataListParm.parammaps.inputDatetime"
-            class="inputDatetime"
-            type="datetimerange"
-            style="width: 280px;top:-3px;"
-            format="yyyy-MM-dd"
-            value-format="yyyy-MM-dd"
-            range-separator="至"
-            start-placeholder="时间"
-            end-placeholder="时间"
-            :picker-options="pickerOptions"
-          />
-
-
+        ref="inputDatetime"
+        v-model="getdataListParm.parammaps.inputDatetime"
+        class="inputDatetime"
+        type="datetimerange"
+        style="width: 280px;top:-3px;"
+        format="yyyy-MM-dd"
+        value-format="yyyy-MM-dd"
+        range-separator="至"
+        start-placeholder="时间"
+        end-placeholder="时间"
+        :picker-options="pickerOptions"
+      />
 
       <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
       <el-button class="filter-item" type="success" icon="el-icon-download" @click="handleDownload">导出</el-button>
@@ -53,7 +51,6 @@
         <el-table-column label="月份" align="center" prop="date" />
         <el-table-column label="牧场" align="center" prop="pasturename" />
 
-
         <el-table-column label="部门" align="center" prop="departmentName" />
         <el-table-column label="姓名" align="center" prop="empname" />
         <el-table-column label="报修次数" align="center" prop="count" />
@@ -80,14 +77,12 @@ export default {
     return {
       findAllPasture: [], findAllDepart: [],
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
       disabled: false, placeholder: '请选择设备类别',
 
-
-
-
       getRecuListParm: { name: 'getAssetTypeList', idname: 'id', params: [-1] },
       tableKey: 0,
       list: [
@@ -96,30 +91,29 @@ export default {
 
       selectData: '',
       pickerMinDate: '',
-      pickerRange:3600 * 1000 * 24 * 60,
+      pickerRange: 3600 * 1000 * 24 * 60,
       pickerOptions: {
-        onPick:({maxDate,minDate }) => {
+        onPick: ({ maxDate, minDate }) => {
           if (minDate && this.pickerMinDate) {
             this.pickerMinDate = null
           } else if (minDate) {
             this.pickerMinDate = minDate.getTime()
           }
-       },
+        },
         disabledDate: (time) => {
           if (this.pickerMinDate) {
-              return (time.getTime() > (this.pickerMinDate + this.pickerRange))  ||(time.getTime() < (this.pickerMinDate - this.pickerRange))
+            return (time.getTime() > (this.pickerMinDate + this.pickerRange)) || (time.getTime() < (this.pickerMinDate - this.pickerRange))
           }
-        return false
-        },
+          return false
+        }
       },
 
-
       total: 0,
       listLoading: true,
       getdataListParm: {
-        name: 'getRecordsOfRepairman', page: 1, offset: 1, pagecount: 10, returntype: 'Map',inputDatetime: '',
-        parammaps: { pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), departmentName: '', eqClassId: '', startTime: "",
-        stopTime: "",departmentId: "" ,inputDatetime: [parseTime(new Date().getTime() - 30 * 24 * 60 * 60 * 1000, '{y}-{m}-{d}'), parseTime(new Date().getTime() - 24 * 60 * 60 * 1000, '{y}-{m}-{d}')],}
+        name: 'getRecordsOfRepairman', page: 1, offset: 1, pagecount: 10, returntype: 'Map', inputDatetime: '',
+        parammaps: { pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), departmentName: '', eqClassId: '', startTime: '',
+          stopTime: '', departmentId: '', inputDatetime: [parseTime(new Date().getTime() - 30 * 24 * 60 * 60 * 1000, '{y}-{m}-{d}'), parseTime(new Date().getTime() - 24 * 60 * 60 * 1000, '{y}-{m}-{d}')] }
       },
       requestParam: { name: 'insertAsset', offset: 0, pagecount: 0, parammaps: {}}, statueReason: false,
       downLoadParm: {},
@@ -131,49 +125,48 @@ export default {
       isokDisable: false,
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
   created() {
     this.get_select_list()
-     this.get_table_data()
-
+    this.get_table_data()
   },
   methods: {
 
     getSummaries1(param) {
-        const { columns, data } = param;
-        const sums = [];
-        columns.forEach((column, index) => {
-          if (index === 0) {
-              sums[index] = '合计';
-            return;
-          }
-          const values = data.map(item => Number(item[column.property]));
-          console.log(column.property)
-          console.log(values)
-          if (!values.every(value => isNaN(value))) {
-            sums[index] = values.reduce((prev, curr) => {
-              const value = Number(curr);
-              if (!isNaN(value)) {
-                return prev + curr;
-              } else {
-                return prev;
-              }
-            }, 0);
-            // sums[index] += ' 元';
-          } else {
-            sums[index] = '-';
-          }
-        });
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        }
+        const values = data.map(item => Number(item[column.property]))
+        console.log(column.property)
+        console.log(values)
+        if (!values.every(value => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+              return prev + curr
+            } else {
+              return prev
+            }
+          }, 0)
+          // sums[index] += ' 元';
+        } else {
+          sums[index] = '-'
+        }
+      })
 
-        return sums;
+      return sums
     },
 
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         if (response.data.list !== null) {
-          this.findAllPasture = response.data.findAllPasture.list
+          this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
           this.getDepartDownList()
         }
       })
@@ -224,8 +217,6 @@ export default {
       this.get_table_data()
     },
 
-
-
     tableCellStyle({ row, column, rowIndex, columnIndex }) {
       // if (columnIndex === 3) {
       //   return {
@@ -237,7 +228,6 @@ export default {
       // }
     },
 
-
     handleDownload() {
       this.$alert('报修人记录正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
       this.isPercentage = true
@@ -264,7 +254,7 @@ export default {
         const elecExcelDatas = [
           {
             tHeader: ['牧场', '月份', '部门', '姓名', '报修次数'],
-            filterVal: ['pasturename', 'date', 'departmentName', 'empname', 'count' ],
+            filterVal: ['pasturename', 'date', 'departmentName', 'empname', 'count'],
             tableDatas: this.downLoadList,
             sheetName: '报修人记录'
           }
@@ -273,7 +263,6 @@ export default {
       })
     }
 
-
   }
 }
 </script>

+ 5 - 4
src/views/report/sparePartReceive/index.vue

@@ -39,8 +39,8 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
-      @sort-change="tableSort"
       :max-height="myHeight"
+      @sort-change="tableSort"
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
@@ -128,7 +128,8 @@ export default {
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
       findAllPasture: [],
-      requestParams: [{ name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}],
+      requestParams: [{ name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}],
       laidTypes: [{ id: 0, name: '入库' }, { id: 1, name: '出库' }, { id: 2, name: '退库' }, { id: 3, name: '退货' }],
       tableKey: 0,
       list: [],
@@ -151,7 +152,7 @@ export default {
       downLoadList: [],
       isPercentage: false,
       percentage: 1,
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
 
@@ -166,7 +167,7 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
       })
     },
     get_table_data() {

+ 4 - 3
src/views/report/sparePartsSafety/index.vue

@@ -87,7 +87,8 @@ export default {
       rules: {},
       findAllPasture: [],
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getdataListParm: {
         name: 'getprsafetyList',
@@ -107,7 +108,7 @@ export default {
       downLoadList: [],
       isPercentage: false,
       percentage: 1,
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
   created() {
@@ -117,7 +118,7 @@ export default {
   methods: {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
       })
     },
     get_table_data() {

+ 4 - 3
src/views/report/standingBook/index.vue

@@ -43,7 +43,8 @@ export default {
       disabled: false,
       findAllPasture: [],
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       rowStyle: { maxHeight: 30 + 'px', height: 25 + 'px' },
       cellStyle: { padding: 0 + 'px' },
@@ -76,7 +77,7 @@ export default {
       downLoadList: [],
       isPercentage: false,
       percentage: 1,
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
   computed: {
@@ -97,7 +98,7 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
       })
     },
     get_table_data() {

+ 54 - 70
src/views/report/stopRecord/index.vue

@@ -5,33 +5,30 @@
       <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
       <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
     </div>
-  
+
     <div class="filter-container">
       <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 120px;" @change="changePastureName">
         <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
       </el-select>
-     
 
       <el-date-picker
-            ref="inputDatetime"
-            v-model="getdataListParm.parammaps.inputDatetime"
-            class="inputDatetime"
-            type="datetimerange"
-            style="width: 280px;top:-3px;"
-            format="yyyy-MM-dd"
-            value-format="yyyy-MM-dd"
-            range-separator="至"
-            start-placeholder="时间"
-            end-placeholder="时间"
-            :picker-options="pickerOptions"
-          />
+        ref="inputDatetime"
+        v-model="getdataListParm.parammaps.inputDatetime"
+        class="inputDatetime"
+        type="datetimerange"
+        style="width: 280px;top:-3px;"
+        format="yyyy-MM-dd"
+        value-format="yyyy-MM-dd"
+        range-separator="至"
+        start-placeholder="时间"
+        end-placeholder="时间"
+        :picker-options="pickerOptions"
+      />
       <el-input v-model="getdataListParm.parammaps.eqName" placeholder="请输入设备名称" style="width: 200px;" class="filter-item" />
- 
- 
+
       <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
 
       <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
-  
 
       <el-table
         :key="tableKey"
@@ -65,9 +62,9 @@
 
 <script>
 // 引入
-import { GetDataByName, GetDataByNames, getRecuData, GetAccount,startStopRecord } from '@/api/common'
+import { GetDataByName, GetDataByNames, getRecuData, GetAccount, startStopRecord } from '@/api/common'
 import waves from '@/directive/waves'
- 
+
 import { parseTime, json2excel, sortChange } from '@/utils/index.js'
 import Pagination from '@/components/Pagination'
 import TreeSelect from '@/components/TreeSelect'
@@ -80,23 +77,21 @@ export default {
     return {
       findAllPasture: [], findAllDepart: [],
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
       disabled: false, placeholder: '请选择设备类别',
- 
-  
- 
-   
+
       getRecuListParm: { name: 'getAssetTypeList', idname: 'id', params: [-1] },
       tableKey: 0,
       list: [
-         
+
       ],
 
       selectData: '',
       pickerMinDate: '',
-      pickerRange:3600 * 1000 * 24 * 60,
+      pickerRange: 3600 * 1000 * 24 * 60,
       pickerOptions: {
       //   onPick:({maxDate,minDate }) => {
       //     if (minDate && this.pickerMinDate) {
@@ -113,13 +108,12 @@ export default {
       //   },
       },
 
-
       total: 0,
       listLoading: true,
       getdataListParm: {
-        name: 'startStopRecord', page: 1, offset: 1, pagecount: 10, returntype: 'Map',inputDatetime: [parseTime(new Date().getTime() - 30 * 24 * 60 * 60 * 1000, '{y}-{m}-{d}'), parseTime(new Date().getTime() - 24 * 60 * 60 * 1000, '{y}-{m}-{d}')],
-        parammaps: { pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), departmentName: '', eqClassId: '', eqName: '',startTime: "",
-        endTime: "",departmentId: "" ,inputDatetime: [parseTime(new Date().getTime() - 30 * 24 * 60 * 60 * 1000, '{y}-{m}-{d}'), parseTime(new Date().getTime() - 24 * 60 * 60 * 1000, '{y}-{m}-{d}')], page: 1, offset: 1, pagecount: 10,}
+        name: 'startStopRecord', page: 1, offset: 1, pagecount: 10, returntype: 'Map', inputDatetime: [parseTime(new Date().getTime() - 30 * 24 * 60 * 60 * 1000, '{y}-{m}-{d}'), parseTime(new Date().getTime() - 24 * 60 * 60 * 1000, '{y}-{m}-{d}')],
+        parammaps: { pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), departmentName: '', eqClassId: '', eqName: '', startTime: '',
+          endTime: '', departmentId: '', inputDatetime: [parseTime(new Date().getTime() - 30 * 24 * 60 * 60 * 1000, '{y}-{m}-{d}'), parseTime(new Date().getTime() - 24 * 60 * 60 * 1000, '{y}-{m}-{d}')], page: 1, offset: 1, pagecount: 10 }
       },
       requestParam: { name: 'insertAsset', offset: 0, pagecount: 0, parammaps: {}}, statueReason: false,
       downLoadParm: {},
@@ -131,49 +125,48 @@ export default {
       isokDisable: false,
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
   created() {
     this.get_select_list()
-     this.get_table_data()
- 
+    this.get_table_data()
   },
   methods: {
 
     getSummaries1(param) {
-        const { columns, data } = param;
-        const sums = [];
-        columns.forEach((column, index) => {
-          if (index === 0) {
-              sums[index] = '合计';
-            return;
-          }
-          const values = data.map(item => Number(item[column.property]));
-          console.log(column.property)
-          console.log(values)
-          if (!values.every(value => isNaN(value))) {
-            sums[index] = values.reduce((prev, curr) => {
-              const value = Number(curr);
-              if (!isNaN(value)) {
-                return prev + curr;
-              } else {
-                return prev;
-              }
-            }, 0);
-            // sums[index] += ' 元';
-          } else {
-            sums[index] = '-';
-          }
-        });
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        }
+        const values = data.map(item => Number(item[column.property]))
+        console.log(column.property)
+        console.log(values)
+        if (!values.every(value => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+              return prev + curr
+            } else {
+              return prev
+            }
+          }, 0)
+          // sums[index] += ' 元';
+        } else {
+          sums[index] = '-'
+        }
+      })
 
-        return sums;
+      return sums
     },
 
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         if (response.data.list !== null) {
-          this.findAllPasture = response.data.findAllPasture.list
+          this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
           this.getDepartDownList()
         }
       })
@@ -199,13 +192,10 @@ export default {
         this.getdataListParm.parammaps.startTime = ''
         this.getdataListParm.parammaps.endTime = ''
       } else {
-        
-
         this.getdataListParm.parammaps.startTime = this.getdataListParm.parammaps.inputDatetime[0]
         this.getdataListParm.parammaps.endTime = this.getdataListParm.parammaps.inputDatetime[1]
       }
 
-
       this.getdataListParm.parammaps.offset = this.getdataListParm.offset
       this.getdataListParm.parammaps.pagecount = this.getdataListParm.pagecount
       this.getdataListParm.parammaps.page = this.getdataListParm.page
@@ -231,8 +221,6 @@ export default {
       this.get_table_data()
     },
 
-  
-  
     tableCellStyle({ row, column, rowIndex, columnIndex }) {
       // if (columnIndex === 3) {
       //   return {
@@ -243,7 +231,6 @@ export default {
       //   textDecoration: 'none'
       // }
     },
-   
 
     handleDownload() {
       this.$alert('启停记录正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
@@ -258,9 +245,7 @@ export default {
         this.percentage = this.percentage
       }, 1000)
       this.downLoadParm.name = 'startStopRecord'
-      
 
-      
       this.downLoadParm.parammaps = this.getdataListParm.parammaps
       this.downLoadParm.parammaps.pagecount = 0
       this.downLoadParm.parammaps.page = 0
@@ -276,8 +261,8 @@ export default {
         console.log(this.downLoadList)
         const elecExcelDatas = [
           {
-            tHeader: ['牧场', '设备名称', '设备内部编号',  '运行时间', '停机时间' ],
-            filterVal: ['pastureName', 'eqName','eqCode', 'run', 'stop' ],
+            tHeader: ['牧场', '设备名称', '设备内部编号', '运行时间', '停机时间'],
+            filterVal: ['pastureName', 'eqName', 'eqCode', 'run', 'stop'],
             tableDatas: this.downLoadList,
             sheetName: '启停记录'
           }
@@ -285,7 +270,6 @@ export default {
         json2excel(elecExcelDatas, '启停记录', true, 'xlsx')
       })
     }
- 
 
   }
 }

+ 37 - 45
src/views/report/stopRecord/index2.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
-  
-     开发中
+
+    开发中
   </div>
 </template>
 
@@ -9,7 +9,7 @@
 // 引入
 import { GetDataByName, GetDataByNames, getRecuData, GetAccount } from '@/api/common'
 import waves from '@/directive/waves'
- 
+
 import { parseTime, json2excel, sortChange } from '@/utils/index.js'
 import Pagination from '@/components/Pagination'
 import TreeSelect from '@/components/TreeSelect'
@@ -26,19 +26,16 @@ export default {
       ],
       getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
       disabled: false, placeholder: '请选择设备类别',
- 
-  
- 
-   
+
       getRecuListParm: { name: 'getAssetTypeList', idname: 'id', params: [-1] },
       tableKey: 0,
       list: [
-         
+
       ],
 
       selectData: '',
       pickerMinDate: '',
-      pickerRange:3600 * 1000 * 24 * 60,
+      pickerRange: 3600 * 1000 * 24 * 60,
       pickerOptions: {
       //   onPick:({maxDate,minDate }) => {
       //     if (minDate && this.pickerMinDate) {
@@ -55,13 +52,12 @@ export default {
       //   },
       },
 
-
       total: 0,
       listLoading: true,
       getdataListParm: {
-        name: 'getRecordsOfRepairman', page: 1, offset: 1, pagecount: 10, returntype: 'Map',inputDatetime: '',
-        parammaps: { pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), departmentName: '', eqClassId: '', startTime: "",
-        stopTime: "",departmentId: "" ,inputDatetime: [parseTime(new Date().getTime() - 30 * 24 * 60 * 60 * 1000, '{y}-{m}-{d}'), parseTime(new Date().getTime() - 24 * 60 * 60 * 1000, '{y}-{m}-{d}')],}
+        name: 'getRecordsOfRepairman', page: 1, offset: 1, pagecount: 10, returntype: 'Map', inputDatetime: '',
+        parammaps: { pastureId: Cookies.get('pastureid'), pastureName: Cookies.get('pasturename'), departmentName: '', eqClassId: '', startTime: '',
+          stopTime: '', departmentId: '', inputDatetime: [parseTime(new Date().getTime() - 30 * 24 * 60 * 60 * 1000, '{y}-{m}-{d}'), parseTime(new Date().getTime() - 24 * 60 * 60 * 1000, '{y}-{m}-{d}')] }
       },
       requestParam: { name: 'insertAsset', offset: 0, pagecount: 0, parammaps: {}}, statueReason: false,
       downLoadParm: {},
@@ -78,43 +74,43 @@ export default {
   created() {
     // this.get_select_list()
     //  this.get_table_data()
- 
+
   },
   methods: {
 
     getSummaries1(param) {
-        const { columns, data } = param;
-        const sums = [];
-        columns.forEach((column, index) => {
-          if (index === 0) {
-              sums[index] = '合计';
-            return;
-          }
-          const values = data.map(item => Number(item[column.property]));
-          console.log(column.property)
-          console.log(values)
-          if (!values.every(value => isNaN(value))) {
-            sums[index] = values.reduce((prev, curr) => {
-              const value = Number(curr);
-              if (!isNaN(value)) {
-                return prev + curr;
-              } else {
-                return prev;
-              }
-            }, 0);
-            // sums[index] += ' 元';
-          } else {
-            sums[index] = '-';
-          }
-        });
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        }
+        const values = data.map(item => Number(item[column.property]))
+        console.log(column.property)
+        console.log(values)
+        if (!values.every(value => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+              return prev + curr
+            } else {
+              return prev
+            }
+          }, 0)
+          // sums[index] += ' 元';
+        } else {
+          sums[index] = '-'
+        }
+      })
 
-        return sums;
+      return sums
     },
 
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         if (response.data.list !== null) {
-          this.findAllPasture = response.data.findAllPasture.list
+          this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
           this.getDepartDownList()
         }
       })
@@ -165,8 +161,6 @@ export default {
       this.get_table_data()
     },
 
-  
-  
     tableCellStyle({ row, column, rowIndex, columnIndex }) {
       // if (columnIndex === 3) {
       //   return {
@@ -177,7 +171,6 @@ export default {
       //   textDecoration: 'none'
       // }
     },
-   
 
     handleDownload() {
       this.$alert('报修人记录正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
@@ -205,7 +198,7 @@ export default {
         const elecExcelDatas = [
           {
             tHeader: ['牧场', '月份', '部门', '姓名', '报修次数'],
-            filterVal: ['pasturename', 'date', 'departmentName', 'empname', 'count' ],
+            filterVal: ['pasturename', 'date', 'departmentName', 'empname', 'count'],
             tableDatas: this.downLoadList,
             sheetName: '报修人记录'
           }
@@ -213,7 +206,6 @@ export default {
         json2excel(elecExcelDatas, '报修人记录', true, 'xlsx')
       })
     }
- 
 
   }
 }

+ 4 - 4
src/views/report/timelyArrivalRate/index.vue

@@ -24,8 +24,8 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
-      @sort-change="tableSort1"
       :max-height="myHeight"
+      @sort-change="tableSort1"
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
@@ -107,7 +107,7 @@ export default {
       cellStyle: { padding: 0 + 'px' },
       types: [{ id: 0, name: '按牧场' }, { id: 1, name: '按供应商' }],
       findAllPasture: [],
-      requestParams: [{ name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}],
+      requestParams: [{ name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}, { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}],
       tableKey: 0,
       list: [],
       total: 0,
@@ -141,7 +141,7 @@ export default {
       downLoadList: [],
       isPercentage: false,
       percentage: 1,
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
 
@@ -158,7 +158,7 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
       })
     },
     get_table_data() {

+ 45 - 38
src/views/report/vehiclerunningtime/index.vue

@@ -7,7 +7,19 @@
     </div>
 
     <div class="filter-container">
-      <el-date-picker ref="inputDatetime" v-model="getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 280px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="时间" end-placeholder="时间" :picker-options="pickerOptions" />
+      <el-date-picker
+        ref="inputDatetime"
+        v-model="getdataListParm.parammaps.inputDatetime"
+        class="inputDatetime"
+        type="datetimerange"
+        style="width: 280px;top:-3px;"
+        format="yyyy-MM-dd"
+        value-format="yyyy-MM-dd"
+        range-separator="至"
+        start-placeholder="时间"
+        end-placeholder="时间"
+        :picker-options="pickerOptions"
+      />
       <el-select v-model="getdataListParm.parammaps.pastureId" placeholder="牧场" class="filter-item" style="width: 120px;" @change="changePastureName">
         <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
@@ -18,12 +30,10 @@
       <el-input v-model="getdataListParm.parammaps.eqName" placeholder="请输入设备名称" style="width: 200px;" class="filter-item" />
       <el-input v-model="getdataListParm.parammaps.eqCode" placeholder="请输入设备内部编号" style="width: 200px;" class="filter-item" />
 
-
       <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
 
       <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
 
-
       <el-table
         :key="tableKey"
         v-loading="listLoading"
@@ -68,7 +78,7 @@
 
 <script>
 // 引入
-import { GetDataByName, GetDataByNames, getRecuData, GetAccount,getJson } from '@/api/common'
+import { GetDataByName, GetDataByNames, getRecuData, GetAccount, getJson } from '@/api/common'
 import waves from '@/directive/waves'
 
 import { parseTime, json2excel, sortChange } from '@/utils/index.js'
@@ -83,7 +93,8 @@ export default {
     return {
       findAllPasture: [], findAllDepart: [],
       requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: { name: 'findAllDepart1', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }},
 
@@ -92,7 +103,7 @@ export default {
 
       selectData: '',
       pickerMinDate: '',
-      pickerRange:3600 * 1000 * 24 * 60,
+      pickerRange: 3600 * 1000 * 24 * 60,
       pickerOptions: {
       //   onPick:({maxDate,minDate }) => {
       //     if (minDate && this.pickerMinDate) {
@@ -109,13 +120,12 @@ export default {
       //   },
       },
 
-
       total: 0,
       listLoading: true,
       getdataListParm: {
-        name: 'startStopRecord', page: 1, offset: 1, pagecount: 10, returntype: 'Map',inputDatetime: [parseTime(new Date().getTime() - 30 * 24 * 60 * 60 * 1000, '{y}-{m}-{d}'), parseTime(new Date().getTime() - 24 * 60 * 60 * 1000, '{y}-{m}-{d}')],
-        parammaps: { pastureId: parseInt(Cookies.get('pastureid')), pastureName: Cookies.get('pasturename'), departmentId: '', eqClassId: '', eqName: '',eqCode:'',startTime: "",
-        endTime: "",departmentId: "" ,inputDatetime: [parseTime(new Date().getTime() - 30 * 24 * 60 * 60 * 1000, '{y}-{m}-{d}'), parseTime(new Date().getTime() - 24 * 60 * 60 * 1000, '{y}-{m}-{d}')], page: 1, offset: 1, pagecount: 10,}
+        name: 'startStopRecord', page: 1, offset: 1, pagecount: 10, returntype: 'Map', inputDatetime: [parseTime(new Date().getTime() - 30 * 24 * 60 * 60 * 1000, '{y}-{m}-{d}'), parseTime(new Date().getTime() - 24 * 60 * 60 * 1000, '{y}-{m}-{d}')],
+        parammaps: { pastureId: parseInt(Cookies.get('pastureid')), pastureName: Cookies.get('pasturename'), departmentId: '', eqClassId: '', eqName: '', eqCode: '', startTime: '',
+          endTime: '', departmentId: '', inputDatetime: [parseTime(new Date().getTime() - 30 * 24 * 60 * 60 * 1000, '{y}-{m}-{d}'), parseTime(new Date().getTime() - 24 * 60 * 60 * 1000, '{y}-{m}-{d}')], page: 1, offset: 1, pagecount: 10 }
       },
       requestParam: { name: 'insertAsset', offset: 0, pagecount: 0, parammaps: {}}, statueReason: false,
       downLoadParm: {},
@@ -127,19 +137,18 @@ export default {
       isokDisable: false,
       rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
       cellStyle: { padding: 0 + 'px' },
-      myHeight:document.documentElement.clientHeight - 85- 150
+      myHeight: document.documentElement.clientHeight - 85 - 150
     }
   },
   created() {
     this.get_select_list()
-     this.get_table_data()
-
+    this.get_table_data()
   },
   methods: {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
         if (response.data.list !== null) {
-          this.findAllPasture = response.data.findAllPasture.list
+          this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
           this.getDepartDownList()
         }
       })
@@ -172,16 +181,16 @@ export default {
       this.getdataListParm.parammaps.offset = this.getdataListParm.offset
       this.getdataListParm.parammaps.pagecount = this.getdataListParm.pagecount
       this.getdataListParm.parammaps.page = this.getdataListParm.page
-      let url = '/authdata/vehicle/list'
-      let data = '?pastureId='+ this.getdataListParm.parammaps.pastureId
-              + '&startTime=' + this.getdataListParm.parammaps.startTime
-              + '&endTime=' + this.getdataListParm.parammaps.endTime
-              + '&offset=' + this.getdataListParm.offset
-              + '&pagecount=' + this.getdataListParm.pagecount
-              + '&eqCode=' + this.getdataListParm.parammaps.eqCode
-              + '&eqName=' + this.getdataListParm.parammaps.eqName
-              + '&departmentId=' + this.getdataListParm.parammaps.departmentId
-      getJson(url,data).then(response => {
+      const url = '/authdata/vehicle/list'
+      const data = '?pastureId=' + this.getdataListParm.parammaps.pastureId +
+              '&startTime=' + this.getdataListParm.parammaps.startTime +
+              '&endTime=' + this.getdataListParm.parammaps.endTime +
+              '&offset=' + this.getdataListParm.offset +
+              '&pagecount=' + this.getdataListParm.pagecount +
+              '&eqCode=' + this.getdataListParm.parammaps.eqCode +
+              '&eqName=' + this.getdataListParm.parammaps.eqName +
+              '&departmentId=' + this.getdataListParm.parammaps.departmentId
+      getJson(url, data).then(response => {
         console.log('table数据', response.data.vehicle)
         if (response.data.list !== null) {
           this.list = response.data.vehicle
@@ -202,7 +211,6 @@ export default {
       this.get_table_data()
     },
 
-
     handleDownload() {
       this.$alert('车辆运行时间正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
       this.isPercentage = true
@@ -215,16 +223,16 @@ export default {
         }
         this.percentage = this.percentage
       }, 1000)
-      let url = '/authdata/vehicle/list'
-      let data = '?pastureId='+ this.getdataListParm.parammaps.pastureId
-              + '&startTime=' + this.getdataListParm.parammaps.startTime
-              + '&endTime=' + this.getdataListParm.parammaps.endTime
-              + '&offset=0'
-              + '&pagecount=' + this.total
-              + '&eqCode=' + this.getdataListParm.parammaps.eqCode
-              + '&eqName=' + this.getdataListParm.parammaps.eqName
-              + '&departmentId=' + this.getdataListParm.parammaps.departmentId
-      getJson(url,data).then(response => {
+      const url = '/authdata/vehicle/list'
+      const data = '?pastureId=' + this.getdataListParm.parammaps.pastureId +
+              '&startTime=' + this.getdataListParm.parammaps.startTime +
+              '&endTime=' + this.getdataListParm.parammaps.endTime +
+              '&offset=0' +
+              '&pagecount=' + this.total +
+              '&eqCode=' + this.getdataListParm.parammaps.eqCode +
+              '&eqName=' + this.getdataListParm.parammaps.eqName +
+              '&departmentId=' + this.getdataListParm.parammaps.departmentId
+      getJson(url, data).then(response => {
         this.downLoadList = response.data.vehicle
         if (response.data.vehicle !== '') {
           this.percentage = 99
@@ -234,8 +242,8 @@ export default {
         }
         const elecExcelDatas = [
           {
-            tHeader: ['日期','运营中心','大区','牧场','部门','设备类别','设备名称','设备内部编号','物联网编码','规格','品牌','用途','购置日期','入场时间','报废时间','标准工作时长','时长'],
-            filterVal: ['date','center','region','pastureName','departmentName','eqClass','eqName','eqCode','license','specification','brand','purpose','purchaseDate','entranceDate','leaveDate','duration','hour' ],
+            tHeader: ['日期', '运营中心', '大区', '牧场', '部门', '设备类别', '设备名称', '设备内部编号', '物联网编码', '规格', '品牌', '用途', '购置日期', '入场时间', '报废时间', '标准工作时长', '时长'],
+            filterVal: ['date', 'center', 'region', 'pastureName', 'departmentName', 'eqClass', 'eqName', 'eqCode', 'license', 'specification', 'brand', 'purpose', 'purchaseDate', 'entranceDate', 'leaveDate', 'duration', 'hour'],
             tableDatas: this.downLoadList,
             sheetName: '车辆运行时间'
           }
@@ -244,7 +252,6 @@ export default {
       })
     }
 
-
   }
 }
 </script>

+ 4 - 3
src/views/special/earlyWarning/components/fireExtinguisher.vue

@@ -215,7 +215,7 @@ export default {
   components: { Pagination },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 250,
+      myHeight: document.documentElement.clientHeight - 85 - 250,
       warningStatus: [{ id: 0, name: '全部' }, { id: 1, name: '正常' }, { id: 2, name: '预警期' }],
       findAllPasture: [],
       findAllDepart: [],
@@ -223,7 +223,8 @@ export default {
       requestParams: [
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       rules: {
         location: [{ required: true, message: '必填', trigger: 'blur' }],
@@ -325,7 +326,7 @@ export default {
   methods: {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
       })

+ 631 - 630
src/views/special/earlyWarning/components/insulatAingAppliances.vue

@@ -1,630 +1,631 @@
-<template>
-  <div class="app-container">
-    <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
-      <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
-      <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
-    </div>
-    <div class="filter-container">
-      <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 150px;">
-        <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
-      </el-select>
-      <el-select v-model="getdataListParm.parammaps.status" placeholder="检验预警状态" class="filter-item" style="width: 150px;">
-        <el-option v-for="item in warningStatus" :key="item.id" :label="item.name" :value="item.name" />
-      </el-select>
-      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
-    </div>
-    <div class="app-btn">
-      <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
-      <el-button class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
-      <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
-        <el-button v-waves class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
-      </el-upload>
-      <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
-    </div>
-    <el-table
-      :key="tableKey"
-      v-loading="listLoading"
-      element-loading-text="给我一点时间"
-      :data="list"
-      border
-      fit
-      highlight-current-row
-      style="width: 100%;"
-      :row-class-name="tableRowClassName"
-      :row-style="selectedHighlight"
-      :cell-style="cellStyle"
-      class="elTable table-fixed"
-      :max-height="myHeight"
-    >
-      <el-table-column label="序号" align="center" type="index" width="50px">
-        <template slot-scope="scope">
-          <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="牧场" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.pastureName }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="设备名称" width="140px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.warnName }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="规程型号" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.specification }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="生产厂家" min-width="100px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.level }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="出厂编号" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.measureRange }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="出厂日期" min-width="80px" align="center" sortable prop="factoryNumber" />
-      <el-table-column label="使用部门" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.departmentName }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="责任人" min-width="100px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.empName }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="检验日期" min-width="80px" align="center" sortable prop="lastCheckDate" />
-      <el-table-column label="有效日期" min-width="110px" align="center" sortable prop="validityDate" />
-      <el-table-column label="校验周期" min-width="80px" align="center" sortable prop="amount" />
-      <el-table-column label="备注" min-width="110px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.note }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
-        <template slot-scope="{row}">
-          <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
-          <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button>
-          <el-button type="danger" size="mini" @click="form_delete(row)">删除</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
-
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="80%">
-      <div class="app-add">
-        <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="115px" style="width: 90%;margin:0 auto 30px">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item ref="pastureId" label="牧场:" prop="pastureId">
-                <el-select v-model="createTemp.pastureId " placeholder="请输入牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changePasture">
-                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="设备名称:" prop="warnName">
-                <el-input ref="warnName" v-model="createTemp.warnName" placeholder="请输入设备名称" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="规程型号:" prop="specification">
-                <el-input ref="specification" v-model="createTemp.specification" placeholder="请输入规格型号" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="生产厂家:" prop="level">
-                <el-input ref="level" v-model="createTemp.level" placeholder="请输入生产厂家" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="出厂编号:" prop="measureRange">
-                <el-input ref="measureRange" v-model="createTemp.measureRange" placeholder="请输入出厂编号" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="出场日期:" prop="factoryNumber">
-                <el-date-picker v-model="createTemp.factoryNumber" type="date" placeholder="请输入出场日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="使用部门:" prop="departmentName">
-                <el-select v-model="createTemp.departmentName" placeholder="请输入使用部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changeDepartment">
-                  <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.name" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="责任人:" prop="empName">
-                <el-select ref="empName" v-model="createTemp.empName" filterable placeholder="请输入责任人" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changeEmp">
-                  <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.name" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="检验日期:" prop="lastCheckDate">
-                <el-date-picker v-model="createTemp.lastCheckDate" :picker-options="pickerOptions1" type="date" placeholder="请输入检验日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="有效日期:" prop="validityDate">
-                <el-date-picker v-model="createTemp.validityDate" :picker-options="pickerOptions2" type="date" placeholder="请输入有效日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="检验周期:" prop="amount">
-                <el-input ref="amount" v-model="createTemp.amount" placeholder="请输入检验周期" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="备注:" prop="note">
-                <el-input ref="note" v-model="createTemp.note" placeholder="请输入备注" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:5px">
-          <el-button v-if="dialogStatus==='create' || dialogStatus==='update'" type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
-          <el-button @click="dialogFormVisible = false; getdataListParm.parammaps.inputDatetime = ''">取消并关闭</el-button>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import waves from '@/directive/waves'
-import { GetDataByNames, GetDataByName, PostDataByName, failproccess, GetAccount } from '@/api/common'
-import Cookies from 'js-cookie'
-import { json2excel } from '@/utils/index.js'
-import { MessageBox } from 'element-ui'
-import { getToken } from '@/utils/auth'
-import { parseTime } from '@/utils/index.js'
-import Pagination from '@/components/Pagination'
-export default {
-  name: 'InsulatAingAppliances',
-  directives: { waves },
-  components: { Pagination },
-  data() {
-    return {
-      myHeight:document.documentElement.clientHeight - 85- 250,
-      warningStatus: [{ id: 0, name: '全部' }, { id: 1, name: '正常' }, { id: 2, name: '预警期' }],
-      findAllPasture: [],
-      findAllDepart: [],
-      findAllEmploye: [],
-      requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
-      ],
-      rules: {
-        pastureId: [{ required: true, message: '必填', trigger: 'blur' }],
-        warnName: [{ required: true, message: '必填', trigger: 'blur' }],
-        specification: [{ required: true, message: '必填', trigger: 'blur' }],
-        lastCheckDate: [{ required: true, message: '必填', trigger: 'blur' }],
-        validityDate: [{ required: true, message: '必填', trigger: 'blur' }]
-      },
-      getdataListParm: {
-        name: 'getExaminewarningList',
-        page: 1,
-        offset: 1,
-        pagecount: 10,
-        returntype: 'Map',
-        parammaps: {
-          pastureName: Cookies.get('pasturename'),
-          warningType: '绝缘用具'
-        }
-      },
-      tableKey: 0,
-      listLoading: false,
-      total: 0,
-      list: [],
-      getIndexList: [],
-      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      pickerOptions1: {
-        disabledDate: (time) => {
-          if (this.createTemp.validityDate !== '') {
-            return parseTime(time.getTime(), '{y}-{m}-{d}') >= this.createTemp.validityDate
-          } else {
-            return ''
-          }
-        }
-      },
-      pickerOptions2: {
-        disabledDate: (time) => {
-          return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.createTemp.lastCheckDate
-        }
-      },
-      createTemp: {
-        pastureId: this.$store.state.user.pastureid,
-        pastureName: this.$store.state.user.pasturename,
-        departmentName: this.$store.state.user.departmentname,
-        departmentId: this.$store.state.user.departmentid,
-        warnName: '',
-        specification: '',
-        level: '',
-        measureRange: '',
-        factoryNumber: '',
-        lastCheckDate: '',
-        validityDate: '',
-        amount: '',
-        note: '',
-        empId: '',
-        empName: ''
-      },
-      dialogFormVisible: false,
-      dialogStatus: '',
-      textMap: {
-        create: '新增',
-        update: '编辑',
-        see: '查看'
-      },
-      isokDisable: false,
-      postDataPramas: {},
-      downLoadParm: {},
-      isPercentage: false,
-      percentage: 1
-    }
-  },
-  computed: {
-    headers() {
-      return {
-        token: getToken()
-      }
-    },
-    uploadData() {
-      return {
-        name: 'uploadExaminewarnJY',
-        importParams: '牧场,设备名称,规程型号,生产厂家,出厂编号,出厂日期,使用部门,责任人,校验日期,有效期至,校验周期,备注',
-        sheetname: 'SheetJS'
-      }
-    },
-    // 设置上传地址
-    uploadExcelUrl() {
-      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
-    }
-  },
-  created() {
-    this.get_select_list()
-    this.get_table_data()
-  },
-
-  // 设置变量
-
-  methods: {
-    get_select_list() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
-        this.findAllDepart = response.data.findAllDepart.list
-        this.findAllEmploye = response.data.findAllEmploye.list
-      })
-    },
-    getNextDate(date, day) {
-      var dd = new Date(date)
-      dd.setDate(dd.getDate() + day)
-      var y = dd.getFullYear()
-      var m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1
-      var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()
-      return y + '-' + m + '-' + d
-    },
-    tableRowClassName({ row, rowIndex }) {
-      // 把每一行的索引放进row
-      row.index = rowIndex
-    },
-    get_table_data() {
-      this.listLoading = true
-      GetDataByName(this.getdataListParm).then(response => {
-        if (response.data.list !== null || response.data !== null) {
-          console.log('table数据', response.data.list)
-          this.getIndexList = []
-          for (let i = 0; i < response.data.list.length; i++) {
-            response.data.list[i].index = i
-            if (this.getNextDate(response.data.list[i].validityDate, -30) <= parseTime(new Date(), '{y}-{m}-{d}')) {
-              this.getIndexList.push({ 'myindex': response.data.list[i].index })
-            }
-          }
-          this.list = response.data.list
-          this.pageNum = response.data.pageNum
-          this.pageSize = response.data.pageSize
-          this.total = response.data.total
-        } else {
-          this.list = []
-        }
-        setTimeout(() => {
-          this.listLoading = false
-        }, 100)
-      })
-    },
-    selectedHighlight({ row, rowIndex }) {
-      for (let i = 0; i < this.getIndexList.length; i++) {
-        if (this.getIndexList[i].myindex === rowIndex) {
-          return {
-            color: 'red'
-          }
-        }
-      }
-    },
-
-    form_search() {
-      console.log('点击了搜索')
-      this.getdataListParm.offset = 1
-      this.get_table_data()
-    },
-    resetCreateTemp() {
-      this.createTemp.pastureId = this.$store.state.user.pastureid
-      this.createTemp.pastureName = this.$store.state.user.pasturename
-      this.createTemp.departmentName = this.$store.state.user.departmentname
-      this.createTemp.departmentId = this.$store.state.user.departmentid
-      this.createTemp.warnName = ''
-      this.createTemp.specification = ''
-      this.createTemp.level = ''
-      this.createTemp.measureRange = ''
-      this.createTemp.factoryNumber = ''
-      this.createTemp.lastCheckDate = ''
-      this.createTemp.validityDate = ''
-      this.createTemp.amount = ''
-      this.createTemp.note = ''
-      this.createTemp.empName = ''
-      this.createTemp.empId = ''
-    },
-    form_add() {
-      console.log('点击了新增')
-      this.resetCreateTemp()
-      this.dialogStatus = 'create'
-      this.dialogFormVisible = true
-    },
-    changePasture(item) {
-      this.createTemp.pastureName = this.findAllPasture.find(obj => obj.id === item).name
-    },
-    changeDepartment(item) {
-      this.createTemp.departmentId = this.findAllDepart.find(obj => obj.name === item).id
-    },
-    changeEmp(item) {
-      this.createTemp.empId = this.findAllEmploye.find(obj => obj.name === item).id
-    },
-    add_dialog_save() {
-      console.log('点击了保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          this.postDataPramas.name = 'insertExaminewarning'
-          this.postDataPramas.parammaps = {}
-          this.postDataPramas.parammaps = this.createTemp
-          this.postDataPramas.parammaps.warningType = '绝缘用具'
-          PostDataByName(this.postDataPramas).then(response => {
-            console.log('新增保存发送参数', this.postDataPramas)
-            if (response.msg !== 'fail') {
-              this.dialogFormVisible = false
-              this.get_table_data()
-              this.$notify({
-                title: '成功',
-                message: '新增成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-    form_edit(row) {
-      console.log('点击了编辑')
-      this.dialogStatus = 'update'
-      this.dialogFormVisible = true
-      this.createTemp = Object.assign({}, row)
-      this.createTemp.pastureId = parseFloat(row.pastureId)
-      this.createTemp.departmentId = parseFloat(row.departmentId)
-      this.createTemp.empId = parseFloat(row.empId)
-    },
-    edit_dialog_save() {
-      console.log('点击了编辑保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          this.postDataPramas.name = 'updateExaminewarning'
-          this.postDataPramas.parammaps = {}
-          this.postDataPramas.parammaps = this.createTemp
-          this.postDataPramas.parammaps.id = this.createTemp.id
-          this.postDataPramas.parammaps.warningType = '绝缘用具'
-          PostDataByName(this.postDataPramas).then(response => {
-            console.log('编辑保存发送参数', this.postDataPramas)
-            if (response.msg !== 'fail') {
-              this.dialogFormVisible = false
-              this.get_table_data()
-              this.$notify({
-                title: '成功',
-                message: '保存成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-    form_see(row) {
-      console.log('点击了查看', row)
-      this.dialogStatus = 'see'
-      this.dialogFormVisible = true
-      this.createTemp = Object.assign({}, row)
-      this.createTemp.pastureId = parseFloat(row.pastureId)
-      this.createTemp.departmentId = parseFloat(row.departmentId)
-      this.createTemp.empId = parseFloat(row.empId)
-    },
-    form_delete(row) {
-      MessageBox.confirm('确认删除此信息?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        console.log('点击了删除', row)
-        this.postDataPramas.name = 'deleteExaminewarning'
-        this.postDataPramas.parammaps = {}
-        this.postDataPramas.parammaps.id = row.id
-        this.postDataPramas.parammaps.warningType = '绝缘用具'
-        PostDataByName(this.postDataPramas).then(response => {
-          console.log('删除保存发送参数', this.postDataPramas)
-          if (response.msg !== 'fail') {
-            this.dialogFormVisible = false
-            this.get_table_data()
-            this.$notify({
-              title: '成功',
-              message: '删除成功',
-              type: 'success',
-              duration: 2000
-            })
-          } else {
-            failproccess(response, this.$notify)
-          }
-        })
-      })
-    },
-    handleDownloadTemp() {
-      console.log('点击了模板')
-      import('@/vendor/Export2Excel').then(excel => {
-        const list1 = []
-        const tHeader = [
-          '牧场', '设备名称', '规程型号', '生产厂家', '出厂编号', '出厂日期', '使用部门', '责任人', '校验日期', '有效期至', '校验周期', '备注'
-        ]
-        const filterVal = [
-          '牧场', '设备名称', '规程型号', '生产厂家', '出厂编号', '出厂日期', '使用部门', '责任人', '校验日期', '有效期至', '校验周期', '备注'
-        ]
-        const data1 = this.formatJson(filterVal, list1)
-        excel.export_json_to_excel({
-          header: tHeader,
-          data: data1,
-          filename: '绝缘用具模板',
-          autoWidth: true,
-          bookType: 'xlsx'
-        })
-      })
-    },
-    beforeImportExcel(file) {
-      const isLt2M = file.size / 1024 / 1024 < 6
-      if (!isLt2M) {
-        this.$message.error('上传文件大小不能超过 6MB!')
-      }
-      return isLt2M
-    },
-    handleImportExcelSuccess(res, file) {
-      this.get_table_data()
-      if (res.msg === 'ok') {
-        this.$message({
-          title: '成功',
-          message: '导入成功:' + res.data.success + '条!',
-          type: 'success',
-          duration: 2000
-        })
-        if (res.data.err_count > 0) {
-          this.$notify({
-            title: '失败',
-            message: '导入失败:' + res.data.err_count + '条!',
-            type: 'danger',
-            duration: 2000
-          })
-           import('@/vendor/Export2Excel').then(excel => {
-             const list1 = res.data.result
-             const tHeader = [
-               '牧场', '设备名称', '规程型号', '生产厂家', '出厂编号', '出厂日期', '使用部门', '责任人', '校验日期', '有效期至', '校验周期', '备注', '报错信息'
-             ]
-             const filterVal = [
-               '牧场', '设备名称', '规程型号', '生产厂家', '出厂编号', '出厂日期', '使用部门', '责任人', '校验日期', '有效期至', '校验周期', '备注', 'error_msg'
-             ]
-             const data1 = this.formatJson(filterVal, list1)
-             excel.export_json_to_excel({
-               header: tHeader,
-               data: data1,
-               filename: '绝缘用具报错信息',
-               autoWidth: true,
-               bookType: 'xlsx'
-             })
-           })
-        }
-      } else {
-        this.$notify({
-          title: '失败',
-          message: '上传失败',
-          type: 'danger',
-          duration: 2000
-        })
-      }
-    },
-    formatJson(filterVal, jsonData) {
-      return jsonData.map(v =>
-        filterVal.map(j => {
-          if (j === 'timestamp') {
-            return parseTime(v[j])
-          } else {
-            return v[j]
-          }
-        })
-      )
-    },
-    handleDownload() {
-      console.log('点击了导出')
-      this.$alert('绝缘用具正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
-      this.isPercentage = true
-      this.percentage = 1
-      var timer = setInterval(() => {
-        this.percentage += 5
-        if (this.percentage > 95) {
-          this.percentage = 99
-          clearInterval(timer)
-        }
-        this.percentage = this.percentage
-      }, 1000)
-      this.downLoadParm.name = 'getExaminewarningList'
-      this.downLoadParm.parammaps = this.getdataListParm.parammaps
-      GetAccount(this.downLoadParm).then(response => {
-        if (response.data.list !== '') {
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-        }
-        this.$nextTick(() => {
-          this.downLoadList = response.data.list
-          console.log('导出table数据', this.downLoadList)
-          const ExcelDatas = [
-            {
-              tHeader: ['牧场', '设备名称', '规程型号', '生产厂家', '出厂编号', '出厂日期', '使用部门', '责任人', '校验日期', '有效期至', '校验周期', '备注'],
-              filterVal: ['pastureName', 'warnName', 'specification', 'level', 'measureRange', 'factoryNumber', 'departmentName', 'empName', 'lastCheckDate', 'validityDate', 'amount', 'note'],
-              tableDatas: this.downLoadList,
-              sheetName: '绝缘用具'
-            }
-          ]
-          json2excel(ExcelDatas, '绝缘用具', true, 'xlsx')
-        })
-      })
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-.app-btn {
-  margin-bottom: 10px;
-}
-</style>
-
+<template>
+  <div class="app-container">
+    <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
+      <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
+      <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
+    </div>
+    <div class="filter-container">
+      <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 150px;">
+        <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
+      <el-select v-model="getdataListParm.parammaps.status" placeholder="检验预警状态" class="filter-item" style="width: 150px;">
+        <el-option v-for="item in warningStatus" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
+      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
+    </div>
+    <div class="app-btn">
+      <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
+      <el-button class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
+      <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
+        <el-button v-waves class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
+      </el-upload>
+      <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
+    </div>
+    <el-table
+      :key="tableKey"
+      v-loading="listLoading"
+      element-loading-text="给我一点时间"
+      :data="list"
+      border
+      fit
+      highlight-current-row
+      style="width: 100%;"
+      :row-class-name="tableRowClassName"
+      :row-style="selectedHighlight"
+      :cell-style="cellStyle"
+      class="elTable table-fixed"
+      :max-height="myHeight"
+    >
+      <el-table-column label="序号" align="center" type="index" width="50px">
+        <template slot-scope="scope">
+          <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="牧场" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.pastureName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="设备名称" width="140px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.warnName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="规程型号" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.specification }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="生产厂家" min-width="100px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.level }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="出厂编号" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.measureRange }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="出厂日期" min-width="80px" align="center" sortable prop="factoryNumber" />
+      <el-table-column label="使用部门" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.departmentName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="责任人" min-width="100px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.empName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="检验日期" min-width="80px" align="center" sortable prop="lastCheckDate" />
+      <el-table-column label="有效日期" min-width="110px" align="center" sortable prop="validityDate" />
+      <el-table-column label="校验周期" min-width="80px" align="center" sortable prop="amount" />
+      <el-table-column label="备注" min-width="110px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.note }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
+          <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button>
+          <el-button type="danger" size="mini" @click="form_delete(row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
+
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="80%">
+      <div class="app-add">
+        <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="115px" style="width: 90%;margin:0 auto 30px">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item ref="pastureId" label="牧场:" prop="pastureId">
+                <el-select v-model="createTemp.pastureId " placeholder="请输入牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changePasture">
+                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="设备名称:" prop="warnName">
+                <el-input ref="warnName" v-model="createTemp.warnName" placeholder="请输入设备名称" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="规程型号:" prop="specification">
+                <el-input ref="specification" v-model="createTemp.specification" placeholder="请输入规格型号" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="生产厂家:" prop="level">
+                <el-input ref="level" v-model="createTemp.level" placeholder="请输入生产厂家" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="出厂编号:" prop="measureRange">
+                <el-input ref="measureRange" v-model="createTemp.measureRange" placeholder="请输入出厂编号" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="出场日期:" prop="factoryNumber">
+                <el-date-picker v-model="createTemp.factoryNumber" type="date" placeholder="请输入出场日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="使用部门:" prop="departmentName">
+                <el-select v-model="createTemp.departmentName" placeholder="请输入使用部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changeDepartment">
+                  <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.name" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="责任人:" prop="empName">
+                <el-select ref="empName" v-model="createTemp.empName" filterable placeholder="请输入责任人" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changeEmp">
+                  <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.name" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="检验日期:" prop="lastCheckDate">
+                <el-date-picker v-model="createTemp.lastCheckDate" :picker-options="pickerOptions1" type="date" placeholder="请输入检验日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="有效日期:" prop="validityDate">
+                <el-date-picker v-model="createTemp.validityDate" :picker-options="pickerOptions2" type="date" placeholder="请输入有效日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="检验周期:" prop="amount">
+                <el-input ref="amount" v-model="createTemp.amount" placeholder="请输入检验周期" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="备注:" prop="note">
+                <el-input ref="note" v-model="createTemp.note" placeholder="请输入备注" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:5px">
+          <el-button v-if="dialogStatus==='create' || dialogStatus==='update'" type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
+          <el-button @click="dialogFormVisible = false; getdataListParm.parammaps.inputDatetime = ''">取消并关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import waves from '@/directive/waves'
+import { GetDataByNames, GetDataByName, PostDataByName, failproccess, GetAccount } from '@/api/common'
+import Cookies from 'js-cookie'
+import { json2excel } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+import { getToken } from '@/utils/auth'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'InsulatAingAppliances',
+  directives: { waves },
+  components: { Pagination },
+  data() {
+    return {
+      myHeight: document.documentElement.clientHeight - 85 - 250,
+      warningStatus: [{ id: 0, name: '全部' }, { id: 1, name: '正常' }, { id: 2, name: '预警期' }],
+      findAllPasture: [],
+      findAllDepart: [],
+      findAllEmploye: [],
+      requestParams: [
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
+      ],
+      rules: {
+        pastureId: [{ required: true, message: '必填', trigger: 'blur' }],
+        warnName: [{ required: true, message: '必填', trigger: 'blur' }],
+        specification: [{ required: true, message: '必填', trigger: 'blur' }],
+        lastCheckDate: [{ required: true, message: '必填', trigger: 'blur' }],
+        validityDate: [{ required: true, message: '必填', trigger: 'blur' }]
+      },
+      getdataListParm: {
+        name: 'getExaminewarningList',
+        page: 1,
+        offset: 1,
+        pagecount: 10,
+        returntype: 'Map',
+        parammaps: {
+          pastureName: Cookies.get('pasturename'),
+          warningType: '绝缘用具'
+        }
+      },
+      tableKey: 0,
+      listLoading: false,
+      total: 0,
+      list: [],
+      getIndexList: [],
+      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      pickerOptions1: {
+        disabledDate: (time) => {
+          if (this.createTemp.validityDate !== '') {
+            return parseTime(time.getTime(), '{y}-{m}-{d}') >= this.createTemp.validityDate
+          } else {
+            return ''
+          }
+        }
+      },
+      pickerOptions2: {
+        disabledDate: (time) => {
+          return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.createTemp.lastCheckDate
+        }
+      },
+      createTemp: {
+        pastureId: this.$store.state.user.pastureid,
+        pastureName: this.$store.state.user.pasturename,
+        departmentName: this.$store.state.user.departmentname,
+        departmentId: this.$store.state.user.departmentid,
+        warnName: '',
+        specification: '',
+        level: '',
+        measureRange: '',
+        factoryNumber: '',
+        lastCheckDate: '',
+        validityDate: '',
+        amount: '',
+        note: '',
+        empId: '',
+        empName: ''
+      },
+      dialogFormVisible: false,
+      dialogStatus: '',
+      textMap: {
+        create: '新增',
+        update: '编辑',
+        see: '查看'
+      },
+      isokDisable: false,
+      postDataPramas: {},
+      downLoadParm: {},
+      isPercentage: false,
+      percentage: 1
+    }
+  },
+  computed: {
+    headers() {
+      return {
+        token: getToken()
+      }
+    },
+    uploadData() {
+      return {
+        name: 'uploadExaminewarnJY',
+        importParams: '牧场,设备名称,规程型号,生产厂家,出厂编号,出厂日期,使用部门,责任人,校验日期,有效期至,校验周期,备注',
+        sheetname: 'SheetJS'
+      }
+    },
+    // 设置上传地址
+    uploadExcelUrl() {
+      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
+    }
+  },
+  created() {
+    this.get_select_list()
+    this.get_table_data()
+  },
+
+  // 设置变量
+
+  methods: {
+    get_select_list() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
+        this.findAllDepart = response.data.findAllDepart.list
+        this.findAllEmploye = response.data.findAllEmploye.list
+      })
+    },
+    getNextDate(date, day) {
+      var dd = new Date(date)
+      dd.setDate(dd.getDate() + day)
+      var y = dd.getFullYear()
+      var m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1
+      var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()
+      return y + '-' + m + '-' + d
+    },
+    tableRowClassName({ row, rowIndex }) {
+      // 把每一行的索引放进row
+      row.index = rowIndex
+    },
+    get_table_data() {
+      this.listLoading = true
+      GetDataByName(this.getdataListParm).then(response => {
+        if (response.data.list !== null || response.data !== null) {
+          console.log('table数据', response.data.list)
+          this.getIndexList = []
+          for (let i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].index = i
+            if (this.getNextDate(response.data.list[i].validityDate, -30) <= parseTime(new Date(), '{y}-{m}-{d}')) {
+              this.getIndexList.push({ 'myindex': response.data.list[i].index })
+            }
+          }
+          this.list = response.data.list
+          this.pageNum = response.data.pageNum
+          this.pageSize = response.data.pageSize
+          this.total = response.data.total
+        } else {
+          this.list = []
+        }
+        setTimeout(() => {
+          this.listLoading = false
+        }, 100)
+      })
+    },
+    selectedHighlight({ row, rowIndex }) {
+      for (let i = 0; i < this.getIndexList.length; i++) {
+        if (this.getIndexList[i].myindex === rowIndex) {
+          return {
+            color: 'red'
+          }
+        }
+      }
+    },
+
+    form_search() {
+      console.log('点击了搜索')
+      this.getdataListParm.offset = 1
+      this.get_table_data()
+    },
+    resetCreateTemp() {
+      this.createTemp.pastureId = this.$store.state.user.pastureid
+      this.createTemp.pastureName = this.$store.state.user.pasturename
+      this.createTemp.departmentName = this.$store.state.user.departmentname
+      this.createTemp.departmentId = this.$store.state.user.departmentid
+      this.createTemp.warnName = ''
+      this.createTemp.specification = ''
+      this.createTemp.level = ''
+      this.createTemp.measureRange = ''
+      this.createTemp.factoryNumber = ''
+      this.createTemp.lastCheckDate = ''
+      this.createTemp.validityDate = ''
+      this.createTemp.amount = ''
+      this.createTemp.note = ''
+      this.createTemp.empName = ''
+      this.createTemp.empId = ''
+    },
+    form_add() {
+      console.log('点击了新增')
+      this.resetCreateTemp()
+      this.dialogStatus = 'create'
+      this.dialogFormVisible = true
+    },
+    changePasture(item) {
+      this.createTemp.pastureName = this.findAllPasture.find(obj => obj.id === item).name
+    },
+    changeDepartment(item) {
+      this.createTemp.departmentId = this.findAllDepart.find(obj => obj.name === item).id
+    },
+    changeEmp(item) {
+      this.createTemp.empId = this.findAllEmploye.find(obj => obj.name === item).id
+    },
+    add_dialog_save() {
+      console.log('点击了保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          this.postDataPramas.name = 'insertExaminewarning'
+          this.postDataPramas.parammaps = {}
+          this.postDataPramas.parammaps = this.createTemp
+          this.postDataPramas.parammaps.warningType = '绝缘用具'
+          PostDataByName(this.postDataPramas).then(response => {
+            console.log('新增保存发送参数', this.postDataPramas)
+            if (response.msg !== 'fail') {
+              this.dialogFormVisible = false
+              this.get_table_data()
+              this.$notify({
+                title: '成功',
+                message: '新增成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+    form_edit(row) {
+      console.log('点击了编辑')
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.createTemp = Object.assign({}, row)
+      this.createTemp.pastureId = parseFloat(row.pastureId)
+      this.createTemp.departmentId = parseFloat(row.departmentId)
+      this.createTemp.empId = parseFloat(row.empId)
+    },
+    edit_dialog_save() {
+      console.log('点击了编辑保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          this.postDataPramas.name = 'updateExaminewarning'
+          this.postDataPramas.parammaps = {}
+          this.postDataPramas.parammaps = this.createTemp
+          this.postDataPramas.parammaps.id = this.createTemp.id
+          this.postDataPramas.parammaps.warningType = '绝缘用具'
+          PostDataByName(this.postDataPramas).then(response => {
+            console.log('编辑保存发送参数', this.postDataPramas)
+            if (response.msg !== 'fail') {
+              this.dialogFormVisible = false
+              this.get_table_data()
+              this.$notify({
+                title: '成功',
+                message: '保存成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+    form_see(row) {
+      console.log('点击了查看', row)
+      this.dialogStatus = 'see'
+      this.dialogFormVisible = true
+      this.createTemp = Object.assign({}, row)
+      this.createTemp.pastureId = parseFloat(row.pastureId)
+      this.createTemp.departmentId = parseFloat(row.departmentId)
+      this.createTemp.empId = parseFloat(row.empId)
+    },
+    form_delete(row) {
+      MessageBox.confirm('确认删除此信息?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        console.log('点击了删除', row)
+        this.postDataPramas.name = 'deleteExaminewarning'
+        this.postDataPramas.parammaps = {}
+        this.postDataPramas.parammaps.id = row.id
+        this.postDataPramas.parammaps.warningType = '绝缘用具'
+        PostDataByName(this.postDataPramas).then(response => {
+          console.log('删除保存发送参数', this.postDataPramas)
+          if (response.msg !== 'fail') {
+            this.dialogFormVisible = false
+            this.get_table_data()
+            this.$notify({
+              title: '成功',
+              message: '删除成功',
+              type: 'success',
+              duration: 2000
+            })
+          } else {
+            failproccess(response, this.$notify)
+          }
+        })
+      })
+    },
+    handleDownloadTemp() {
+      console.log('点击了模板')
+      import('@/vendor/Export2Excel').then(excel => {
+        const list1 = []
+        const tHeader = [
+          '牧场', '设备名称', '规程型号', '生产厂家', '出厂编号', '出厂日期', '使用部门', '责任人', '校验日期', '有效期至', '校验周期', '备注'
+        ]
+        const filterVal = [
+          '牧场', '设备名称', '规程型号', '生产厂家', '出厂编号', '出厂日期', '使用部门', '责任人', '校验日期', '有效期至', '校验周期', '备注'
+        ]
+        const data1 = this.formatJson(filterVal, list1)
+        excel.export_json_to_excel({
+          header: tHeader,
+          data: data1,
+          filename: '绝缘用具模板',
+          autoWidth: true,
+          bookType: 'xlsx'
+        })
+      })
+    },
+    beforeImportExcel(file) {
+      const isLt2M = file.size / 1024 / 1024 < 6
+      if (!isLt2M) {
+        this.$message.error('上传文件大小不能超过 6MB!')
+      }
+      return isLt2M
+    },
+    handleImportExcelSuccess(res, file) {
+      this.get_table_data()
+      if (res.msg === 'ok') {
+        this.$message({
+          title: '成功',
+          message: '导入成功:' + res.data.success + '条!',
+          type: 'success',
+          duration: 2000
+        })
+        if (res.data.err_count > 0) {
+          this.$notify({
+            title: '失败',
+            message: '导入失败:' + res.data.err_count + '条!',
+            type: 'danger',
+            duration: 2000
+          })
+           import('@/vendor/Export2Excel').then(excel => {
+             const list1 = res.data.result
+             const tHeader = [
+               '牧场', '设备名称', '规程型号', '生产厂家', '出厂编号', '出厂日期', '使用部门', '责任人', '校验日期', '有效期至', '校验周期', '备注', '报错信息'
+             ]
+             const filterVal = [
+               '牧场', '设备名称', '规程型号', '生产厂家', '出厂编号', '出厂日期', '使用部门', '责任人', '校验日期', '有效期至', '校验周期', '备注', 'error_msg'
+             ]
+             const data1 = this.formatJson(filterVal, list1)
+             excel.export_json_to_excel({
+               header: tHeader,
+               data: data1,
+               filename: '绝缘用具报错信息',
+               autoWidth: true,
+               bookType: 'xlsx'
+             })
+           })
+        }
+      } else {
+        this.$notify({
+          title: '失败',
+          message: '上传失败',
+          type: 'danger',
+          duration: 2000
+        })
+      }
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j === 'timestamp') {
+            return parseTime(v[j])
+          } else {
+            return v[j]
+          }
+        })
+      )
+    },
+    handleDownload() {
+      console.log('点击了导出')
+      this.$alert('绝缘用具正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
+      this.isPercentage = true
+      this.percentage = 1
+      var timer = setInterval(() => {
+        this.percentage += 5
+        if (this.percentage > 95) {
+          this.percentage = 99
+          clearInterval(timer)
+        }
+        this.percentage = this.percentage
+      }, 1000)
+      this.downLoadParm.name = 'getExaminewarningList'
+      this.downLoadParm.parammaps = this.getdataListParm.parammaps
+      GetAccount(this.downLoadParm).then(response => {
+        if (response.data.list !== '') {
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+        }
+        this.$nextTick(() => {
+          this.downLoadList = response.data.list
+          console.log('导出table数据', this.downLoadList)
+          const ExcelDatas = [
+            {
+              tHeader: ['牧场', '设备名称', '规程型号', '生产厂家', '出厂编号', '出厂日期', '使用部门', '责任人', '校验日期', '有效期至', '校验周期', '备注'],
+              filterVal: ['pastureName', 'warnName', 'specification', 'level', 'measureRange', 'factoryNumber', 'departmentName', 'empName', 'lastCheckDate', 'validityDate', 'amount', 'note'],
+              tableDatas: this.downLoadList,
+              sheetName: '绝缘用具'
+            }
+          ]
+          json2excel(ExcelDatas, '绝缘用具', true, 'xlsx')
+        })
+      })
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+.app-btn {
+  margin-bottom: 10px;
+}
+</style>
+

+ 651 - 650
src/views/special/earlyWarning/components/pressureGauge.vue

@@ -1,650 +1,651 @@
-<template>
-  <div class="app-container">
-    <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
-      <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
-      <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
-    </div>
-    <div class="filter-container">
-      <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 150px;">
-        <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
-      </el-select>
-      <el-select v-model="getdataListParm.parammaps.status" placeholder="检验预警状态" class="filter-item" style="width: 150px;">
-        <el-option v-for="item in warningStatus" :key="item.id" :label="item.name" :value="item.name" />
-      </el-select>
-      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
-    </div>
-    <div class="app-btn">
-      <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
-      <el-button class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
-      <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
-        <el-button v-waves class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
-      </el-upload>
-      <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
-    </div>
-    <el-table
-      :key="tableKey"
-      v-loading="listLoading"
-      element-loading-text="给我一点时间"
-      :data="list"
-      border
-      fit
-      highlight-current-row
-      style="width: 100%;"
-      :row-class-name="tableRowClassName"
-      :row-style="selectedHighlight"
-      :cell-style="cellStyle"
-      class="elTable table-fixed"
-      :max-height="myHeight"
-    >
-      <el-table-column label="序号" align="center" type="index" width="50px">
-        <template slot-scope="scope">
-          <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="牧场" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.pastureName }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="计量器具名称" width="140px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.warnName }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="规格型号" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.specification }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="准确度等级、不确定度或最大允许误差" min-width="150px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.level }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="测量范围" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.measureRange }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="出厂编号" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.factoryNumber }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="数量" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.amount }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="制造单位" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.unit }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="检定周期" min-width="100px" align="center" sortable prop="cycle" />
-      <el-table-column label="检验日期" min-width="80px" align="center" sortable prop="lastCheckDate" />
-      <el-table-column label="有效日期" min-width="110px" align="center" sortable prop="validityDate" />
-      <el-table-column label="检定单位" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.warnUnit }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="计量器具用途" min-width="110px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.purpose }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="安装使用地点" min-width="110px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.location }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
-        <template slot-scope="{row}">
-          <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
-          <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button>
-          <el-button type="danger" size="mini" @click="form_delete(row)">删除</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
-
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="80%">
-      <div class="app-add">
-        <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="145px" style="width: 90%;margin:0 auto 30px">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item ref="pastureId" label="牧场:" prop="pastureId">
-                <el-select v-model="createTemp.pastureId " placeholder="请输入牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changePasture">
-                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="计量器具名称:" prop="warnName">
-                <el-input ref="warnName" v-model="createTemp.warnName" placeholder="请输入计量器具名称" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="规格型号:" prop="specification">
-                <el-input ref="specification" v-model="createTemp.specification" placeholder="请输入规格型号" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="准确度等级、不确定度或最大允许误差:" prop="level">
-                <el-input ref="level" v-model="createTemp.level" placeholder="请输入准确度等级、不确定度或最大允许误差" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="测量范围:" prop="measureRange">
-                <el-input ref="measureRange" v-model="createTemp.measureRange" placeholder="请输入测量范围" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="出厂编号:" prop="factoryNumber">
-                <el-input ref="factoryNumber" v-model="createTemp.factoryNumber" placeholder="请输入出厂编号" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="数量:" prop="amount">
-                <el-input ref="amount" v-model="createTemp.amount" placeholder="请输入数量" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="制造单位:" prop="unit">
-                <el-input ref="unit" v-model="createTemp.unit" placeholder="请输入制造单位" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="检定周期:" prop="cycle">
-                <el-input ref="cycle" v-model="createTemp.cycle" placeholder="请输入检定周期" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="检验日期:" prop="lastCheckDate">
-                <el-date-picker v-model="createTemp.lastCheckDate" :picker-options="pickerOptions1" type="date" placeholder="请输入检验日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="有效日期:" prop="validityDate">
-                <el-date-picker v-model="createTemp.validityDate" :picker-options="pickerOptions2" type="date" placeholder="请输入有效日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="检定单位:" prop="warnUnit">
-                <el-input ref="warnUnit" v-model="createTemp.warnUnit" placeholder="请输入检定单位" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="计量器具用途:" prop="purpose">
-                <el-input ref="purpose" v-model="createTemp.purpose" placeholder="请输入计量器具用途" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="安装使用地点:" prop="location">
-                <el-input ref="location" v-model="createTemp.location" placeholder="请输入安装使用地点" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:5px">
-          <el-button v-if="dialogStatus==='create' || dialogStatus==='update'" type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
-          <el-button @click="dialogFormVisible = false; getdataListParm.parammaps.inputDatetime = ''">取消并关闭</el-button>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import waves from '@/directive/waves'
-import { GetDataByNames, GetDataByName, PostDataByName, failproccess, GetAccount } from '@/api/common'
-import Cookies from 'js-cookie'
-import { json2excel } from '@/utils/index.js'
-import { MessageBox } from 'element-ui'
-import { getToken } from '@/utils/auth'
-import { parseTime } from '@/utils/index.js'
-import Pagination from '@/components/Pagination'
-export default {
-  name: 'PressureGauge',
-  directives: { waves },
-  components: { Pagination },
-  data() {
-    return {
-      myHeight:document.documentElement.clientHeight - 85- 250,
-      warningStatus: [{ id: 0, name: '全部' }, { id: 1, name: '正常' }, { id: 2, name: '预警期' }],
-      findAllPasture: [],
-      findAllDepart: [],
-      findAllEmploye: [],
-      requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
-      ],
-      rules: {
-        pastureId: [{ required: true, message: '必填', trigger: 'blur' }],
-        warnName: [{ required: true, message: '必填', trigger: 'blur' }],
-        specification: [{ required: true, message: '必填', trigger: 'blur' }],
-        lastCheckDate: [{ required: true, message: '必填', trigger: 'blur' }],
-        validityDate: [{ required: true, message: '必填', trigger: 'blur' }]
-      },
-      getdataListParm: {
-        name: 'getExaminewarningList',
-        page: 1,
-        offset: 1,
-        pagecount: 10,
-        returntype: 'Map',
-        parammaps: {
-          pastureName: Cookies.get('pasturename'),
-          warningType: '压力表'
-        }
-      },
-      tableKey: 0,
-      listLoading: false,
-      total: 0,
-      list: [],
-      getIndexList: [],
-      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      pickerOptions1: {
-        disabledDate: (time) => {
-          if (this.createTemp.validityDate !== '') {
-            return parseTime(time.getTime(), '{y}-{m}-{d}') >= this.createTemp.validityDate
-          } else {
-            return ''
-          }
-        }
-      },
-      pickerOptions2: {
-        disabledDate: (time) => {
-          return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.createTemp.lastCheckDate
-        }
-      },
-      createTemp: {
-        pastureId: this.$store.state.user.pastureid,
-        pastureName: this.$store.state.user.pasturename,
-        // departmentName: this.$store.state.user.departmentname,
-        // departmentId: this.$store.state.user.departmentid,
-        warnName: '',
-        specification: '',
-        level: '',
-        measureRange: '',
-        factoryNumber: '',
-        amount: '',
-        unit: '',
-        cycle: '',
-        lastCheckDate: '',
-        validityDate: '',
-        warnUnit: '',
-        purpose: '',
-        location: ''
-      },
-      dialogFormVisible: false,
-      dialogStatus: '',
-      textMap: {
-        create: '新增',
-        update: '编辑',
-        see: '查看'
-      },
-      isokDisable: false,
-      postDataPramas: {},
-      downLoadParm: {},
-      isPercentage: false,
-      percentage: 1
-    }
-  },
-  computed: {
-    headers() {
-      return {
-        token: getToken()
-      }
-    },
-    uploadData() {
-      return {
-        name: 'uploadExaminewarnYLB',
-        importParams: '牧场,计量器具名称,规格型号,准确度等级、不确定度或最大允许误差,测量范围,出厂编号,数量,制造单位,检定周期,上次检定日期,有效期至,检定单位,计量器具用途,安装使用地点',
-        sheetname: 'SheetJS'
-      }
-    },
-    // 设置上传地址
-    uploadExcelUrl() {
-      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
-    }
-  },
-  created() {
-    this.get_select_list()
-    this.get_table_data()
-  },
-
-  // 设置变量
-
-  methods: {
-    get_select_list() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
-        this.findAllDepart = response.data.findAllDepart.list
-        this.findAllEmploye = response.data.findAllEmploye.list
-      })
-    },
-    getNextDate(date, day) {
-      var dd = new Date(date)
-      dd.setDate(dd.getDate() + day)
-      var y = dd.getFullYear()
-      var m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1
-      var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()
-      return y + '-' + m + '-' + d
-    },
-    tableRowClassName({ row, rowIndex }) {
-      // 把每一行的索引放进row
-      row.index = rowIndex
-    },
-    get_table_data() {
-      this.listLoading = true
-      GetDataByName(this.getdataListParm).then(response => {
-        if (response.data.list !== null || response.data !== null) {
-          console.log('table数据', response.data.list)
-          this.getIndexList = []
-          for (let i = 0; i < response.data.list.length; i++) {
-            response.data.list[i].index = i
-            if (this.getNextDate(response.data.list[i].validityDate, -30) <= parseTime(new Date(), '{y}-{m}-{d}')) {
-              this.getIndexList.push({ 'myindex': response.data.list[i].index })
-            }
-          }
-          this.list = response.data.list
-          this.pageNum = response.data.pageNum
-          this.pageSize = response.data.pageSize
-          this.total = response.data.total
-        } else {
-          this.list = []
-        }
-        setTimeout(() => {
-          this.listLoading = false
-        }, 100)
-      })
-    },
-    selectedHighlight({ row, rowIndex }) {
-      for (let i = 0; i < this.getIndexList.length; i++) {
-        if (this.getIndexList[i].myindex === rowIndex) {
-          return {
-            color: 'red'
-          }
-        }
-      }
-    },
-
-    form_search() {
-      console.log('点击了搜索')
-      this.getdataListParm.offset = 1
-      this.get_table_data()
-    },
-    resetCreateTemp() {
-      this.createTemp.pastureId = this.$store.state.user.pastureid
-      this.createTemp.pastureName = this.$store.state.user.pasturename
-      // this.createTemp.departmentName = this.$store.state.user.departmentname
-      // this.createTemp.departmentId = this.$store.state.user.departmentid
-      this.createTemp.warnName = ''
-      this.createTemp.specification = ''
-      this.createTemp.level = ''
-      this.createTemp.measureRange = ''
-      this.createTemp.factoryNumber = ''
-      this.createTemp.amount = ''
-      this.createTemp.unit = ''
-      this.createTemp.cycle = ''
-      this.createTemp.lastCheckDate = ''
-      this.createTemp.validityDate = ''
-      this.createTemp.warnUnit = ''
-      this.createTemp.purpose = ''
-      this.createTemp.location = ''
-    },
-    form_add() {
-      console.log('点击了新增')
-      this.resetCreateTemp()
-      this.dialogStatus = 'create'
-      this.dialogFormVisible = true
-    },
-    changePasture(item) {
-      this.createTemp.pastureName = this.findAllPasture.find(obj => obj.id === item).name
-    },
-    add_dialog_save() {
-      console.log('点击了保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          this.postDataPramas.name = 'insertExaminewarning'
-          this.postDataPramas.parammaps = {}
-          this.postDataPramas.parammaps = this.createTemp
-          this.postDataPramas.parammaps.warningType = '压力表'
-          PostDataByName(this.postDataPramas).then(response => {
-            console.log('新增保存发送参数', this.postDataPramas)
-            if (response.msg !== 'fail') {
-              this.dialogFormVisible = false
-              this.get_table_data()
-              this.$notify({
-                title: '成功',
-                message: '新增成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-    form_edit(row) {
-      console.log('点击了编辑')
-      this.dialogStatus = 'update'
-      this.dialogFormVisible = true
-      this.createTemp = Object.assign({}, row)
-      this.createTemp.pastureId = parseFloat(row.pastureId)
-      this.createTemp.departmentId = parseFloat(row.departmentId)
-      this.createTemp.empId = parseFloat(row.empId)
-    },
-    edit_dialog_save() {
-      console.log('点击了编辑保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          this.postDataPramas.name = 'updateExaminewarning'
-          this.postDataPramas.parammaps = {}
-          this.postDataPramas.parammaps = this.createTemp
-          this.postDataPramas.parammaps.id = this.createTemp.id
-          this.postDataPramas.parammaps.warningType = '压力表'
-          PostDataByName(this.postDataPramas).then(response => {
-            console.log('编辑保存发送参数', this.postDataPramas)
-            if (response.msg !== 'fail') {
-              this.dialogFormVisible = false
-              this.get_table_data()
-              this.$notify({
-                title: '成功',
-                message: '保存成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-    form_see(row) {
-      console.log('点击了查看', row)
-      this.dialogStatus = 'see'
-      this.dialogFormVisible = true
-      this.createTemp = Object.assign({}, row)
-      this.createTemp.pastureId = parseFloat(row.pastureId)
-      this.createTemp.departmentId = parseFloat(row.departmentId)
-      this.createTemp.empId = parseFloat(row.empId)
-    },
-    form_delete(row) {
-      MessageBox.confirm('确认删除此信息?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        console.log('点击了删除', row)
-        this.postDataPramas.name = 'deleteExaminewarning'
-        this.postDataPramas.parammaps = {}
-        this.postDataPramas.parammaps.id = row.id
-        this.postDataPramas.parammaps.warningType = '压力表'
-        PostDataByName(this.postDataPramas).then(response => {
-          console.log('删除保存发送参数', this.postDataPramas)
-          if (response.msg !== 'fail') {
-            this.dialogFormVisible = false
-            this.get_table_data()
-            this.$notify({
-              title: '成功',
-              message: '删除成功',
-              type: 'success',
-              duration: 2000
-            })
-          } else {
-            failproccess(response, this.$notify)
-          }
-        })
-      })
-    },
-    handleDownloadTemp() {
-      console.log('点击了模板')
-      import('@/vendor/Export2Excel').then(excel => {
-        const list1 = []
-        const tHeader = [
-          '牧场', '计量器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点'
-        ]
-        const filterVal = [
-          '牧场', '计量器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点'
-        ]
-        const data1 = this.formatJson(filterVal, list1)
-        excel.export_json_to_excel({
-          header: tHeader,
-          data: data1,
-          filename: '压力表模板',
-          autoWidth: true,
-          bookType: 'xlsx'
-        })
-      })
-    },
-    beforeImportExcel(file) {
-      const isLt2M = file.size / 1024 / 1024 < 6
-      if (!isLt2M) {
-        this.$message.error('上传文件大小不能超过 6MB!')
-      }
-      return isLt2M
-    },
-    handleImportExcelSuccess(res, file) {
-      this.get_table_data()
-      if (res.msg === 'ok') {
-        this.$message({
-          title: '成功',
-          message: '导入成功:' + res.data.success + '条!',
-          type: 'success',
-          duration: 2000
-        })
-        if (res.data.err_count > 0) {
-          this.$notify({
-            title: '失败',
-            message: '导入失败:' + res.data.err_count + '条!',
-            type: 'danger',
-            duration: 2000
-          })
-           import('@/vendor/Export2Excel').then(excel => {
-             const list1 = res.data.result
-             const tHeader = [
-               '牧场', '计量器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点', '报错信息'
-             ]
-             const filterVal = [
-               '牧场', '计量器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点', 'error_msg'
-             ]
-             const data1 = this.formatJson(filterVal, list1)
-             excel.export_json_to_excel({
-               header: tHeader,
-               data: data1,
-               filename: '压力表报错信息',
-               autoWidth: true,
-               bookType: 'xlsx'
-             })
-           })
-        }
-      } else {
-        this.$notify({
-          title: '失败',
-          message: '上传失败',
-          type: 'danger',
-          duration: 2000
-        })
-      }
-    },
-    formatJson(filterVal, jsonData) {
-      return jsonData.map(v =>
-        filterVal.map(j => {
-          if (j === 'timestamp') {
-            return parseTime(v[j])
-          } else {
-            return v[j]
-          }
-        })
-      )
-    },
-    handleDownload() {
-      console.log('点击了导出')
-      this.$alert('压力表正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
-      this.isPercentage = true
-      this.percentage = 1
-      var timer = setInterval(() => {
-        this.percentage += 5
-        if (this.percentage > 95) {
-          this.percentage = 99
-          clearInterval(timer)
-        }
-        this.percentage = this.percentage
-      }, 1000)
-      this.downLoadParm.name = 'getExaminewarningList'
-      this.downLoadParm.parammaps = this.getdataListParm.parammaps
-      GetAccount(this.downLoadParm).then(response => {
-        if (response.data.list !== '') {
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-        }
-        this.$nextTick(() => {
-          this.downLoadList = response.data.list
-          console.log('导出table数据', this.downLoadList)
-          const ExcelDatas = [
-            {
-              tHeader: ['牧场', '计量器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点'],
-              filterVal: ['pastureName', 'warnName', 'specification', 'level', 'measureRange', 'factoryNumber', 'amount', 'unit', 'cycle', 'lastCheckDate', 'validityDate', 'warnUnit', 'purpose', 'location'],
-              tableDatas: this.downLoadList,
-              sheetName: '压力表'
-            }
-          ]
-          json2excel(ExcelDatas, '压力表', true, 'xlsx')
-        })
-      })
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-.app-btn {
-  margin-bottom: 10px;
-}
-</style>
-
+<template>
+  <div class="app-container">
+    <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
+      <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
+      <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
+    </div>
+    <div class="filter-container">
+      <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 150px;">
+        <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
+      <el-select v-model="getdataListParm.parammaps.status" placeholder="检验预警状态" class="filter-item" style="width: 150px;">
+        <el-option v-for="item in warningStatus" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
+      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
+    </div>
+    <div class="app-btn">
+      <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
+      <el-button class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
+      <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
+        <el-button v-waves class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
+      </el-upload>
+      <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
+    </div>
+    <el-table
+      :key="tableKey"
+      v-loading="listLoading"
+      element-loading-text="给我一点时间"
+      :data="list"
+      border
+      fit
+      highlight-current-row
+      style="width: 100%;"
+      :row-class-name="tableRowClassName"
+      :row-style="selectedHighlight"
+      :cell-style="cellStyle"
+      class="elTable table-fixed"
+      :max-height="myHeight"
+    >
+      <el-table-column label="序号" align="center" type="index" width="50px">
+        <template slot-scope="scope">
+          <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="牧场" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.pastureName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="计量器具名称" width="140px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.warnName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="规格型号" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.specification }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="准确度等级、不确定度或最大允许误差" min-width="150px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.level }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="测量范围" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.measureRange }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="出厂编号" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.factoryNumber }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="数量" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.amount }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="制造单位" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.unit }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="检定周期" min-width="100px" align="center" sortable prop="cycle" />
+      <el-table-column label="检验日期" min-width="80px" align="center" sortable prop="lastCheckDate" />
+      <el-table-column label="有效日期" min-width="110px" align="center" sortable prop="validityDate" />
+      <el-table-column label="检定单位" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.warnUnit }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="计量器具用途" min-width="110px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.purpose }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="安装使用地点" min-width="110px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.location }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
+          <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button>
+          <el-button type="danger" size="mini" @click="form_delete(row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
+
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="80%">
+      <div class="app-add">
+        <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="145px" style="width: 90%;margin:0 auto 30px">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item ref="pastureId" label="牧场:" prop="pastureId">
+                <el-select v-model="createTemp.pastureId " placeholder="请输入牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changePasture">
+                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="计量器具名称:" prop="warnName">
+                <el-input ref="warnName" v-model="createTemp.warnName" placeholder="请输入计量器具名称" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="规格型号:" prop="specification">
+                <el-input ref="specification" v-model="createTemp.specification" placeholder="请输入规格型号" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="准确度等级、不确定度或最大允许误差:" prop="level">
+                <el-input ref="level" v-model="createTemp.level" placeholder="请输入准确度等级、不确定度或最大允许误差" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="测量范围:" prop="measureRange">
+                <el-input ref="measureRange" v-model="createTemp.measureRange" placeholder="请输入测量范围" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="出厂编号:" prop="factoryNumber">
+                <el-input ref="factoryNumber" v-model="createTemp.factoryNumber" placeholder="请输入出厂编号" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="数量:" prop="amount">
+                <el-input ref="amount" v-model="createTemp.amount" placeholder="请输入数量" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="制造单位:" prop="unit">
+                <el-input ref="unit" v-model="createTemp.unit" placeholder="请输入制造单位" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="检定周期:" prop="cycle">
+                <el-input ref="cycle" v-model="createTemp.cycle" placeholder="请输入检定周期" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="检验日期:" prop="lastCheckDate">
+                <el-date-picker v-model="createTemp.lastCheckDate" :picker-options="pickerOptions1" type="date" placeholder="请输入检验日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="有效日期:" prop="validityDate">
+                <el-date-picker v-model="createTemp.validityDate" :picker-options="pickerOptions2" type="date" placeholder="请输入有效日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="检定单位:" prop="warnUnit">
+                <el-input ref="warnUnit" v-model="createTemp.warnUnit" placeholder="请输入检定单位" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="计量器具用途:" prop="purpose">
+                <el-input ref="purpose" v-model="createTemp.purpose" placeholder="请输入计量器具用途" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="安装使用地点:" prop="location">
+                <el-input ref="location" v-model="createTemp.location" placeholder="请输入安装使用地点" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:5px">
+          <el-button v-if="dialogStatus==='create' || dialogStatus==='update'" type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
+          <el-button @click="dialogFormVisible = false; getdataListParm.parammaps.inputDatetime = ''">取消并关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import waves from '@/directive/waves'
+import { GetDataByNames, GetDataByName, PostDataByName, failproccess, GetAccount } from '@/api/common'
+import Cookies from 'js-cookie'
+import { json2excel } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+import { getToken } from '@/utils/auth'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'PressureGauge',
+  directives: { waves },
+  components: { Pagination },
+  data() {
+    return {
+      myHeight: document.documentElement.clientHeight - 85 - 250,
+      warningStatus: [{ id: 0, name: '全部' }, { id: 1, name: '正常' }, { id: 2, name: '预警期' }],
+      findAllPasture: [],
+      findAllDepart: [],
+      findAllEmploye: [],
+      requestParams: [
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
+      ],
+      rules: {
+        pastureId: [{ required: true, message: '必填', trigger: 'blur' }],
+        warnName: [{ required: true, message: '必填', trigger: 'blur' }],
+        specification: [{ required: true, message: '必填', trigger: 'blur' }],
+        lastCheckDate: [{ required: true, message: '必填', trigger: 'blur' }],
+        validityDate: [{ required: true, message: '必填', trigger: 'blur' }]
+      },
+      getdataListParm: {
+        name: 'getExaminewarningList',
+        page: 1,
+        offset: 1,
+        pagecount: 10,
+        returntype: 'Map',
+        parammaps: {
+          pastureName: Cookies.get('pasturename'),
+          warningType: '压力表'
+        }
+      },
+      tableKey: 0,
+      listLoading: false,
+      total: 0,
+      list: [],
+      getIndexList: [],
+      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      pickerOptions1: {
+        disabledDate: (time) => {
+          if (this.createTemp.validityDate !== '') {
+            return parseTime(time.getTime(), '{y}-{m}-{d}') >= this.createTemp.validityDate
+          } else {
+            return ''
+          }
+        }
+      },
+      pickerOptions2: {
+        disabledDate: (time) => {
+          return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.createTemp.lastCheckDate
+        }
+      },
+      createTemp: {
+        pastureId: this.$store.state.user.pastureid,
+        pastureName: this.$store.state.user.pasturename,
+        // departmentName: this.$store.state.user.departmentname,
+        // departmentId: this.$store.state.user.departmentid,
+        warnName: '',
+        specification: '',
+        level: '',
+        measureRange: '',
+        factoryNumber: '',
+        amount: '',
+        unit: '',
+        cycle: '',
+        lastCheckDate: '',
+        validityDate: '',
+        warnUnit: '',
+        purpose: '',
+        location: ''
+      },
+      dialogFormVisible: false,
+      dialogStatus: '',
+      textMap: {
+        create: '新增',
+        update: '编辑',
+        see: '查看'
+      },
+      isokDisable: false,
+      postDataPramas: {},
+      downLoadParm: {},
+      isPercentage: false,
+      percentage: 1
+    }
+  },
+  computed: {
+    headers() {
+      return {
+        token: getToken()
+      }
+    },
+    uploadData() {
+      return {
+        name: 'uploadExaminewarnYLB',
+        importParams: '牧场,计量器具名称,规格型号,准确度等级、不确定度或最大允许误差,测量范围,出厂编号,数量,制造单位,检定周期,上次检定日期,有效期至,检定单位,计量器具用途,安装使用地点',
+        sheetname: 'SheetJS'
+      }
+    },
+    // 设置上传地址
+    uploadExcelUrl() {
+      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
+    }
+  },
+  created() {
+    this.get_select_list()
+    this.get_table_data()
+  },
+
+  // 设置变量
+
+  methods: {
+    get_select_list() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
+        this.findAllDepart = response.data.findAllDepart.list
+        this.findAllEmploye = response.data.findAllEmploye.list
+      })
+    },
+    getNextDate(date, day) {
+      var dd = new Date(date)
+      dd.setDate(dd.getDate() + day)
+      var y = dd.getFullYear()
+      var m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1
+      var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()
+      return y + '-' + m + '-' + d
+    },
+    tableRowClassName({ row, rowIndex }) {
+      // 把每一行的索引放进row
+      row.index = rowIndex
+    },
+    get_table_data() {
+      this.listLoading = true
+      GetDataByName(this.getdataListParm).then(response => {
+        if (response.data.list !== null || response.data !== null) {
+          console.log('table数据', response.data.list)
+          this.getIndexList = []
+          for (let i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].index = i
+            if (this.getNextDate(response.data.list[i].validityDate, -30) <= parseTime(new Date(), '{y}-{m}-{d}')) {
+              this.getIndexList.push({ 'myindex': response.data.list[i].index })
+            }
+          }
+          this.list = response.data.list
+          this.pageNum = response.data.pageNum
+          this.pageSize = response.data.pageSize
+          this.total = response.data.total
+        } else {
+          this.list = []
+        }
+        setTimeout(() => {
+          this.listLoading = false
+        }, 100)
+      })
+    },
+    selectedHighlight({ row, rowIndex }) {
+      for (let i = 0; i < this.getIndexList.length; i++) {
+        if (this.getIndexList[i].myindex === rowIndex) {
+          return {
+            color: 'red'
+          }
+        }
+      }
+    },
+
+    form_search() {
+      console.log('点击了搜索')
+      this.getdataListParm.offset = 1
+      this.get_table_data()
+    },
+    resetCreateTemp() {
+      this.createTemp.pastureId = this.$store.state.user.pastureid
+      this.createTemp.pastureName = this.$store.state.user.pasturename
+      // this.createTemp.departmentName = this.$store.state.user.departmentname
+      // this.createTemp.departmentId = this.$store.state.user.departmentid
+      this.createTemp.warnName = ''
+      this.createTemp.specification = ''
+      this.createTemp.level = ''
+      this.createTemp.measureRange = ''
+      this.createTemp.factoryNumber = ''
+      this.createTemp.amount = ''
+      this.createTemp.unit = ''
+      this.createTemp.cycle = ''
+      this.createTemp.lastCheckDate = ''
+      this.createTemp.validityDate = ''
+      this.createTemp.warnUnit = ''
+      this.createTemp.purpose = ''
+      this.createTemp.location = ''
+    },
+    form_add() {
+      console.log('点击了新增')
+      this.resetCreateTemp()
+      this.dialogStatus = 'create'
+      this.dialogFormVisible = true
+    },
+    changePasture(item) {
+      this.createTemp.pastureName = this.findAllPasture.find(obj => obj.id === item).name
+    },
+    add_dialog_save() {
+      console.log('点击了保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          this.postDataPramas.name = 'insertExaminewarning'
+          this.postDataPramas.parammaps = {}
+          this.postDataPramas.parammaps = this.createTemp
+          this.postDataPramas.parammaps.warningType = '压力表'
+          PostDataByName(this.postDataPramas).then(response => {
+            console.log('新增保存发送参数', this.postDataPramas)
+            if (response.msg !== 'fail') {
+              this.dialogFormVisible = false
+              this.get_table_data()
+              this.$notify({
+                title: '成功',
+                message: '新增成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+    form_edit(row) {
+      console.log('点击了编辑')
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.createTemp = Object.assign({}, row)
+      this.createTemp.pastureId = parseFloat(row.pastureId)
+      this.createTemp.departmentId = parseFloat(row.departmentId)
+      this.createTemp.empId = parseFloat(row.empId)
+    },
+    edit_dialog_save() {
+      console.log('点击了编辑保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          this.postDataPramas.name = 'updateExaminewarning'
+          this.postDataPramas.parammaps = {}
+          this.postDataPramas.parammaps = this.createTemp
+          this.postDataPramas.parammaps.id = this.createTemp.id
+          this.postDataPramas.parammaps.warningType = '压力表'
+          PostDataByName(this.postDataPramas).then(response => {
+            console.log('编辑保存发送参数', this.postDataPramas)
+            if (response.msg !== 'fail') {
+              this.dialogFormVisible = false
+              this.get_table_data()
+              this.$notify({
+                title: '成功',
+                message: '保存成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+    form_see(row) {
+      console.log('点击了查看', row)
+      this.dialogStatus = 'see'
+      this.dialogFormVisible = true
+      this.createTemp = Object.assign({}, row)
+      this.createTemp.pastureId = parseFloat(row.pastureId)
+      this.createTemp.departmentId = parseFloat(row.departmentId)
+      this.createTemp.empId = parseFloat(row.empId)
+    },
+    form_delete(row) {
+      MessageBox.confirm('确认删除此信息?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        console.log('点击了删除', row)
+        this.postDataPramas.name = 'deleteExaminewarning'
+        this.postDataPramas.parammaps = {}
+        this.postDataPramas.parammaps.id = row.id
+        this.postDataPramas.parammaps.warningType = '压力表'
+        PostDataByName(this.postDataPramas).then(response => {
+          console.log('删除保存发送参数', this.postDataPramas)
+          if (response.msg !== 'fail') {
+            this.dialogFormVisible = false
+            this.get_table_data()
+            this.$notify({
+              title: '成功',
+              message: '删除成功',
+              type: 'success',
+              duration: 2000
+            })
+          } else {
+            failproccess(response, this.$notify)
+          }
+        })
+      })
+    },
+    handleDownloadTemp() {
+      console.log('点击了模板')
+      import('@/vendor/Export2Excel').then(excel => {
+        const list1 = []
+        const tHeader = [
+          '牧场', '计量器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点'
+        ]
+        const filterVal = [
+          '牧场', '计量器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点'
+        ]
+        const data1 = this.formatJson(filterVal, list1)
+        excel.export_json_to_excel({
+          header: tHeader,
+          data: data1,
+          filename: '压力表模板',
+          autoWidth: true,
+          bookType: 'xlsx'
+        })
+      })
+    },
+    beforeImportExcel(file) {
+      const isLt2M = file.size / 1024 / 1024 < 6
+      if (!isLt2M) {
+        this.$message.error('上传文件大小不能超过 6MB!')
+      }
+      return isLt2M
+    },
+    handleImportExcelSuccess(res, file) {
+      this.get_table_data()
+      if (res.msg === 'ok') {
+        this.$message({
+          title: '成功',
+          message: '导入成功:' + res.data.success + '条!',
+          type: 'success',
+          duration: 2000
+        })
+        if (res.data.err_count > 0) {
+          this.$notify({
+            title: '失败',
+            message: '导入失败:' + res.data.err_count + '条!',
+            type: 'danger',
+            duration: 2000
+          })
+           import('@/vendor/Export2Excel').then(excel => {
+             const list1 = res.data.result
+             const tHeader = [
+               '牧场', '计量器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点', '报错信息'
+             ]
+             const filterVal = [
+               '牧场', '计量器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点', 'error_msg'
+             ]
+             const data1 = this.formatJson(filterVal, list1)
+             excel.export_json_to_excel({
+               header: tHeader,
+               data: data1,
+               filename: '压力表报错信息',
+               autoWidth: true,
+               bookType: 'xlsx'
+             })
+           })
+        }
+      } else {
+        this.$notify({
+          title: '失败',
+          message: '上传失败',
+          type: 'danger',
+          duration: 2000
+        })
+      }
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j === 'timestamp') {
+            return parseTime(v[j])
+          } else {
+            return v[j]
+          }
+        })
+      )
+    },
+    handleDownload() {
+      console.log('点击了导出')
+      this.$alert('压力表正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
+      this.isPercentage = true
+      this.percentage = 1
+      var timer = setInterval(() => {
+        this.percentage += 5
+        if (this.percentage > 95) {
+          this.percentage = 99
+          clearInterval(timer)
+        }
+        this.percentage = this.percentage
+      }, 1000)
+      this.downLoadParm.name = 'getExaminewarningList'
+      this.downLoadParm.parammaps = this.getdataListParm.parammaps
+      GetAccount(this.downLoadParm).then(response => {
+        if (response.data.list !== '') {
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+        }
+        this.$nextTick(() => {
+          this.downLoadList = response.data.list
+          console.log('导出table数据', this.downLoadList)
+          const ExcelDatas = [
+            {
+              tHeader: ['牧场', '计量器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点'],
+              filterVal: ['pastureName', 'warnName', 'specification', 'level', 'measureRange', 'factoryNumber', 'amount', 'unit', 'cycle', 'lastCheckDate', 'validityDate', 'warnUnit', 'purpose', 'location'],
+              tableDatas: this.downLoadList,
+              sheetName: '压力表'
+            }
+          ]
+          json2excel(ExcelDatas, '压力表', true, 'xlsx')
+        })
+      })
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+.app-btn {
+  margin-bottom: 10px;
+}
+</style>
+

+ 654 - 653
src/views/special/earlyWarning/components/safetyValve.vue

@@ -1,364 +1,365 @@
-<template>
-  <div class="app-container">
-    <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
-      <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
-      <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
-    </div>
-    <div class="filter-container">
-      <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 150px;">
-        <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
-      </el-select>
-      <el-select v-model="getdataListParm.parammaps.status" placeholder="检验预警状态" class="filter-item" style="width: 150px;">
-        <el-option v-for="item in warningStatus" :key="item.id" :label="item.name" :value="item.name" />
-      </el-select>
-      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
-    </div>
-    <div class="app-btn">
-      <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
-      <el-button class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
-      <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
-        <el-button v-waves class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
-      </el-upload>
-      <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
-    </div>
-
-    <el-table
-      :key="tableKey"
-      v-loading="listLoading"
-      element-loading-text="给我一点时间"
-      :data="list"
-      border
-      fit
-      highlight-current-row
-      style="width: 100%;"
-      :row-class-name="tableRowClassName"
-      :row-style="selectedHighlight"
-      :cell-style="cellStyle"
-      class="elTable table-fixed"
-      :max-height="myHeight"
-    >
-      <el-table-column label="序号" align="center" type="index" width="50px">
-        <template slot-scope="scope">
-          <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="牧场" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.pastureName }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="安全阀类型" width="140px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.warnName }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="安全阀型号" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.specification }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="公称通径" min-width="100px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.level }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="公称压力MPa" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.measureRange }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="工作压力MPa" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.factoryNumber }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="整定压力MPa" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.amount }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="起跳压力MPa" min-width="100px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.unit }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="回座压力MPa" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.cycle }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="使用位置" min-width="110px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.warnUnit }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="使用部门" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.departmentName }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="检验日期" min-width="110px" align="center" sortable prop="lastCheckDate" />
-      <el-table-column label="有效日期" min-width="110px" align="center" sortable prop="validityDate" />
-      <el-table-column label="管理责任人" min-width="110px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.empName }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
-        <template slot-scope="{row}">
-          <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
-          <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button>
-          <el-button type="danger" size="mini" @click="form_delete(row)">删除</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
-
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="80%">
-      <div class="app-add">
-        <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="115px" style="width: 90%;margin:0 auto 30px">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item ref="pastureId" label="牧场:" prop="pastureId">
-                <el-select v-model="createTemp.pastureId " placeholder="请输入牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changePasture">
-                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="安全阀类型:" prop="warnName">
-                <el-input ref="warnName" v-model="createTemp.warnName" placeholder="请输入安全阀类型" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="安全阀型号:" prop="specification">
-                <el-input ref="specification" v-model="createTemp.specification" placeholder="请输入安全阀型号" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="公称通径:" prop="level">
-                <el-input ref="level" v-model="createTemp.level" placeholder="请输入公称通径" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="公称压力MPa:" prop="measureRange">
-                <el-input ref="measureRange" v-model="createTemp.measureRange" placeholder="请输入公称压力MPa" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="工作压力MPa:" prop="factoryNumber">
-                <el-input ref="factoryNumber" v-model="createTemp.factoryNumber" placeholder="请输入工作压力MPa" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="整定压力MPa:" prop="amount">
-                <el-input ref="amount" v-model="createTemp.amount" placeholder="请输入整定压力MPa" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="起跳压力MPa:" prop="unit">
-                <el-input ref="unit" v-model="createTemp.unit" placeholder="请输入起跳压力MPa" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="回座压力MPa:" prop="cycle">
-                <el-input ref="cycle" v-model="createTemp.cycle" placeholder="请输入回座压力MPa" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="使用位置:" prop="warnUnit">
-                <el-input ref="warnUnit" v-model="createTemp.warnUnit" placeholder="请输入使用位置" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="使用部门:" prop="departmentName">
-                <el-select v-model="createTemp.departmentName" placeholder="请输入使用部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changeDepartment">
-                  <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.name" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="检验日期:" prop="lastCheckDate">
-                <el-date-picker v-model="createTemp.lastCheckDate" type="date" :picker-options="pickerOptions1" placeholder="请输入检验日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="有效日期:" prop="validityDate">
-                <el-date-picker v-model="createTemp.validityDate" type="date" :picker-options="pickerOptions2" placeholder="请输入有效日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="管理责任人:" prop="empName">
-                <el-select ref="empName" v-model="createTemp.empName" filterable placeholder="请输入管理责任人" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changeEmp">
-                  <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.name" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:5px">
-          <el-button v-if="dialogStatus==='create' || dialogStatus==='update'" type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
-          <el-button @click="dialogFormVisible = false; getdataListParm.parammaps.inputDatetime = ''">取消并关闭</el-button>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import waves from '@/directive/waves'
-import { GetDataByNames, GetDataByName, PostDataByName, failproccess, GetAccount } from '@/api/common'
-import Cookies from 'js-cookie'
-import { json2excel } from '@/utils/index.js'
-import { MessageBox } from 'element-ui'
-import { getToken } from '@/utils/auth'
-import { parseTime } from '@/utils/index.js'
-import Pagination from '@/components/Pagination'
-export default {
-  name: 'SafetyValve',
-  directives: { waves },
-  components: { Pagination },
-  data() {
-    return {
-      myHeight:document.documentElement.clientHeight - 85- 250,
-      warningStatus: [{ id: 0, name: '全部' }, { id: 1, name: '正常' }, { id: 2, name: '预警期' }],
-      findAllPasture: [],
-      findAllDepart: [],
-      findAllEmploye: [],
-      requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
-      ],
-      rules: {
-        pastureId: [{ required: true, message: '必填', trigger: 'blur' }],
-        warnName: [{ required: true, message: '必填', trigger: 'blur' }],
-        specification: [{ required: true, message: '必填', trigger: 'blur' }],
-        lastCheckDate: [{ required: true, message: '必填', trigger: 'blur' }],
-        validityDate: [{ required: true, message: '必填', trigger: 'blur' }]
-      },
-      getdataListParm: {
-        name: 'getExaminewarningList',
-        page: 1,
-        offset: 1,
-        pagecount: 10,
-        returntype: 'Map',
-        parammaps: {
-          pastureName: Cookies.get('pasturename'),
-          warningType: '安全阀'
-        }
-      },
-      tableKey: 0,
-      listLoading: false,
-      total: 0,
-      list: [],
-      getIndexList: [],
-      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      pickerOptions1: {
-        disabledDate: (time) => {
-          if (this.createTemp.validityDate !== '') {
-            return parseTime(time.getTime(), '{y}-{m}-{d}') >= this.createTemp.validityDate
-          } else {
-            return ''
-          }
-        }
-      },
-      pickerOptions2: {
-        disabledDate: (time) => {
-          return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.createTemp.lastCheckDate
-        }
-      },
-      createTemp: {
-        pastureId: this.$store.state.user.pastureid,
-        pastureName: this.$store.state.user.pasturename,
-        departmentName: this.$store.state.user.departmentname,
-        departmentId: this.$store.state.user.departmentid,
-        warnName: '',
-        specification: '',
-        level: '',
-        measureRange: '',
-        factoryNumber: '',
-        amount: '',
-        unit: '',
-        cycle: '',
-        warnUnit: '',
-        lastCheckDate: '',
-        validityDate: '',
-        empName: '',
-        empId: ''
-      },
-      dialogFormVisible: false,
-      dialogStatus: '',
-      textMap: {
-        create: '新增',
-        update: '编辑',
-        see: '查看'
-      },
-      isokDisable: false,
-      postDataPramas: {},
-      downLoadParm: {},
-      isPercentage: false,
-      percentage: 1
-    }
-  },
-  computed: {
-    headers() {
-      return {
-        token: getToken()
-      }
-    },
-    uploadData() {
-      return {
-        name: 'uploadExaminewarnAQF',
-        importParams: '牧场,安全阀类型,安全阀型号,公称通径,公称压力MPa,工作压力MPa,整定压力MPa,起跳压力MPa,回座压力MPa,使用位置,使用部门,本次检验日期,下次检验日期,管理责任人',
-        sheetname: 'SheetJS'
-      }
-    },
-    // 设置上传地址
-    uploadExcelUrl() {
-      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
-    }
-  },
-  created() {
-    this.get_select_list()
-    this.get_table_data()
-  },
-
-  // 设置变量
-
-  methods: {
-    get_select_list() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
-        this.findAllDepart = response.data.findAllDepart.list
-        this.findAllEmploye = response.data.findAllEmploye.list
-      })
-    },
-    getNextDate(date, day) {
-      var dd = new Date(date)
-      dd.setDate(dd.getDate() + day)
-      var y = dd.getFullYear()
-      var m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1
-      var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()
-      return y + '-' + m + '-' + d
-    },
-    tableRowClassName({ row, rowIndex }) {
-      // 把每一行的索引放进row
-      row.index = rowIndex
-    },
-    get_table_data() {
-      this.listLoading = true
-      GetDataByName(this.getdataListParm).then(response => {
-        if (response.data.list !== null || response.data !== null) {
+<template>
+  <div class="app-container">
+    <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
+      <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
+      <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
+    </div>
+    <div class="filter-container">
+      <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 150px;">
+        <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
+      <el-select v-model="getdataListParm.parammaps.status" placeholder="检验预警状态" class="filter-item" style="width: 150px;">
+        <el-option v-for="item in warningStatus" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
+      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
+    </div>
+    <div class="app-btn">
+      <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
+      <el-button class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
+      <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
+        <el-button v-waves class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
+      </el-upload>
+      <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
+    </div>
+
+    <el-table
+      :key="tableKey"
+      v-loading="listLoading"
+      element-loading-text="给我一点时间"
+      :data="list"
+      border
+      fit
+      highlight-current-row
+      style="width: 100%;"
+      :row-class-name="tableRowClassName"
+      :row-style="selectedHighlight"
+      :cell-style="cellStyle"
+      class="elTable table-fixed"
+      :max-height="myHeight"
+    >
+      <el-table-column label="序号" align="center" type="index" width="50px">
+        <template slot-scope="scope">
+          <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="牧场" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.pastureName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="安全阀类型" width="140px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.warnName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="安全阀型号" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.specification }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="公称通径" min-width="100px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.level }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="公称压力MPa" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.measureRange }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="工作压力MPa" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.factoryNumber }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="整定压力MPa" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.amount }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="起跳压力MPa" min-width="100px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.unit }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="回座压力MPa" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.cycle }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="使用位置" min-width="110px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.warnUnit }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="使用部门" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.departmentName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="检验日期" min-width="110px" align="center" sortable prop="lastCheckDate" />
+      <el-table-column label="有效日期" min-width="110px" align="center" sortable prop="validityDate" />
+      <el-table-column label="管理责任人" min-width="110px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.empName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
+          <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button>
+          <el-button type="danger" size="mini" @click="form_delete(row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
+
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="80%">
+      <div class="app-add">
+        <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="115px" style="width: 90%;margin:0 auto 30px">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item ref="pastureId" label="牧场:" prop="pastureId">
+                <el-select v-model="createTemp.pastureId " placeholder="请输入牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changePasture">
+                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="安全阀类型:" prop="warnName">
+                <el-input ref="warnName" v-model="createTemp.warnName" placeholder="请输入安全阀类型" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="安全阀型号:" prop="specification">
+                <el-input ref="specification" v-model="createTemp.specification" placeholder="请输入安全阀型号" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="公称通径:" prop="level">
+                <el-input ref="level" v-model="createTemp.level" placeholder="请输入公称通径" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="公称压力MPa:" prop="measureRange">
+                <el-input ref="measureRange" v-model="createTemp.measureRange" placeholder="请输入公称压力MPa" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="工作压力MPa:" prop="factoryNumber">
+                <el-input ref="factoryNumber" v-model="createTemp.factoryNumber" placeholder="请输入工作压力MPa" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="整定压力MPa:" prop="amount">
+                <el-input ref="amount" v-model="createTemp.amount" placeholder="请输入整定压力MPa" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="起跳压力MPa:" prop="unit">
+                <el-input ref="unit" v-model="createTemp.unit" placeholder="请输入起跳压力MPa" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="回座压力MPa:" prop="cycle">
+                <el-input ref="cycle" v-model="createTemp.cycle" placeholder="请输入回座压力MPa" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="使用位置:" prop="warnUnit">
+                <el-input ref="warnUnit" v-model="createTemp.warnUnit" placeholder="请输入使用位置" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="使用部门:" prop="departmentName">
+                <el-select v-model="createTemp.departmentName" placeholder="请输入使用部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changeDepartment">
+                  <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.name" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="检验日期:" prop="lastCheckDate">
+                <el-date-picker v-model="createTemp.lastCheckDate" type="date" :picker-options="pickerOptions1" placeholder="请输入检验日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="有效日期:" prop="validityDate">
+                <el-date-picker v-model="createTemp.validityDate" type="date" :picker-options="pickerOptions2" placeholder="请输入有效日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="管理责任人:" prop="empName">
+                <el-select ref="empName" v-model="createTemp.empName" filterable placeholder="请输入管理责任人" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changeEmp">
+                  <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.name" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:5px">
+          <el-button v-if="dialogStatus==='create' || dialogStatus==='update'" type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
+          <el-button @click="dialogFormVisible = false; getdataListParm.parammaps.inputDatetime = ''">取消并关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import waves from '@/directive/waves'
+import { GetDataByNames, GetDataByName, PostDataByName, failproccess, GetAccount } from '@/api/common'
+import Cookies from 'js-cookie'
+import { json2excel } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+import { getToken } from '@/utils/auth'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'SafetyValve',
+  directives: { waves },
+  components: { Pagination },
+  data() {
+    return {
+      myHeight: document.documentElement.clientHeight - 85 - 250,
+      warningStatus: [{ id: 0, name: '全部' }, { id: 1, name: '正常' }, { id: 2, name: '预警期' }],
+      findAllPasture: [],
+      findAllDepart: [],
+      findAllEmploye: [],
+      requestParams: [
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
+      ],
+      rules: {
+        pastureId: [{ required: true, message: '必填', trigger: 'blur' }],
+        warnName: [{ required: true, message: '必填', trigger: 'blur' }],
+        specification: [{ required: true, message: '必填', trigger: 'blur' }],
+        lastCheckDate: [{ required: true, message: '必填', trigger: 'blur' }],
+        validityDate: [{ required: true, message: '必填', trigger: 'blur' }]
+      },
+      getdataListParm: {
+        name: 'getExaminewarningList',
+        page: 1,
+        offset: 1,
+        pagecount: 10,
+        returntype: 'Map',
+        parammaps: {
+          pastureName: Cookies.get('pasturename'),
+          warningType: '安全阀'
+        }
+      },
+      tableKey: 0,
+      listLoading: false,
+      total: 0,
+      list: [],
+      getIndexList: [],
+      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      pickerOptions1: {
+        disabledDate: (time) => {
+          if (this.createTemp.validityDate !== '') {
+            return parseTime(time.getTime(), '{y}-{m}-{d}') >= this.createTemp.validityDate
+          } else {
+            return ''
+          }
+        }
+      },
+      pickerOptions2: {
+        disabledDate: (time) => {
+          return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.createTemp.lastCheckDate
+        }
+      },
+      createTemp: {
+        pastureId: this.$store.state.user.pastureid,
+        pastureName: this.$store.state.user.pasturename,
+        departmentName: this.$store.state.user.departmentname,
+        departmentId: this.$store.state.user.departmentid,
+        warnName: '',
+        specification: '',
+        level: '',
+        measureRange: '',
+        factoryNumber: '',
+        amount: '',
+        unit: '',
+        cycle: '',
+        warnUnit: '',
+        lastCheckDate: '',
+        validityDate: '',
+        empName: '',
+        empId: ''
+      },
+      dialogFormVisible: false,
+      dialogStatus: '',
+      textMap: {
+        create: '新增',
+        update: '编辑',
+        see: '查看'
+      },
+      isokDisable: false,
+      postDataPramas: {},
+      downLoadParm: {},
+      isPercentage: false,
+      percentage: 1
+    }
+  },
+  computed: {
+    headers() {
+      return {
+        token: getToken()
+      }
+    },
+    uploadData() {
+      return {
+        name: 'uploadExaminewarnAQF',
+        importParams: '牧场,安全阀类型,安全阀型号,公称通径,公称压力MPa,工作压力MPa,整定压力MPa,起跳压力MPa,回座压力MPa,使用位置,使用部门,本次检验日期,下次检验日期,管理责任人',
+        sheetname: 'SheetJS'
+      }
+    },
+    // 设置上传地址
+    uploadExcelUrl() {
+      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
+    }
+  },
+  created() {
+    this.get_select_list()
+    this.get_table_data()
+  },
+
+  // 设置变量
+
+  methods: {
+    get_select_list() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
+        this.findAllDepart = response.data.findAllDepart.list
+        this.findAllEmploye = response.data.findAllEmploye.list
+      })
+    },
+    getNextDate(date, day) {
+      var dd = new Date(date)
+      dd.setDate(dd.getDate() + day)
+      var y = dd.getFullYear()
+      var m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1
+      var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()
+      return y + '-' + m + '-' + d
+    },
+    tableRowClassName({ row, rowIndex }) {
+      // 把每一行的索引放进row
+      row.index = rowIndex
+    },
+    get_table_data() {
+      this.listLoading = true
+      GetDataByName(this.getdataListParm).then(response => {
+        if (response.data.list !== null || response.data !== null) {
           console.log('table数据', response.data.list)
           this.getIndexList = []
           for (let i = 0; i < response.data.list.length; i++) {
@@ -370,296 +371,296 @@ export default {
           this.list = response.data.list
           this.pageNum = response.data.pageNum
           this.pageSize = response.data.pageSize
-          this.total = response.data.total
+          this.total = response.data.total
         } else {
-          this.list = []
-        }
-        setTimeout(() => {
-          this.listLoading = false
-        }, 100)
-      })
-    },
-    selectedHighlight({ row, rowIndex }) {
-      for (let i = 0; i < this.getIndexList.length; i++) {
-        if (this.getIndexList[i].myindex === rowIndex) {
-          return {
-            color: 'red'
-          }
-        }
-      }
-    },
-
-    form_search() {
-      console.log('点击了搜索')
-      this.getdataListParm.offset = 1
-      this.get_table_data()
-    },
-    resetCreateTemp() {
-      this.createTemp.pastureId = this.$store.state.user.pastureid
-      this.createTemp.pastureName = this.$store.state.user.pasturename
-      this.createTemp.departmentName = this.$store.state.user.departmentname
-      this.createTemp.departmentId = this.$store.state.user.departmentid
-      this.createTemp.warnName = ''
-      this.createTemp.specification = ''
-      this.createTemp.level = ''
-      this.createTemp.measureRange = ''
-      this.createTemp.factoryNumber = ''
-      this.createTemp.amount = ''
-      this.createTemp.unit = ''
-      this.createTemp.cycle = ''
-      this.createTemp.warnUnit = ''
-      this.createTemp.lastCheckDate = ''
-      this.createTemp.validityDate = ''
-      this.createTemp.empName = ''
-      this.createTemp.empId = ''
-    },
-    form_add() {
-      console.log('点击了新增')
-      this.resetCreateTemp()
-      this.dialogStatus = 'create'
-      this.dialogFormVisible = true
-    },
-    changePasture(item) {
-      this.createTemp.pastureName = this.findAllPasture.find(obj => obj.id === item).name
-    },
-    changeDepartment(item) {
-      this.createTemp.departmentId = this.findAllDepart.find(obj => obj.name === item).id
-    },
-    changeEmp(item) {
-      this.createTemp.empId = this.findAllEmploye.find(obj => obj.name === item).id
-    },
-    add_dialog_save() {
-      console.log('点击了保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          this.postDataPramas.name = 'insertExaminewarning'
-          this.postDataPramas.parammaps = {}
-          this.postDataPramas.parammaps = this.createTemp
-          this.postDataPramas.parammaps.warningType = '安全阀'
-          PostDataByName(this.postDataPramas).then(response => {
-            console.log('新增保存发送参数', this.postDataPramas)
-            if (response.msg !== 'fail') {
-              this.dialogFormVisible = false
-              this.get_table_data()
-              this.$notify({
-                title: '成功',
-                message: '新增成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-    form_edit(row) {
-      console.log('点击了编辑')
-      this.dialogStatus = 'update'
-      this.dialogFormVisible = true
-      this.createTemp = Object.assign({}, row)
-      this.createTemp.pastureId = parseFloat(row.pastureId)
-      this.createTemp.departmentId = parseFloat(row.departmentId)
-      this.createTemp.empId = parseFloat(row.empId)
-    },
-    edit_dialog_save() {
-      console.log('点击了编辑保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          this.postDataPramas.name = 'updateExaminewarning'
-          this.postDataPramas.parammaps = {}
-          this.postDataPramas.parammaps = this.createTemp
-          this.postDataPramas.parammaps.id = this.createTemp.id
-          this.postDataPramas.parammaps.warningType = '安全阀'
-          PostDataByName(this.postDataPramas).then(response => {
-            console.log('编辑保存发送参数', this.postDataPramas)
-            if (response.msg !== 'fail') {
-              this.dialogFormVisible = false
-              this.get_table_data()
-              this.$notify({
-                title: '成功',
-                message: '保存成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-    form_see(row) {
-      console.log('点击了查看', row)
-      this.dialogStatus = 'see'
-      this.dialogFormVisible = true
-      this.createTemp = Object.assign({}, row)
-      this.createTemp.pastureId = parseFloat(row.pastureId)
-      this.createTemp.departmentId = parseFloat(row.departmentId)
-      this.createTemp.empId = parseFloat(row.empId)
-    },
-    form_delete(row) {
-      MessageBox.confirm('确认删除此信息?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        console.log('点击了删除', row)
-        this.postDataPramas.name = 'deleteExaminewarning'
-        this.postDataPramas.parammaps = {}
-        this.postDataPramas.parammaps.id = row.id
-        this.postDataPramas.parammaps.warningType = '安全阀'
-        PostDataByName(this.postDataPramas).then(response => {
-          console.log('删除保存发送参数', this.postDataPramas)
-          if (response.msg !== 'fail') {
-            this.dialogFormVisible = false
-            this.get_table_data()
-            this.$notify({
-              title: '成功',
-              message: '删除成功',
-              type: 'success',
-              duration: 2000
-            })
-          } else {
-            failproccess(response, this.$notify)
-          }
-        })
-      })
-    },
-    handleDownloadTemp() {
-      console.log('点击了模板')
-      import('@/vendor/Export2Excel').then(excel => {
-        const list1 = []
-        const tHeader = [
-          '牧场', '安全阀类型', '安全阀型号', '公称通径', '公称压力MPa', '工作压力MPa', '整定压力MPa', '起跳压力MPa', '回座压力MPa', '使用位置', '使用部门', '本次检验日期', '下次检验日期', '管理责任人'
-        ]
-        const filterVal = [
-          '牧场', '安全阀类型', '安全阀型号', '公称通径', '公称压力MPa', '工作压力MPa', '整定压力MPa', '起跳压力MPa', '回座压力MPa', '使用位置', '使用部门', '本次检验日期', '下次检验日期', '管理责任人'
-        ]
-        const data1 = this.formatJson(filterVal, list1)
-        excel.export_json_to_excel({
-          header: tHeader,
-          data: data1,
-          filename: '安全阀模板',
-          autoWidth: true,
-          bookType: 'xlsx'
-        })
-      })
-    },
-    beforeImportExcel(file) {
-      const isLt2M = file.size / 1024 / 1024 < 6
-      if (!isLt2M) {
-        this.$message.error('上传文件大小不能超过 6MB!')
-      }
-      return isLt2M
-    },
-    handleImportExcelSuccess(res, file) {
-      this.get_table_data()
-      if (res.msg === 'ok') {
-        this.$message({
-          title: '成功',
-          message: '导入成功:' + res.data.success + '条!',
-          type: 'success',
-          duration: 2000
-        })
-        if (res.data.err_count > 0) {
-          this.$notify({
-            title: '失败',
-            message: '导入失败:' + res.data.err_count + '条!',
-            type: 'danger',
-            duration: 2000
-          })
-           import('@/vendor/Export2Excel').then(excel => {
-             const list1 = res.data.result
-             const tHeader = [
-               '牧场', '安全阀类型', '安全阀型号', '公称通径', '公称压力MPa', '工作压力MPa', '整定压力MPa', '起跳压力MPa', '回座压力MPa', '使用位置', '使用部门', '本次检验日期', '下次检验日期', '管理责任人', '报错信息'
-             ]
-             const filterVal = [
-               '牧场', '安全阀类型', '安全阀型号', '公称通径', '公称压力MPa', '工作压力MPa', '整定压力MPa', '起跳压力MPa', '回座压力MPa', '使用位置', '使用部门', '本次检验日期', '下次检验日期', '管理责任人', 'error_msg'
-             ]
-             const data1 = this.formatJson(filterVal, list1)
-             excel.export_json_to_excel({
-               header: tHeader,
-               data: data1,
-               filename: '安全阀报错信息',
-               autoWidth: true,
-               bookType: 'xlsx'
-             })
-           })
-        }
-      } else {
-        this.$notify({
-          title: '失败',
-          message: '上传失败',
-          type: 'danger',
-          duration: 2000
-        })
-      }
-    },
-    formatJson(filterVal, jsonData) {
-      return jsonData.map(v =>
-        filterVal.map(j => {
-          if (j === 'timestamp') {
-            return parseTime(v[j])
-          } else {
-            return v[j]
-          }
-        })
-      )
-    },
-    handleDownload() {
-      console.log('点击了导出')
-      this.$alert('安全阀正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
-      this.isPercentage = true
-      this.percentage = 1
-      var timer = setInterval(() => {
-        this.percentage += 5
-        if (this.percentage > 95) {
-          this.percentage = 99
-          clearInterval(timer)
-        }
-        this.percentage = this.percentage
-      }, 1000)
-      this.downLoadParm.name = 'getExaminewarningList'
-      this.downLoadParm.parammaps = this.getdataListParm.parammaps
-      GetAccount(this.downLoadParm).then(response => {
-        if (response.data.list !== '') {
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-        }
-        this.$nextTick(() => {
-          this.downLoadList = response.data.list
-          console.log('导出table数据', this.downLoadList)
-          const ExcelDatas = [
-            {
-              tHeader: ['牧场', '安全阀类型', '安全阀型号', '公称通径', '公称压力MPa', '工作压力MPa', '整定压力MPa', '起跳压力MPa', '回座压力MPa', '使用位置', '使用部门', '本次检验日期', '下次检验日期', '管理责任人'],
-              filterVal: ['pastureName', 'warnName', 'specification', 'level', 'measureRange', 'factoryNumber', 'amount', 'unit', 'cycle', 'warnUnit', 'departmentName', 'lastCheckDate', 'validityDate', 'empName'],
-              tableDatas: this.downLoadList,
-              sheetName: '安全阀'
-            }
-          ]
-          json2excel(ExcelDatas, '安全阀', true, 'xlsx')
-        })
-      })
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-.app-btn {
-  margin-bottom: 10px;
-}
-</style>
-
+          this.list = []
+        }
+        setTimeout(() => {
+          this.listLoading = false
+        }, 100)
+      })
+    },
+    selectedHighlight({ row, rowIndex }) {
+      for (let i = 0; i < this.getIndexList.length; i++) {
+        if (this.getIndexList[i].myindex === rowIndex) {
+          return {
+            color: 'red'
+          }
+        }
+      }
+    },
+
+    form_search() {
+      console.log('点击了搜索')
+      this.getdataListParm.offset = 1
+      this.get_table_data()
+    },
+    resetCreateTemp() {
+      this.createTemp.pastureId = this.$store.state.user.pastureid
+      this.createTemp.pastureName = this.$store.state.user.pasturename
+      this.createTemp.departmentName = this.$store.state.user.departmentname
+      this.createTemp.departmentId = this.$store.state.user.departmentid
+      this.createTemp.warnName = ''
+      this.createTemp.specification = ''
+      this.createTemp.level = ''
+      this.createTemp.measureRange = ''
+      this.createTemp.factoryNumber = ''
+      this.createTemp.amount = ''
+      this.createTemp.unit = ''
+      this.createTemp.cycle = ''
+      this.createTemp.warnUnit = ''
+      this.createTemp.lastCheckDate = ''
+      this.createTemp.validityDate = ''
+      this.createTemp.empName = ''
+      this.createTemp.empId = ''
+    },
+    form_add() {
+      console.log('点击了新增')
+      this.resetCreateTemp()
+      this.dialogStatus = 'create'
+      this.dialogFormVisible = true
+    },
+    changePasture(item) {
+      this.createTemp.pastureName = this.findAllPasture.find(obj => obj.id === item).name
+    },
+    changeDepartment(item) {
+      this.createTemp.departmentId = this.findAllDepart.find(obj => obj.name === item).id
+    },
+    changeEmp(item) {
+      this.createTemp.empId = this.findAllEmploye.find(obj => obj.name === item).id
+    },
+    add_dialog_save() {
+      console.log('点击了保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          this.postDataPramas.name = 'insertExaminewarning'
+          this.postDataPramas.parammaps = {}
+          this.postDataPramas.parammaps = this.createTemp
+          this.postDataPramas.parammaps.warningType = '安全阀'
+          PostDataByName(this.postDataPramas).then(response => {
+            console.log('新增保存发送参数', this.postDataPramas)
+            if (response.msg !== 'fail') {
+              this.dialogFormVisible = false
+              this.get_table_data()
+              this.$notify({
+                title: '成功',
+                message: '新增成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+    form_edit(row) {
+      console.log('点击了编辑')
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.createTemp = Object.assign({}, row)
+      this.createTemp.pastureId = parseFloat(row.pastureId)
+      this.createTemp.departmentId = parseFloat(row.departmentId)
+      this.createTemp.empId = parseFloat(row.empId)
+    },
+    edit_dialog_save() {
+      console.log('点击了编辑保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          this.postDataPramas.name = 'updateExaminewarning'
+          this.postDataPramas.parammaps = {}
+          this.postDataPramas.parammaps = this.createTemp
+          this.postDataPramas.parammaps.id = this.createTemp.id
+          this.postDataPramas.parammaps.warningType = '安全阀'
+          PostDataByName(this.postDataPramas).then(response => {
+            console.log('编辑保存发送参数', this.postDataPramas)
+            if (response.msg !== 'fail') {
+              this.dialogFormVisible = false
+              this.get_table_data()
+              this.$notify({
+                title: '成功',
+                message: '保存成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+    form_see(row) {
+      console.log('点击了查看', row)
+      this.dialogStatus = 'see'
+      this.dialogFormVisible = true
+      this.createTemp = Object.assign({}, row)
+      this.createTemp.pastureId = parseFloat(row.pastureId)
+      this.createTemp.departmentId = parseFloat(row.departmentId)
+      this.createTemp.empId = parseFloat(row.empId)
+    },
+    form_delete(row) {
+      MessageBox.confirm('确认删除此信息?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        console.log('点击了删除', row)
+        this.postDataPramas.name = 'deleteExaminewarning'
+        this.postDataPramas.parammaps = {}
+        this.postDataPramas.parammaps.id = row.id
+        this.postDataPramas.parammaps.warningType = '安全阀'
+        PostDataByName(this.postDataPramas).then(response => {
+          console.log('删除保存发送参数', this.postDataPramas)
+          if (response.msg !== 'fail') {
+            this.dialogFormVisible = false
+            this.get_table_data()
+            this.$notify({
+              title: '成功',
+              message: '删除成功',
+              type: 'success',
+              duration: 2000
+            })
+          } else {
+            failproccess(response, this.$notify)
+          }
+        })
+      })
+    },
+    handleDownloadTemp() {
+      console.log('点击了模板')
+      import('@/vendor/Export2Excel').then(excel => {
+        const list1 = []
+        const tHeader = [
+          '牧场', '安全阀类型', '安全阀型号', '公称通径', '公称压力MPa', '工作压力MPa', '整定压力MPa', '起跳压力MPa', '回座压力MPa', '使用位置', '使用部门', '本次检验日期', '下次检验日期', '管理责任人'
+        ]
+        const filterVal = [
+          '牧场', '安全阀类型', '安全阀型号', '公称通径', '公称压力MPa', '工作压力MPa', '整定压力MPa', '起跳压力MPa', '回座压力MPa', '使用位置', '使用部门', '本次检验日期', '下次检验日期', '管理责任人'
+        ]
+        const data1 = this.formatJson(filterVal, list1)
+        excel.export_json_to_excel({
+          header: tHeader,
+          data: data1,
+          filename: '安全阀模板',
+          autoWidth: true,
+          bookType: 'xlsx'
+        })
+      })
+    },
+    beforeImportExcel(file) {
+      const isLt2M = file.size / 1024 / 1024 < 6
+      if (!isLt2M) {
+        this.$message.error('上传文件大小不能超过 6MB!')
+      }
+      return isLt2M
+    },
+    handleImportExcelSuccess(res, file) {
+      this.get_table_data()
+      if (res.msg === 'ok') {
+        this.$message({
+          title: '成功',
+          message: '导入成功:' + res.data.success + '条!',
+          type: 'success',
+          duration: 2000
+        })
+        if (res.data.err_count > 0) {
+          this.$notify({
+            title: '失败',
+            message: '导入失败:' + res.data.err_count + '条!',
+            type: 'danger',
+            duration: 2000
+          })
+           import('@/vendor/Export2Excel').then(excel => {
+             const list1 = res.data.result
+             const tHeader = [
+               '牧场', '安全阀类型', '安全阀型号', '公称通径', '公称压力MPa', '工作压力MPa', '整定压力MPa', '起跳压力MPa', '回座压力MPa', '使用位置', '使用部门', '本次检验日期', '下次检验日期', '管理责任人', '报错信息'
+             ]
+             const filterVal = [
+               '牧场', '安全阀类型', '安全阀型号', '公称通径', '公称压力MPa', '工作压力MPa', '整定压力MPa', '起跳压力MPa', '回座压力MPa', '使用位置', '使用部门', '本次检验日期', '下次检验日期', '管理责任人', 'error_msg'
+             ]
+             const data1 = this.formatJson(filterVal, list1)
+             excel.export_json_to_excel({
+               header: tHeader,
+               data: data1,
+               filename: '安全阀报错信息',
+               autoWidth: true,
+               bookType: 'xlsx'
+             })
+           })
+        }
+      } else {
+        this.$notify({
+          title: '失败',
+          message: '上传失败',
+          type: 'danger',
+          duration: 2000
+        })
+      }
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j === 'timestamp') {
+            return parseTime(v[j])
+          } else {
+            return v[j]
+          }
+        })
+      )
+    },
+    handleDownload() {
+      console.log('点击了导出')
+      this.$alert('安全阀正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
+      this.isPercentage = true
+      this.percentage = 1
+      var timer = setInterval(() => {
+        this.percentage += 5
+        if (this.percentage > 95) {
+          this.percentage = 99
+          clearInterval(timer)
+        }
+        this.percentage = this.percentage
+      }, 1000)
+      this.downLoadParm.name = 'getExaminewarningList'
+      this.downLoadParm.parammaps = this.getdataListParm.parammaps
+      GetAccount(this.downLoadParm).then(response => {
+        if (response.data.list !== '') {
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+        }
+        this.$nextTick(() => {
+          this.downLoadList = response.data.list
+          console.log('导出table数据', this.downLoadList)
+          const ExcelDatas = [
+            {
+              tHeader: ['牧场', '安全阀类型', '安全阀型号', '公称通径', '公称压力MPa', '工作压力MPa', '整定压力MPa', '起跳压力MPa', '回座压力MPa', '使用位置', '使用部门', '本次检验日期', '下次检验日期', '管理责任人'],
+              filterVal: ['pastureName', 'warnName', 'specification', 'level', 'measureRange', 'factoryNumber', 'amount', 'unit', 'cycle', 'warnUnit', 'departmentName', 'lastCheckDate', 'validityDate', 'empName'],
+              tableDatas: this.downLoadList,
+              sheetName: '安全阀'
+            }
+          ]
+          json2excel(ExcelDatas, '安全阀', true, 'xlsx')
+        })
+      })
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+.app-btn {
+  margin-bottom: 10px;
+}
+</style>
+

+ 4 - 3
src/views/special/earlyWarning/components/specialEquipment.vue

@@ -197,7 +197,7 @@ export default {
   components: { Pagination },
   data() {
     return {
-      myHeight:document.documentElement.clientHeight - 85- 250,
+      myHeight: document.documentElement.clientHeight - 85 - 250,
       warningStatus: [{ id: 0, name: '全部' }, { id: 1, name: '正常' }, { id: 2, name: '预警期' }],
       findAllPasture: [],
       findAllDepart: [],
@@ -205,7 +205,8 @@ export default {
       requestParams: [
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       rules: {
         pastureId: [{ required: true, message: '必填', trigger: 'blur' }],
@@ -305,7 +306,7 @@ export default {
   methods: {
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
       })

+ 651 - 650
src/views/special/earlyWarning/components/thermometer.vue

@@ -1,650 +1,651 @@
-<template>
-  <div class="app-container">
-    <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
-      <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
-      <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
-    </div>
-    <div class="filter-container">
-      <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 150px;">
-        <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
-      </el-select>
-      <el-select v-model="getdataListParm.parammaps.status" placeholder="检验预警状态" class="filter-item" style="width: 150px;">
-        <el-option v-for="item in warningStatus" :key="item.id" :label="item.name" :value="item.name" />
-      </el-select>
-      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
-    </div>
-    <div class="app-btn">
-      <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
-      <el-button class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
-      <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
-        <el-button v-waves class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
-      </el-upload>
-      <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
-    </div>
-    <el-table
-      :key="tableKey"
-      v-loading="listLoading"
-      element-loading-text="给我一点时间"
-      :data="list"
-      border
-      fit
-      highlight-current-row
-      style="width: 100%;"
-      :row-class-name="tableRowClassName"
-      :row-style="selectedHighlight"
-      :cell-style="cellStyle"
-      class="elTable table-fixed"
-      :max-height="myHeight"
-    >
-      <el-table-column label="序号" align="center" type="index" width="50px">
-        <template slot-scope="scope">
-          <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="牧场" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.pastureName }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="器具名称" width="140px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.warnName }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="规格型号" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.specification }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="准确度等级、不确定度或最大允许误差" min-width="150px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.level }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="测量范围" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.measureRange }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="出厂编号" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.factoryNumber }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="数量" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.amount }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="制造单位" min-width="100px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.unit }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="检定周期" min-width="80px" align="center" sortable prop="cycle" />
-      <el-table-column label="检验日期" min-width="80px" align="center" sortable prop="lastCheckDate" />
-      <el-table-column label="有效日期" min-width="110px" align="center" sortable prop="validityDate" />
-      <el-table-column label="检定单位" min-width="80px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.warnUnit }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="计量器具用途" min-width="110px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.purpose }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="安装使用地点" min-width="110px" align="center">
-        <template slot-scope="scope">
-          <span>{{ scope.row.location }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
-        <template slot-scope="{row}">
-          <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
-          <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button>
-          <el-button type="danger" size="mini" @click="form_delete(row)">删除</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
-
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="80%">
-      <div class="app-add">
-        <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="145px" style="width: 90%;margin:0 auto 30px">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item ref="pastureId" label="牧场:" prop="pastureId">
-                <el-select v-model="createTemp.pastureId " placeholder="请输入牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changePasture">
-                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="器具名称:" prop="warnName">
-                <el-input ref="warnName" v-model="createTemp.warnName" placeholder="请输入计量器具名称" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="规格型号:" prop="specification">
-                <el-input ref="specification" v-model="createTemp.specification" placeholder="请输入规格型号" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="准确度等级、不确定度或最大允许误差:" prop="level">
-                <el-input ref="level" v-model="createTemp.level" placeholder="请输入准确度等级、不确定度或最大允许误差" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="测量范围:" prop="measureRange">
-                <el-input ref="measureRange" v-model="createTemp.measureRange" placeholder="请输入测量范围" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="出厂编号:" prop="factoryNumber">
-                <el-input ref="factoryNumber" v-model="createTemp.factoryNumber" placeholder="请输入出厂编号" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="数量:" prop="amount">
-                <el-input ref="amount" v-model="createTemp.amount" placeholder="请输入数量" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="制造单位:" prop="unit">
-                <el-input ref="unit" v-model="createTemp.unit" placeholder="请输入制造单位" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="检定周期:" prop="cycle">
-                <el-input ref="cycle" v-model="createTemp.cycle" placeholder="请输入检定周期" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="检验日期:" prop="lastCheckDate">
-                <el-date-picker v-model="createTemp.lastCheckDate" :picker-options="pickerOptions1" type="date" placeholder="请输入检验日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="有效日期:" prop="validityDate">
-                <el-date-picker v-model="createTemp.validityDate" :picker-options="pickerOptions2" type="date" placeholder="请输入有效日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="检定单位:" prop="warnUnit">
-                <el-input ref="warnUnit" v-model="createTemp.warnUnit" placeholder="请输入检定单位" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="计量器具用途:" prop="purpose">
-                <el-input ref="purpose" v-model="createTemp.purpose" placeholder="请输入计量器具用途" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="安装使用地点:" prop="location">
-                <el-input ref="location" v-model="createTemp.location" placeholder="请输入安装使用地点" :disabled="dialogStatus==='see'" />
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:5px">
-          <el-button v-if="dialogStatus==='create' || dialogStatus==='update'" type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
-          <el-button @click="dialogFormVisible = false; getdataListParm.parammaps.inputDatetime = ''">取消并关闭</el-button>
-        </div>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import waves from '@/directive/waves'
-import { GetDataByNames, GetDataByName, PostDataByName, failproccess, GetAccount } from '@/api/common'
-import Cookies from 'js-cookie'
-import { json2excel } from '@/utils/index.js'
-import { MessageBox } from 'element-ui'
-import { getToken } from '@/utils/auth'
-import { parseTime } from '@/utils/index.js'
-import Pagination from '@/components/Pagination'
-export default {
-  name: 'Thermometer',
-  directives: { waves },
-  components: { Pagination },
-  data() {
-    return {
-      myHeight:document.documentElement.clientHeight - 85- 250,
-      warningStatus: [{ id: 0, name: '全部' }, { id: 1, name: '正常' }, { id: 2, name: '预警期' }],
-      findAllPasture: [],
-      findAllDepart: [],
-      findAllEmploye: [],
-      requestParams: [
-        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
-        { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }}
-      ],
-      rules: {
-        pastureId: [{ required: true, message: '必填', trigger: 'blur' }],
-        warnName: [{ required: true, message: '必填', trigger: 'blur' }],
-        specification: [{ required: true, message: '必填', trigger: 'blur' }],
-        lastCheckDate: [{ required: true, message: '必填', trigger: 'blur' }],
-        validityDate: [{ required: true, message: '必填', trigger: 'blur' }]
-      },
-      getdataListParm: {
-        name: 'getExaminewarningList',
-        page: 1,
-        offset: 1,
-        pagecount: 10,
-        returntype: 'Map',
-        parammaps: {
-          pastureName: Cookies.get('pasturename'),
-          warningType: '温度计'
-        }
-      },
-      tableKey: 0,
-      listLoading: false,
-      total: 0,
-      list: [],
-      getIndexList: [],
-      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
-      cellStyle: { padding: 0 + 'px' },
-      pickerOptions1: {
-        disabledDate: (time) => {
-          if (this.createTemp.validityDate !== '') {
-            return parseTime(time.getTime(), '{y}-{m}-{d}') >= this.createTemp.validityDate
-          } else {
-            return ''
-          }
-        }
-      },
-      pickerOptions2: {
-        disabledDate: (time) => {
-          return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.createTemp.lastCheckDate
-        }
-      },
-      createTemp: {
-        pastureId: this.$store.state.user.pastureid,
-        pastureName: this.$store.state.user.pasturename,
-        // departmentName: this.$store.state.user.departmentname,
-        // departmentId: this.$store.state.user.departmentid,
-        warnName: '',
-        specification: '',
-        level: '',
-        measureRange: '',
-        factoryNumber: '',
-        amount: '',
-        unit: '',
-        cycle: '',
-        lastCheckDate: '',
-        validityDate: '',
-        warnUnit: '',
-        purpose: '',
-        location: ''
-      },
-      dialogFormVisible: false,
-      dialogStatus: '',
-      textMap: {
-        create: '新增',
-        update: '编辑',
-        see: '查看'
-      },
-      isokDisable: false,
-      postDataPramas: {},
-      downLoadParm: {},
-      isPercentage: false,
-      percentage: 1
-    }
-  },
-  computed: {
-    headers() {
-      return {
-        token: getToken()
-      }
-    },
-    uploadData() {
-      return {
-        name: 'uploadExaminewarnWDJ',
-        importParams: '牧场,器具名称,规格型号,准确度等级、不确定度或最大允许误差,测量范围,出厂编号,数量,制造单位,检定周期,上次检定日期,有效期至,检定单位,计量器具用途,安装使用地点',
-        sheetname: 'SheetJS'
-      }
-    },
-    // 设置上传地址
-    uploadExcelUrl() {
-      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
-    }
-  },
-  created() {
-    this.get_select_list()
-    this.get_table_data()
-  },
-
-  // 设置变量
-
-  methods: {
-    get_select_list() {
-      GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
-        this.findAllDepart = response.data.findAllDepart.list
-        this.findAllEmploye = response.data.findAllEmploye.list
-      })
-    },
-    getNextDate(date, day) {
-      var dd = new Date(date)
-      dd.setDate(dd.getDate() + day)
-      var y = dd.getFullYear()
-      var m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1
-      var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()
-      return y + '-' + m + '-' + d
-    },
-    tableRowClassName({ row, rowIndex }) {
-      // 把每一行的索引放进row
-      row.index = rowIndex
-    },
-    get_table_data() {
-      this.listLoading = true
-      GetDataByName(this.getdataListParm).then(response => {
-        if (response.data.list !== null || response.data !== null) {
-          console.log('table数据', response.data.list)
-          this.getIndexList = []
-          for (let i = 0; i < response.data.list.length; i++) {
-            response.data.list[i].index = i
-            if (this.getNextDate(response.data.list[i].validityDate, -30) <= parseTime(new Date(), '{y}-{m}-{d}')) {
-              this.getIndexList.push({ 'myindex': response.data.list[i].index })
-            }
-          }
-          this.list = response.data.list
-          this.pageNum = response.data.pageNum
-          this.pageSize = response.data.pageSize
-          this.total = response.data.total
-        } else {
-          this.list = []
-        }
-        setTimeout(() => {
-          this.listLoading = false
-        }, 100)
-      })
-    },
-    selectedHighlight({ row, rowIndex }) {
-      for (let i = 0; i < this.getIndexList.length; i++) {
-        if (this.getIndexList[i].myindex === rowIndex) {
-          return {
-            color: 'red'
-          }
-        }
-      }
-    },
-
-    form_search() {
-      console.log('点击了搜索')
-      this.getdataListParm.offset = 1
-      this.get_table_data()
-    },
-    resetCreateTemp() {
-      this.createTemp.pastureId = this.$store.state.user.pastureid
-      this.createTemp.pastureName = this.$store.state.user.pasturename
-      // this.createTemp.departmentName = this.$store.state.user.departmentname
-      // this.createTemp.departmentId = this.$store.state.user.departmentid
-      this.createTemp.warnName = ''
-      this.createTemp.specification = ''
-      this.createTemp.level = ''
-      this.createTemp.measureRange = ''
-      this.createTemp.factoryNumber = ''
-      this.createTemp.amount = ''
-      this.createTemp.unit = ''
-      this.createTemp.cycle = ''
-      this.createTemp.lastCheckDate = ''
-      this.createTemp.validityDate = ''
-      this.createTemp.warnUnit = ''
-      this.createTemp.purpose = ''
-      this.createTemp.location = ''
-    },
-    form_add() {
-      console.log('点击了新增')
-      this.resetCreateTemp()
-      this.dialogStatus = 'create'
-      this.dialogFormVisible = true
-    },
-    changePasture(item) {
-      this.createTemp.pastureName = this.findAllPasture.find(obj => obj.id === item).name
-    },
-    add_dialog_save() {
-      console.log('点击了保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          this.postDataPramas.name = 'insertExaminewarning'
-          this.postDataPramas.parammaps = {}
-          this.postDataPramas.parammaps = this.createTemp
-          this.postDataPramas.parammaps.warningType = '温度计'
-          PostDataByName(this.postDataPramas).then(response => {
-            console.log('新增保存发送参数', this.postDataPramas)
-            if (response.msg !== 'fail') {
-              this.dialogFormVisible = false
-              this.get_table_data()
-              this.$notify({
-                title: '成功',
-                message: '新增成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-    form_edit(row) {
-      console.log('点击了编辑')
-      this.dialogStatus = 'update'
-      this.dialogFormVisible = true
-      this.createTemp = Object.assign({}, row)
-      this.createTemp.pastureId = parseFloat(row.pastureId)
-      this.createTemp.departmentId = parseFloat(row.departmentId)
-      this.createTemp.empId = parseFloat(row.empId)
-    },
-    edit_dialog_save() {
-      console.log('点击了编辑保存')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['createTemp'].validate(valid => {
-        if (valid) {
-          this.postDataPramas.name = 'updateExaminewarning'
-          this.postDataPramas.parammaps = {}
-          this.postDataPramas.parammaps = this.createTemp
-          this.postDataPramas.parammaps.id = this.createTemp.id
-          this.postDataPramas.parammaps.warningType = '温度计'
-          PostDataByName(this.postDataPramas).then(response => {
-            console.log('编辑保存发送参数', this.postDataPramas)
-            if (response.msg !== 'fail') {
-              this.dialogFormVisible = false
-              this.get_table_data()
-              this.$notify({
-                title: '成功',
-                message: '保存成功',
-                type: 'success',
-                duration: 2000
-              })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-    form_see(row) {
-      console.log('点击了查看', row)
-      this.dialogStatus = 'see'
-      this.dialogFormVisible = true
-      this.createTemp = Object.assign({}, row)
-      this.createTemp.pastureId = parseFloat(row.pastureId)
-      this.createTemp.departmentId = parseFloat(row.departmentId)
-      this.createTemp.empId = parseFloat(row.empId)
-    },
-    form_delete(row) {
-      MessageBox.confirm('确认删除此信息?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        console.log('点击了删除', row)
-        this.postDataPramas.name = 'deleteExaminewarning'
-        this.postDataPramas.parammaps = {}
-        this.postDataPramas.parammaps.id = row.id
-        this.postDataPramas.parammaps.warningType = '温度计'
-        PostDataByName(this.postDataPramas).then(response => {
-          console.log('删除保存发送参数', this.postDataPramas)
-          if (response.msg !== 'fail') {
-            this.dialogFormVisible = false
-            this.get_table_data()
-            this.$notify({
-              title: '成功',
-              message: '删除成功',
-              type: 'success',
-              duration: 2000
-            })
-          } else {
-            failproccess(response, this.$notify)
-          }
-        })
-      })
-    },
-    handleDownloadTemp() {
-      console.log('点击了模板')
-      import('@/vendor/Export2Excel').then(excel => {
-        const list1 = []
-        const tHeader = [
-          '牧场', '器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点'
-        ]
-        const filterVal = [
-          '牧场', '器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点'
-        ]
-        const data1 = this.formatJson(filterVal, list1)
-        excel.export_json_to_excel({
-          header: tHeader,
-          data: data1,
-          filename: '温度计模板',
-          autoWidth: true,
-          bookType: 'xlsx'
-        })
-      })
-    },
-    beforeImportExcel(file) {
-      const isLt2M = file.size / 1024 / 1024 < 6
-      if (!isLt2M) {
-        this.$message.error('上传文件大小不能超过 6MB!')
-      }
-      return isLt2M
-    },
-    handleImportExcelSuccess(res, file) {
-      this.get_table_data()
-      if (res.msg === 'ok') {
-        this.$message({
-          title: '成功',
-          message: '导入成功:' + res.data.success + '条!',
-          type: 'success',
-          duration: 2000
-        })
-        if (res.data.err_count > 0) {
-          this.$notify({
-            title: '失败',
-            message: '导入失败:' + res.data.err_count + '条!',
-            type: 'danger',
-            duration: 2000
-          })
-           import('@/vendor/Export2Excel').then(excel => {
-             const list1 = res.data.result
-             const tHeader = [
-               '牧场', '器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点', '报错信息'
-             ]
-             const filterVal = [
-               '牧场', '器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点', 'error_msg'
-             ]
-             const data1 = this.formatJson(filterVal, list1)
-             excel.export_json_to_excel({
-               header: tHeader,
-               data: data1,
-               filename: '温度计报错信息',
-               autoWidth: true,
-               bookType: 'xlsx'
-             })
-           })
-        }
-      } else {
-        this.$notify({
-          title: '失败',
-          message: '上传失败',
-          type: 'danger',
-          duration: 2000
-        })
-      }
-    },
-    formatJson(filterVal, jsonData) {
-      return jsonData.map(v =>
-        filterVal.map(j => {
-          if (j === 'timestamp') {
-            return parseTime(v[j])
-          } else {
-            return v[j]
-          }
-        })
-      )
-    },
-    handleDownload() {
-      console.log('点击了导出')
-      this.$alert('温度计正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
-      this.isPercentage = true
-      this.percentage = 1
-      var timer = setInterval(() => {
-        this.percentage += 5
-        if (this.percentage > 95) {
-          this.percentage = 99
-          clearInterval(timer)
-        }
-        this.percentage = this.percentage
-      }, 1000)
-      this.downLoadParm.name = 'getExaminewarningList'
-      this.downLoadParm.parammaps = this.getdataListParm.parammaps
-      GetAccount(this.downLoadParm).then(response => {
-        if (response.data.list !== '') {
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-        }
-        this.$nextTick(() => {
-          this.downLoadList = response.data.list
-          console.log('导出table数据', this.downLoadList)
-          const ExcelDatas = [
-            {
-              tHeader: ['牧场', '器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点'],
-              filterVal: ['pastureName', 'warnName', 'specification', 'level', 'measureRange', 'factoryNumber', 'amount', 'unit', 'cycle', 'lastCheckDate', 'validityDate', 'warnUnit', 'purpose', 'location'],
-              tableDatas: this.downLoadList,
-              sheetName: '温度计'
-            }
-          ]
-          json2excel(ExcelDatas, '温度计', true, 'xlsx')
-        })
-      })
-    }
-
-  }
-}
-</script>
-<style lang="scss" scoped>
-.app-btn {
-  margin-bottom: 10px;
-}
-</style>
-
+<template>
+  <div class="app-container">
+    <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
+      <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
+      <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
+    </div>
+    <div class="filter-container">
+      <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" class="filter-item" style="width: 150px;">
+        <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
+      <el-select v-model="getdataListParm.parammaps.status" placeholder="检验预警状态" class="filter-item" style="width: 150px;">
+        <el-option v-for="item in warningStatus" :key="item.id" :label="item.name" :value="item.name" />
+      </el-select>
+      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
+    </div>
+    <div class="app-btn">
+      <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
+      <el-button class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
+      <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
+        <el-button v-waves class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
+      </el-upload>
+      <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
+    </div>
+    <el-table
+      :key="tableKey"
+      v-loading="listLoading"
+      element-loading-text="给我一点时间"
+      :data="list"
+      border
+      fit
+      highlight-current-row
+      style="width: 100%;"
+      :row-class-name="tableRowClassName"
+      :row-style="selectedHighlight"
+      :cell-style="cellStyle"
+      class="elTable table-fixed"
+      :max-height="myHeight"
+    >
+      <el-table-column label="序号" align="center" type="index" width="50px">
+        <template slot-scope="scope">
+          <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="牧场" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.pastureName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="器具名称" width="140px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.warnName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="规格型号" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.specification }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="准确度等级、不确定度或最大允许误差" min-width="150px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.level }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="测量范围" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.measureRange }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="出厂编号" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.factoryNumber }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="数量" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.amount }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="制造单位" min-width="100px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.unit }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="检定周期" min-width="80px" align="center" sortable prop="cycle" />
+      <el-table-column label="检验日期" min-width="80px" align="center" sortable prop="lastCheckDate" />
+      <el-table-column label="有效日期" min-width="110px" align="center" sortable prop="validityDate" />
+      <el-table-column label="检定单位" min-width="80px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.warnUnit }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="计量器具用途" min-width="110px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.purpose }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="安装使用地点" min-width="110px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.location }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
+          <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button>
+          <el-button type="danger" size="mini" @click="form_delete(row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
+
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="80%">
+      <div class="app-add">
+        <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="145px" style="width: 90%;margin:0 auto 30px">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item ref="pastureId" label="牧场:" prop="pastureId">
+                <el-select v-model="createTemp.pastureId " placeholder="请输入牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='see'" @change="changePasture">
+                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="器具名称:" prop="warnName">
+                <el-input ref="warnName" v-model="createTemp.warnName" placeholder="请输入计量器具名称" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="规格型号:" prop="specification">
+                <el-input ref="specification" v-model="createTemp.specification" placeholder="请输入规格型号" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="准确度等级、不确定度或最大允许误差:" prop="level">
+                <el-input ref="level" v-model="createTemp.level" placeholder="请输入准确度等级、不确定度或最大允许误差" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="测量范围:" prop="measureRange">
+                <el-input ref="measureRange" v-model="createTemp.measureRange" placeholder="请输入测量范围" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="出厂编号:" prop="factoryNumber">
+                <el-input ref="factoryNumber" v-model="createTemp.factoryNumber" placeholder="请输入出厂编号" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="数量:" prop="amount">
+                <el-input ref="amount" v-model="createTemp.amount" placeholder="请输入数量" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="制造单位:" prop="unit">
+                <el-input ref="unit" v-model="createTemp.unit" placeholder="请输入制造单位" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="检定周期:" prop="cycle">
+                <el-input ref="cycle" v-model="createTemp.cycle" placeholder="请输入检定周期" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="检验日期:" prop="lastCheckDate">
+                <el-date-picker v-model="createTemp.lastCheckDate" :picker-options="pickerOptions1" type="date" placeholder="请输入检验日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="有效日期:" prop="validityDate">
+                <el-date-picker v-model="createTemp.validityDate" :picker-options="pickerOptions2" type="date" placeholder="请输入有效日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="检定单位:" prop="warnUnit">
+                <el-input ref="warnUnit" v-model="createTemp.warnUnit" placeholder="请输入检定单位" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="计量器具用途:" prop="purpose">
+                <el-input ref="purpose" v-model="createTemp.purpose" placeholder="请输入计量器具用途" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="安装使用地点:" prop="location">
+                <el-input ref="location" v-model="createTemp.location" placeholder="请输入安装使用地点" :disabled="dialogStatus==='see'" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:5px">
+          <el-button v-if="dialogStatus==='create' || dialogStatus==='update'" type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
+          <el-button @click="dialogFormVisible = false; getdataListParm.parammaps.inputDatetime = ''">取消并关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import waves from '@/directive/waves'
+import { GetDataByNames, GetDataByName, PostDataByName, failproccess, GetAccount } from '@/api/common'
+import Cookies from 'js-cookie'
+import { json2excel } from '@/utils/index.js'
+import { MessageBox } from 'element-ui'
+import { getToken } from '@/utils/auth'
+import { parseTime } from '@/utils/index.js'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'Thermometer',
+  directives: { waves },
+  components: { Pagination },
+  data() {
+    return {
+      myHeight: document.documentElement.clientHeight - 85 - 250,
+      warningStatus: [{ id: 0, name: '全部' }, { id: 1, name: '正常' }, { id: 2, name: '预警期' }],
+      findAllPasture: [],
+      findAllDepart: [],
+      findAllEmploye: [],
+      requestParams: [
+        { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
+        { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
+      ],
+      rules: {
+        pastureId: [{ required: true, message: '必填', trigger: 'blur' }],
+        warnName: [{ required: true, message: '必填', trigger: 'blur' }],
+        specification: [{ required: true, message: '必填', trigger: 'blur' }],
+        lastCheckDate: [{ required: true, message: '必填', trigger: 'blur' }],
+        validityDate: [{ required: true, message: '必填', trigger: 'blur' }]
+      },
+      getdataListParm: {
+        name: 'getExaminewarningList',
+        page: 1,
+        offset: 1,
+        pagecount: 10,
+        returntype: 'Map',
+        parammaps: {
+          pastureName: Cookies.get('pasturename'),
+          warningType: '温度计'
+        }
+      },
+      tableKey: 0,
+      listLoading: false,
+      total: 0,
+      list: [],
+      getIndexList: [],
+      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      pickerOptions1: {
+        disabledDate: (time) => {
+          if (this.createTemp.validityDate !== '') {
+            return parseTime(time.getTime(), '{y}-{m}-{d}') >= this.createTemp.validityDate
+          } else {
+            return ''
+          }
+        }
+      },
+      pickerOptions2: {
+        disabledDate: (time) => {
+          return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.createTemp.lastCheckDate
+        }
+      },
+      createTemp: {
+        pastureId: this.$store.state.user.pastureid,
+        pastureName: this.$store.state.user.pasturename,
+        // departmentName: this.$store.state.user.departmentname,
+        // departmentId: this.$store.state.user.departmentid,
+        warnName: '',
+        specification: '',
+        level: '',
+        measureRange: '',
+        factoryNumber: '',
+        amount: '',
+        unit: '',
+        cycle: '',
+        lastCheckDate: '',
+        validityDate: '',
+        warnUnit: '',
+        purpose: '',
+        location: ''
+      },
+      dialogFormVisible: false,
+      dialogStatus: '',
+      textMap: {
+        create: '新增',
+        update: '编辑',
+        see: '查看'
+      },
+      isokDisable: false,
+      postDataPramas: {},
+      downLoadParm: {},
+      isPercentage: false,
+      percentage: 1
+    }
+  },
+  computed: {
+    headers() {
+      return {
+        token: getToken()
+      }
+    },
+    uploadData() {
+      return {
+        name: 'uploadExaminewarnWDJ',
+        importParams: '牧场,器具名称,规格型号,准确度等级、不确定度或最大允许误差,测量范围,出厂编号,数量,制造单位,检定周期,上次检定日期,有效期至,检定单位,计量器具用途,安装使用地点',
+        sheetname: 'SheetJS'
+      }
+    },
+    // 设置上传地址
+    uploadExcelUrl() {
+      return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
+    }
+  },
+  created() {
+    this.get_select_list()
+    this.get_table_data()
+  },
+
+  // 设置变量
+
+  methods: {
+    get_select_list() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
+        this.findAllDepart = response.data.findAllDepart.list
+        this.findAllEmploye = response.data.findAllEmploye.list
+      })
+    },
+    getNextDate(date, day) {
+      var dd = new Date(date)
+      dd.setDate(dd.getDate() + day)
+      var y = dd.getFullYear()
+      var m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1
+      var d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()
+      return y + '-' + m + '-' + d
+    },
+    tableRowClassName({ row, rowIndex }) {
+      // 把每一行的索引放进row
+      row.index = rowIndex
+    },
+    get_table_data() {
+      this.listLoading = true
+      GetDataByName(this.getdataListParm).then(response => {
+        if (response.data.list !== null || response.data !== null) {
+          console.log('table数据', response.data.list)
+          this.getIndexList = []
+          for (let i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].index = i
+            if (this.getNextDate(response.data.list[i].validityDate, -30) <= parseTime(new Date(), '{y}-{m}-{d}')) {
+              this.getIndexList.push({ 'myindex': response.data.list[i].index })
+            }
+          }
+          this.list = response.data.list
+          this.pageNum = response.data.pageNum
+          this.pageSize = response.data.pageSize
+          this.total = response.data.total
+        } else {
+          this.list = []
+        }
+        setTimeout(() => {
+          this.listLoading = false
+        }, 100)
+      })
+    },
+    selectedHighlight({ row, rowIndex }) {
+      for (let i = 0; i < this.getIndexList.length; i++) {
+        if (this.getIndexList[i].myindex === rowIndex) {
+          return {
+            color: 'red'
+          }
+        }
+      }
+    },
+
+    form_search() {
+      console.log('点击了搜索')
+      this.getdataListParm.offset = 1
+      this.get_table_data()
+    },
+    resetCreateTemp() {
+      this.createTemp.pastureId = this.$store.state.user.pastureid
+      this.createTemp.pastureName = this.$store.state.user.pasturename
+      // this.createTemp.departmentName = this.$store.state.user.departmentname
+      // this.createTemp.departmentId = this.$store.state.user.departmentid
+      this.createTemp.warnName = ''
+      this.createTemp.specification = ''
+      this.createTemp.level = ''
+      this.createTemp.measureRange = ''
+      this.createTemp.factoryNumber = ''
+      this.createTemp.amount = ''
+      this.createTemp.unit = ''
+      this.createTemp.cycle = ''
+      this.createTemp.lastCheckDate = ''
+      this.createTemp.validityDate = ''
+      this.createTemp.warnUnit = ''
+      this.createTemp.purpose = ''
+      this.createTemp.location = ''
+    },
+    form_add() {
+      console.log('点击了新增')
+      this.resetCreateTemp()
+      this.dialogStatus = 'create'
+      this.dialogFormVisible = true
+    },
+    changePasture(item) {
+      this.createTemp.pastureName = this.findAllPasture.find(obj => obj.id === item).name
+    },
+    add_dialog_save() {
+      console.log('点击了保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          this.postDataPramas.name = 'insertExaminewarning'
+          this.postDataPramas.parammaps = {}
+          this.postDataPramas.parammaps = this.createTemp
+          this.postDataPramas.parammaps.warningType = '温度计'
+          PostDataByName(this.postDataPramas).then(response => {
+            console.log('新增保存发送参数', this.postDataPramas)
+            if (response.msg !== 'fail') {
+              this.dialogFormVisible = false
+              this.get_table_data()
+              this.$notify({
+                title: '成功',
+                message: '新增成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+    form_edit(row) {
+      console.log('点击了编辑')
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.createTemp = Object.assign({}, row)
+      this.createTemp.pastureId = parseFloat(row.pastureId)
+      this.createTemp.departmentId = parseFloat(row.departmentId)
+      this.createTemp.empId = parseFloat(row.empId)
+    },
+    edit_dialog_save() {
+      console.log('点击了编辑保存')
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          this.postDataPramas.name = 'updateExaminewarning'
+          this.postDataPramas.parammaps = {}
+          this.postDataPramas.parammaps = this.createTemp
+          this.postDataPramas.parammaps.id = this.createTemp.id
+          this.postDataPramas.parammaps.warningType = '温度计'
+          PostDataByName(this.postDataPramas).then(response => {
+            console.log('编辑保存发送参数', this.postDataPramas)
+            if (response.msg !== 'fail') {
+              this.dialogFormVisible = false
+              this.get_table_data()
+              this.$notify({
+                title: '成功',
+                message: '保存成功',
+                type: 'success',
+                duration: 2000
+              })
+            } else {
+              failproccess(response, this.$notify)
+            }
+          })
+        }
+      })
+    },
+    form_see(row) {
+      console.log('点击了查看', row)
+      this.dialogStatus = 'see'
+      this.dialogFormVisible = true
+      this.createTemp = Object.assign({}, row)
+      this.createTemp.pastureId = parseFloat(row.pastureId)
+      this.createTemp.departmentId = parseFloat(row.departmentId)
+      this.createTemp.empId = parseFloat(row.empId)
+    },
+    form_delete(row) {
+      MessageBox.confirm('确认删除此信息?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        console.log('点击了删除', row)
+        this.postDataPramas.name = 'deleteExaminewarning'
+        this.postDataPramas.parammaps = {}
+        this.postDataPramas.parammaps.id = row.id
+        this.postDataPramas.parammaps.warningType = '温度计'
+        PostDataByName(this.postDataPramas).then(response => {
+          console.log('删除保存发送参数', this.postDataPramas)
+          if (response.msg !== 'fail') {
+            this.dialogFormVisible = false
+            this.get_table_data()
+            this.$notify({
+              title: '成功',
+              message: '删除成功',
+              type: 'success',
+              duration: 2000
+            })
+          } else {
+            failproccess(response, this.$notify)
+          }
+        })
+      })
+    },
+    handleDownloadTemp() {
+      console.log('点击了模板')
+      import('@/vendor/Export2Excel').then(excel => {
+        const list1 = []
+        const tHeader = [
+          '牧场', '器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点'
+        ]
+        const filterVal = [
+          '牧场', '器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点'
+        ]
+        const data1 = this.formatJson(filterVal, list1)
+        excel.export_json_to_excel({
+          header: tHeader,
+          data: data1,
+          filename: '温度计模板',
+          autoWidth: true,
+          bookType: 'xlsx'
+        })
+      })
+    },
+    beforeImportExcel(file) {
+      const isLt2M = file.size / 1024 / 1024 < 6
+      if (!isLt2M) {
+        this.$message.error('上传文件大小不能超过 6MB!')
+      }
+      return isLt2M
+    },
+    handleImportExcelSuccess(res, file) {
+      this.get_table_data()
+      if (res.msg === 'ok') {
+        this.$message({
+          title: '成功',
+          message: '导入成功:' + res.data.success + '条!',
+          type: 'success',
+          duration: 2000
+        })
+        if (res.data.err_count > 0) {
+          this.$notify({
+            title: '失败',
+            message: '导入失败:' + res.data.err_count + '条!',
+            type: 'danger',
+            duration: 2000
+          })
+           import('@/vendor/Export2Excel').then(excel => {
+             const list1 = res.data.result
+             const tHeader = [
+               '牧场', '器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点', '报错信息'
+             ]
+             const filterVal = [
+               '牧场', '器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点', 'error_msg'
+             ]
+             const data1 = this.formatJson(filterVal, list1)
+             excel.export_json_to_excel({
+               header: tHeader,
+               data: data1,
+               filename: '温度计报错信息',
+               autoWidth: true,
+               bookType: 'xlsx'
+             })
+           })
+        }
+      } else {
+        this.$notify({
+          title: '失败',
+          message: '上传失败',
+          type: 'danger',
+          duration: 2000
+        })
+      }
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j === 'timestamp') {
+            return parseTime(v[j])
+          } else {
+            return v[j]
+          }
+        })
+      )
+    },
+    handleDownload() {
+      console.log('点击了导出')
+      this.$alert('温度计正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
+      this.isPercentage = true
+      this.percentage = 1
+      var timer = setInterval(() => {
+        this.percentage += 5
+        if (this.percentage > 95) {
+          this.percentage = 99
+          clearInterval(timer)
+        }
+        this.percentage = this.percentage
+      }, 1000)
+      this.downLoadParm.name = 'getExaminewarningList'
+      this.downLoadParm.parammaps = this.getdataListParm.parammaps
+      GetAccount(this.downLoadParm).then(response => {
+        if (response.data.list !== '') {
+          this.percentage = 99
+          setTimeout(() => {
+            this.isPercentage = false
+          }, 2000)
+        }
+        this.$nextTick(() => {
+          this.downLoadList = response.data.list
+          console.log('导出table数据', this.downLoadList)
+          const ExcelDatas = [
+            {
+              tHeader: ['牧场', '器具名称', '规格型号', '准确度等级、不确定度或最大允许误差', '测量范围', '出厂编号', '数量', '制造单位', '检定周期', '上次检定日期', '有效期至', '检定单位', '计量器具用途', '安装使用地点'],
+              filterVal: ['pastureName', 'warnName', 'specification', 'level', 'measureRange', 'factoryNumber', 'amount', 'unit', 'cycle', 'lastCheckDate', 'validityDate', 'warnUnit', 'purpose', 'location'],
+              tableDatas: this.downLoadList,
+              sheetName: '温度计'
+            }
+          ]
+          json2excel(ExcelDatas, '温度计', true, 'xlsx')
+        })
+      })
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+.app-btn {
+  margin-bottom: 10px;
+}
+</style>
+

+ 14 - 13
src/views/special/measure/index.vue

@@ -41,8 +41,8 @@
       :row-style="rowStyle"
       :cell-style="cellStyle"
       class="elTable"
-      @sort-change="tableSort1"
       :max-height="myHeight"
+      @sort-change="tableSort1"
     >
       <el-table-column label="序号" align="center" type="index" width="50px">
         <template slot-scope="scope">
@@ -162,7 +162,7 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="倍率:" prop="Multiple">
-                <el-input ref="Multiple" v-model="createTemp.Multiple"  disabled/>
+                <el-input ref="Multiple" v-model="createTemp.Multiple" disabled />
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -371,7 +371,7 @@ export default {
 
       // 校验规则
       // -----------------------------
-      myHeight:document.documentElement.clientHeight - 85- 200,
+      myHeight: document.documentElement.clientHeight - 85 - 200,
       rules: {
         useType: [{ required: true, message: '必填', trigger: 'blur' }],
         formType: [{ required: true, message: '必填', trigger: 'blur' }],
@@ -388,7 +388,8 @@ export default {
       requestParams: [
         { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['表类型'] }
+        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['表类型'] },
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       getDepartParam: {
         name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
@@ -434,7 +435,7 @@ export default {
         formNumber: '',
         inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'),
         Multiple: '1',
-        iotNumber:''
+        iotNumber: ''
       },
       requestParam: {},
       activeName: 'first',
@@ -450,7 +451,7 @@ export default {
         parammaps: {}
       },
       isPercentage: false,
-      percentage: 1,
+      percentage: 1
     }
   },
   computed: {
@@ -489,7 +490,7 @@ export default {
     },
     get_select_list() {
       GetDataByNames(this.requestParams).then(response => {
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list
         this.getDepartDownList()
@@ -579,7 +580,7 @@ export default {
         formNumber: '',
         inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'),
         Multiple: '1',
-        iotNumber:''
+        iotNumber: ''
       }
     },
     form_add() {
@@ -756,10 +757,10 @@ export default {
            import('@/vendor/Export2Excel').then(excel => {
              const list1 = res.data.result
              const tHeader = [
-               '牧场', '表名称', '表编号', '表结构', '表类型', '部门', '位置', '最后一次抄表值', '单价', '管理人', '倍率','iot编号', '错误信息'
+               '牧场', '表名称', '表编号', '表结构', '表类型', '部门', '位置', '最后一次抄表值', '单价', '管理人', '倍率', 'iot编号', '错误信息'
              ]
              const filterVal = [
-               '牧场', '表名称', '表编号', '表结构', '表类型', '部门', '位置', '最后一次抄表值', '单价', '管理人', '倍率', 'iot编号','error_msg'
+               '牧场', '表名称', '表编号', '表结构', '表类型', '部门', '位置', '最后一次抄表值', '单价', '管理人', '倍率', 'iot编号', 'error_msg'
              ]
              const data1 = this.formatJson(filterVal, list1)
              excel.export_json_to_excel({
@@ -792,7 +793,7 @@ export default {
         })
       )
     },
-    handleDownloadTemp(){
+    handleDownloadTemp() {
       this.$alert('计量设备管理模板正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
       this.isPercentage = true
       this.percentage = 1
@@ -823,10 +824,10 @@ export default {
               }, 2000)
             }
             const tHeader = [
-              '牧场','表名称','表编号','表结构','表类型','部门','位置','最后一次抄表值','单价','管理人','倍率','iot编号'
+              '牧场', '表名称', '表编号', '表结构', '表类型', '部门', '位置', '最后一次抄表值', '单价', '管理人', '倍率', 'iot编号'
             ]
             const filterVal = [
-              'pastureName', 'formName', 'formNumber', 'useType', 'formType', 'departName', 'location', 'endAmount', 'price','employeName','Multiple','iotNumber'
+              'pastureName', 'formName', 'formNumber', 'useType', 'formType', 'departName', 'location', 'endAmount', 'price', 'employeName', 'Multiple', 'iotNumber'
             ]
             const data1 = this.formatJson(filterVal, list1)
             excel.export_json_to_excel({

+ 3 - 2
src/views/specialEquipment/basic/index.vue

@@ -1096,7 +1096,8 @@ export default {
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
-        { name: 'getAssetSTT1', offset: 0, pagecount: 0, parammaps: {}}
+        { name: 'getAssetSTT1', offset: 0, pagecount: 0, parammaps: {}},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       temp: {
         inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'),
@@ -1294,7 +1295,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list// response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list

+ 3 - 2
src/views/specialEquipment/check/index.vue

@@ -1096,7 +1096,8 @@ export default {
         { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
         { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
-        { name: 'getAssetSTT1', offset: 0, pagecount: 0, parammaps: {}}
+        { name: 'getAssetSTT1', offset: 0, pagecount: 0, parammaps: {}},
+        { name: 'getPastureRoleList', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid'), empId: this.$store.state.user.employeid }}
       ],
       temp: {
         inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'),
@@ -1293,7 +1294,7 @@ export default {
       GetDataByNames(this.requestParams).then(response => {
         this.findAllProvider = response.data.findAllProvider.list
         this.findAllAssetType = response.data.findAllAssetType.list
-        this.findAllPasture = response.data.findAllPasture.list
+        this.findAllPasture = response.data.getPastureRoleList.list // response.data.findAllPasture.list
         this.findAllDepart = response.data.findAllDepart.list
         this.findAllEmploye = response.data.findAllEmploye.list
         this.getDictByName = response.data.getDictByName.list

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä