2
3
baichengfei 5 лет назад
Родитель
Сommit
1e973adaff

+ 80 - 84
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-basis/index.vue

@@ -207,7 +207,7 @@ import permissionApi from '@/api/oilcontract/permission'
 import submitPopup from '@/components/oilcontract/submitPopup.vue'
 import FileSaver from 'file-saver'
 import XLSX from 'xlsx'
-import util from "../../../utils/util";
+import util from '../../../utils/util'
 
 export default {
   computed: {
@@ -263,7 +263,7 @@ export default {
           let timeString = this.timeStyle(item)
           return timeString
         } else {
-          return item;
+          return item
         }
       }
     }
@@ -281,20 +281,20 @@ export default {
       editeBoolean: false,
       deleteBoolean: false,
       dialogVisible: false,
-      //列表数据
+      // 列表数据
       entityList: [],
-      //分页参数
+      // 分页参数
       size: 10,
       currentPage: 1,
       currentItemCount: 0,
-      //列表排序
+      // 列表排序
       Column: {
         Order: '',
         Prop: ''
       },
-      //查询时间 new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()
+      // 查询时间 new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()
       CreateOn: [],
-      //查询项
+      // 查询项
       searchFormReset: {},
       searchForm: {
         Id: '',
@@ -330,118 +330,116 @@ export default {
         CreateBy: '',
         ModifiedOn: '',
         ModifiedUserId: '',
-        ModifiedBy: '',
+        ModifiedBy: ''
       },
       tableColumns: [
 
         {
-          prop: "Status",
+          prop: 'Status',
           label: '状态',
           width: 100,
           sort: true
         },
 
         // {
-        //   prop: "SupplierId",
+        //   prop: 'SupplierId',
         //   label: '评价单位',
         //   width: 100,
         //   sort: true
         // },
 
         {
-          prop: "SupplierName",
+          prop: 'SupplierName',
           label: '企业名称',
           width: 100,
           sort: true
         },
 
         {
-          prop: "ProjectName",
+          prop: 'ProjectName',
           label: '项目名称',
           width: 100,
           sort: true
         },
 
         {
-          prop: "ContractNo",
+          prop: 'ContractNo',
           label: '合同编号',
           width: 100,
           sort: true
         },
 
         {
-          prop: "ProjectPlace",
+          prop: 'ProjectPlace',
           label: '工程地点',
           width: 100,
           sort: true
         },
 
         {
-          prop: "ProjectOwner",
+          prop: 'ProjectOwner',
           label: '项目负责人',
           width: 100,
           sort: true
         },
 
         {
-          prop: "Telephone",
+          prop: 'Telephone',
           label: '联系人电话',
           width: 100,
           sort: true
         },
 
         {
-          prop: "ProjectType",
+          prop: 'ProjectType',
           label: '项目类别',
           width: 100,
           sort: true
         },
 
         // {
-        //   prop: "ContractMode",
+        //   prop: 'ContractMode',
         //   label: '合同模式',
         //   width: 100,
         //   sort: true
         // },
 
         {
-          prop: "Amount",
+          prop: 'Amount',
           label: '合同总金额(万元)',
           width: 100,
           sort: true
         },
 
         {
-          prop: "ContractPeriod",
+          prop: 'ContractPeriod',
           label: '合同总工期(天)',
           width: 100,
           sort: true
         },
 
         {
-          prop: "OpenDate",
+          prop: 'OpenDate',
           label: '开工日期',
           width: 100,
           sort: true
         },
 
         {
-          prop: "PlanFinishDate",
+          prop: 'PlanFinishDate',
           label: '计划竣工时间',
           width: 100,
           sort: true
-        },
-
-
+        }
       ]
     }
   },
-  created() {
-    //查询条件初始值备份
-    Object.assign(this.searchFormReset, this.searchForm);
-    //查询列表
-    this.initDatas();
-    //this.getDictOptions()
+  created () {
+    // 查询条件初始值备份
+    Object.assign(this.searchFormReset, this.searchForm)
+    // 查询列表
+    this.initDatas()
+    // this.getDictOptions()
     this.statusFun()
     // console.log(8888888,localStorage.getItem('userRoleids'))
     // if(localStorage.getItem('userRoleids')!=''&&localStorage.getItem('userRoleids')!=undefined){
@@ -450,7 +448,6 @@ export default {
     // }else{
     //   this.userRoleids = -1
     // }
-
   },
   methods: {
     timeStyle (item) {
@@ -459,8 +456,8 @@ export default {
       }
       return util.formatDate('year', item)
     },
-    //一键处理
-    onSelectAll(e) {
+    // 一键处理
+    onSelectAll (e) {
       console.log(e)
       var list = []
       e.map((item, index) => {
@@ -468,27 +465,27 @@ export default {
       })
       this.eveIdList = list
     },
-    //筛选
-    selectableFun(row, index) {
+    // 筛选
+    selectableFun (row, index) {
       if (row.Status == 4) {
-        return true;
+        return true
       } else {
-        return false;
+        return false
       }
     },
-    //一键处理按钮
-    onSelectAllButton() {
+    // 一键处理按钮
+    onSelectAllButton () {
       this.selectAllButtonBoolean = true
     },
-    //一键处理确定
-    onSelectAllButtonTrue() {
+    // 一键处理确定
+    onSelectAllButtonTrue () {
       if (this.eveIdList != 0 && this.eveIdList != undefined) {
         this.$refs.submitpopup.dialogCommonAuditMakeSureVisible = true
       } else {
         this.$message({
           type: 'warning',
           message: '请选择评价'
-        });
+        })
       }
     },
     // 一键处理取消
@@ -538,25 +535,25 @@ export default {
         console.error(err)
       })
     },
-    //跳转评价
-    onNavigateEvaluate(item) {
+    // 跳转评价
+    onNavigateEvaluate (item) {
       console.log('跳转', item)
       this.$router.push({
         path: '/oilcontract/contract-basis/' + item.Id + '/evaluate',
         query: {
           item: item,
-          type: 2,
+          type: 2
         }
       })
     },
-    initDatas() {
-      //分页及列表条件
+    initDatas () {
+      // 分页及列表条件
       let params = {
         _currentPage: this.currentPage,
         _size: this.size,
         Order: this.Column.Order,
         Prop: this.Column.Prop,
-        ContractClass: '02',
+        ContractClass: '02'
       }
       // <el-option label="物资类" value="01" key="01"></el-option>
       // <el-option label="基建类" value="02" key="02"></el-option>
@@ -572,9 +569,9 @@ export default {
         myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
         myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
       }
-      //查询条件
+      // 查询条件
       Object.assign(params, this.searchForm)
-      //访问接口
+      // 访问接口
       api.getReviewList(myCreateOn.join(','), params, this.$axios).then(res => {
         console.log('评价接口', res)
         this.entityList = res.data.items
@@ -584,25 +581,25 @@ export default {
       })
     },
 
-    getDictOptions() {
+    getDictOptions () {
       api.getDictList(this.$axios).then(res => {
-        //this.dictOptions.customerList = res.data.items['customerList']
-        //this.dictOptions.projectList = res.data.items['projectList']
+        // this.dictOptions.customerList = res.data.items['customerList']
+        // this.dictOptions.projectList = res.data.items['projectList']
 
       }).catch(err => {
         console.error(err)
       })
     },
 
-    searchCommand(command) {
+    searchCommand (command) {
       if (command == 'search') {
         this.dialogVisible = true
       } else if (command == 'clear') {
         this.clearSearch()
       }
     },
-    //列表排序功能
-    orderby(column) {
+    // 列表排序功能
+    orderby (column) {
       if (column.order == 'ascending') {
         this.Column.Order = 'asc'
       } else if (column.order == 'descending') {
@@ -611,46 +608,46 @@ export default {
       this.Column.Prop = column.prop
       this.initDatas()
     },
-    clearSearch() {
-      Object.assign(this.searchForm, this.searchFormReset);
-      //this.searchForm = this.searchFormReset;
+    clearSearch () {
+      Object.assign(this.searchForm, this.searchFormReset)
+      // this.searchForm = this.searchFormReset;
       this.CreateOn = ''
       this.initDatas()
     },
-    handleSearch() {
-      this.currentPage = 1;
-      this.dialogVisible = false;
-      this.initDatas();
+    handleSearch () {
+      this.currentPage = 1
+      this.dialogVisible = false
+      this.initDatas()
     },
-    handleCurrentChange(value) {
+    handleCurrentChange (value) {
       this.currentPage = value
       this.initDatas()
     },
-    handleSizeChange(value) {
+    handleSizeChange (value) {
       this.size = value
       this.currentPage = 1
       this.initDatas()
     },
-    deleteEntity(row, index) {
+    deleteEntity (row, index) {
       this.$refs['popover-' + `${index}`].doClose()
       apiReview.deleteEntity(row.Id, this.$axios).then(res => {
         if (res.data.code === 0) {
-          this.initDatas();
+          this.initDatas()
           this.$message({
             type: 'success',
             message: res.data.message
-          });
+          })
         } else {
           this.$message({
             type: 'warning',
             message: res.data.message
-          });
+          })
         }
       }).catch(err => {
         console.error(err)
-      });
+      })
     },
-    jstimehandle(val) {
+    jstimehandle (val) {
       if (val === '') {
         return '----'
       } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -662,7 +659,7 @@ export default {
         return val.substring(0, 10)
       }
     },
-    exportExcel() {
+    exportExcel () {
       /* generate workbook object from table */
       let wb = XLSX.utils.table_to_book(
         document.querySelector('#rebateSetTable')
@@ -685,20 +682,19 @@ export default {
       }
       return wbout
     },
-    formatDateTime(date) {
-      var y = date.getFullYear();
-      var m = date.getMonth() + 1;
-      m = m < 10 ? ('0' + m) : m;
-      var d = date.getDate();
-      d = d < 10 ? ('0' + d) : d;
-      var h = date.getHours();
-      var minute = date.getMinutes();
-      minute = minute < 10 ? ('0' + minute) : minute;
-      return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
+    formatDateTime (date) {
+      var y = date.getFullYear()
+      var m = date.getMonth() + 1
+      m = m < 10 ? ('0' + m) : m
+      var d = date.getDate()
+      d = d < 10 ? ('0' + d) : d
+      var h = date.getHours()
+      var minute = date.getMinutes()
+      minute = minute < 10 ? ('0' + minute) : minute
+      return y + '-' + m + '-' + d + ' ' + h + ':' + minute
     }
   }
 }
-
 </script>
 
 <style lang="scss">