Liuqi před 6 roky
rodič
revize
1369235412

+ 114 - 121
src/dashoo.cn/frontend_web/src/pages/lims/principal/subdata/customerposition.vue

@@ -167,10 +167,10 @@
     name: 'customerposition',
     props: {
       CustomerId: Number,
-      DivStyle: String,
+      DivStyle: String
     },
 
-    data() {
+    data () {
       return {
         QueryProjectTypeId: null,
         otherNodeVisible: false,
@@ -190,13 +190,13 @@
           label: 'PositionName',
           children: 'children'
         },
-        //列表数据
+        // 列表数据
         entityList: [],
-        //分页参数
+        // 分页参数
         size: 10,
         currentPage: 1,
         currentItemCount: 0,
-        //列表排序
+        // 列表排序
         Column: {
           Order: '',
           Prop: ''
@@ -218,7 +218,7 @@
           CreateBy: '',
           ModifiedOn: '',
           ModifiedUserId: '',
-          ModifiedBy: '',
+          ModifiedBy: ''
 
         },
         formData: {
@@ -243,38 +243,36 @@
           ModifiedBy: ''
 
         },
-        //查询时间
+        // 查询时间
         CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
         tableColumns: [
           {
-            prop: "PositionName",
+            prop: 'PositionName',
             label: '位置名称',
             width: 200,
             sort: true
           },
 
           {
-            prop: "PositionType",
+            prop: 'PositionType',
             label: '位置类型',
             width: 100,
             sort: true
           },
 
-          /*{
+          /* {
             prop: "ProjectType",
             label: '设备类型',
             sort: true
           },*/
 
           {
-            prop: "SortCode",
+            prop: 'SortCode',
             label: '排序码',
             width: 80,
             sort: true
           },
 
-
-
           // {
           //   prop: "CreateOn",
           //   label: '创建时间',
@@ -283,17 +281,17 @@
           // },
 
           {
-            prop: "CreateBy",
+            prop: 'CreateBy',
             label: '创建人',
             width: 100,
             sort: true
-          },
+          }
 
         ]
       }
     },
-    created() {
-      //查询列表
+    created () {
+      // 查询列表
       this.customerCheckBuildList()
       this.gettreelist()
       this.initDatas()
@@ -307,35 +305,35 @@
             this.formData = res.data
           }).catch(err => {
             console.error(err)
-          });
-        }
+          })
+      }
       },
 
-      ProjectTypeChangeHandler() {
+      ProjectTypeChangeHandler () {
         this.initDatas()
       },
 
-      ProjectTypeClearHandler() {
+      ProjectTypeClearHandler () {
         this.initDatas()
       },
 
-      initDatas() {
-        //分页及列表条件
+      initDatas () {
+        // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
           _size: this.size,
           Order: this.Column.Order,
           Prop: this.Column.Prop,
-          ParentId: this.selectNodeId + "",
-          CustomerId: this.CustomerId + "",
-          ProjectTypeId: this.QueryProjectTypeId + '',
-        };
-
-        //访问接口
-        api.getList('', params, this.$axios).then(res => {
-          this.entityList = res.data.items;
-          this.currentItemCount = res.data.currentItemCount;
-        }).catch(err => {
+          ParentId: this.selectNodeId + '',
+          CustomerId: this.CustomerId + '',
+          ProjectTypeId: this.QueryProjectTypeId + ''
+        }
+
+      //访问接口
+      api.getList('', params, this.$axios).then(res => {
+          this.entityList = res.data.items
+        this.currentItemCount = res.data.currentItemCount
+      }).catch(err => {
           console.error(err)
         })
       },
@@ -383,7 +381,7 @@
             message: '设备类型不能为空'
           })
           return
-        }*/
+        } */
         if (!this.formData.PositionName) {
           this.$message({
             type: 'warning',
@@ -402,63 +400,60 @@
             } else {
               this.updateEntity()
             }
-
           } else {
             return false
           }
         })
       },
 
-      addEntity() {
+      addEntity () {
         api.addEntity(this.formData, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
-            this.formData.Id = res.data.item;
-            this.initDatas();
-            this.gettreelist();
-            this.customerCheckBuildList();
-            this.$message({
+            // 保存成功后,初始化数据,变成修改
+            this.formData.Id = res.data.item
+          this.initDatas()
+          this.gettreelist()
+          this.customerCheckBuildList()
+          this.$message({
               type: 'success',
               message: res.data.message
-            });
-            this.dialogVisible = false
+            })
+          this.dialogVisible = false
             this.positionDialogVisible = false
-
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
-          }
+            })
+        }
         }).catch(err => {
           console.error(err)
-        });
-      },
+        })
+    },
 
-      updateEntity() {
+      updateEntity () {
         api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
-            this.initDatas();
-            this.gettreelist();
-            this.customerCheckBuildList();
-            this.$message({
+            // 保存成功后,初始化数据,变成修改
+            this.initDatas()
+          this.gettreelist()
+          this.customerCheckBuildList()
+          this.$message({
               type: 'success',
               message: res.data.message
-            });
-            this.dialogVisible = false
+            })
+          this.dialogVisible = false
             this.positionDialogVisible = false
-
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
-          }
+            })
+        }
         }).catch(err => {
           console.error(err)
-        });
-      },
+        })
+    },
 
       getDictOptions () {
         api.getDictList(this.$axios).then(res => {
@@ -472,34 +467,33 @@
         })
       },
 
-
-      setNodeParentZero() {
-        this.formData.ParentId = 0;
-        this.tmpShowSelectNodeName = "根节点";
+      setNodeParentZero () {
+        this.formData.ParentId = 0
+      this.tmpShowSelectNodeName = '根节点';
       },
 
-      setNodeParentCurrent() {
-        this.formData.ParentId = this.selectNodeId;
-        this.tmpShowSelectNodeName = this.selectNodeName;
-      },
+      setNodeParentCurrent () {
+        this.formData.ParentId = this.selectNodeId
+      this.tmpShowSelectNodeName = this.selectNodeName
+    },
 
-      orgtreeNodeClick(data) {
-        this.selectNodeId = data.id + '';
-        this.selectNodeName = data.PositionName + '';
+      orgtreeNodeClick (data) {
+        this.selectNodeId = data.id + ''
+      this.selectNodeName = data.PositionName + ''
 
-        this.currentPage = 1;
-        this.initDatas();
-      },
+      this.currentPage = 1
+      this.initDatas()
+    },
 
-      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') {
@@ -508,16 +502,16 @@
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()
       },
-      deleteConfirm(row) {
+      deleteConfirm (row) {
         this.$confirm('此操作将永久删除该位置, 是否继续?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -526,31 +520,31 @@
           this.deleteEntity(row)
         })
       },
-      deleteEntity(row) {
-        row.deleteConfirmFlag = false;
-        api.deleteEntity(row.Id, this.$axios).then(res => {
+      deleteEntity (row) {
+        row.deleteConfirmFlag = false
+      api.deleteEntity(row.Id, this.$axios).then(res => {
           if (res.data.code === 0) {
-            this.initDatas();
-            this.gettreelist();
-            this.$message({
+            this.initDatas()
+          this.gettreelist()
+          this.$message({
               type: 'success',
               message: res.data.message
-            });
+            })
 
-          } else {
+        } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
-          }
+            })
+        }
         }).catch(err => {
           console.error(err)
-        });
-      },
+        })
+    },
 
-      customerCheckBuildList() {
+      customerCheckBuildList () {
         let params = {
-          CustomerId: this.CustomerId + "",
+          CustomerId: this.CustomerId + ''
         }
         api.customerCheckBuildList(params, this.$axios).then(res => {
           this.customerOrigList = res.data.items
@@ -560,15 +554,15 @@
         })
       },
 
-      gettreelist() {
+      gettreelist () {
         let params = {
-          CustomerId: this.CustomerId + '',
-        };
+          CustomerId: this.CustomerId + ''
+        }
 
-        api.customerPositionTree(params, this.$axios).then(res => {
-            this.customerTreeList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId',
-              'Id,CustomerId,ParentId,PositionName,PositionCode,PositionType,PositionTypeId');
-          })
+      api.customerPositionTree(params, this.$axios).then(res => {
+          this.customerTreeList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId',
+            'Id,CustomerId,ParentId,PositionName,PositionCode,PositionType,PositionTypeId')
+        })
           .catch(err => {
             // handle error
             console.error(err)
@@ -619,16 +613,16 @@
         this.positionDialogVisible = true
       },
 
-      getParentNode(parentId) {
+      getParentNode (parentId) {
         api.getEntity(parentId, this.$axios).then(res => {
-          this.tmpShowSelectNodeName = res.data.PositionName;
-        }).catch(err => {
+          this.tmpShowSelectNodeName = res.data.PositionName
+      }).catch(err => {
           // handle error
           console.error(err)
         })
       },
 
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -641,20 +635,20 @@
         }
       },
 
-      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
+    },
 
       // 设备类型
-      getProjectType() {
+      getProjectType () {
         let _this = this
         _this.$axios.get('/testtype/testypetreeall', {})
           .then(res => {
@@ -672,11 +666,10 @@
             // handle error
             console.error(err)
           })
-      },
+      }
 
     }
   }
-
 </script>
 
 <style lang="scss">

+ 113 - 120
src/dashoo.cn/frontend_web/src/pages/lims/principal/subdata/customerpositionout.vue

@@ -168,10 +168,10 @@
     name: 'customerposition',
     props: {
       CustomerId: Number,
-      DivStyle: String,
+      DivStyle: String
     },
 
-    data() {
+    data () {
       return {
         QueryProjectTypeId: null,
         otherNodeVisible: false,
@@ -191,13 +191,13 @@
           label: 'PositionName',
           children: 'children'
         },
-        //列表数据
+        // 列表数据
         entityList: [],
-        //分页参数
+        // 分页参数
         size: 10,
         currentPage: 1,
         currentItemCount: 0,
-        //列表排序
+        // 列表排序
         Column: {
           Order: '',
           Prop: ''
@@ -219,7 +219,7 @@
           CreateBy: '',
           ModifiedOn: '',
           ModifiedUserId: '',
-          ModifiedBy: '',
+          ModifiedBy: ''
 
         },
         formData: {
@@ -239,41 +239,39 @@
           CreateBy: '',
           ModifiedOn: '',
           ModifiedUserId: '',
-          ModifiedBy: '',
+          ModifiedBy: ''
 
         },
-        //查询时间
+        // 查询时间
         CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
         tableColumns: [
           {
-            prop: "PositionName",
+            prop: 'PositionName',
             label: '客户位置名称',
             width: 200,
             sort: true
           },
 
           {
-            prop: "PositionType",
+            prop: 'PositionType',
             label: '位置类型',
             width: 100,
             sort: true
           },
 
           {
-            prop: "ProjectType",
+            prop: 'ProjectType',
             label: '设备类型',
             sort: true
           },
 
           {
-            prop: "SortCode",
+            prop: 'SortCode',
             label: '排序码',
             width: 80,
             sort: true
           },
 
-
-
           // {
           //   prop: "CreateOn",
           //   label: '创建时间',
@@ -282,17 +280,17 @@
           // },
 
           {
-            prop: "CreateBy",
+            prop: 'CreateBy',
             label: '创建人',
             width: 100,
             sort: true
-          },
+          }
 
         ]
       }
     },
-    created() {
-      //查询列表
+    created () {
+      // 查询列表
       this.customerCheckBuildList()
       this.gettreelist()
       this.initDatas()
@@ -306,36 +304,36 @@
             this.formData = res.data
           }).catch(err => {
             console.error(err)
-          });
-        }
+          })
+      }
       },
 
-      ProjectTypeChangeHandler() {
+      ProjectTypeChangeHandler () {
         this.initDatas()
       },
 
-      ProjectTypeClearHandler() {
+      ProjectTypeClearHandler () {
         this.initDatas()
       },
 
-      initDatas() {
-        //分页及列表条件
+      initDatas () {
+        // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
           _size: this.size,
           Order: this.Column.Order,
           Prop: this.Column.Prop,
-          ParentId: this.selectNodeId + "",
-          CustomerId: this.CustomerId + "",
+          ParentId: this.selectNodeId + '',
+          CustomerId: this.CustomerId + '',
           ProjectTypeId: this.QueryProjectTypeId + '',
           outCustomer: 'true'
-        };
+        }
 
-        //访问接口
-        api.getList('', params, this.$axios).then(res => {
-          this.entityList = res.data.items;
-          this.currentItemCount = res.data.currentItemCount;
-        }).catch(err => {
+      //访问接口
+      api.getList('', params, this.$axios).then(res => {
+          this.entityList = res.data.items
+        this.currentItemCount = res.data.currentItemCount
+      }).catch(err => {
           console.error(err)
         })
       },
@@ -400,65 +398,62 @@
             } else {
               this.updateEntity()
             }
-
           } else {
             return false
           }
         })
       },
 
-      addEntity() {
+      addEntity () {
         api.addEntity(this.formData, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
-            this.formData.Id = res.data.item;
-            this.initDatas();
-            this.gettreelist();
-            this.customerCheckBuildList();
-            this.$message({
+            // 保存成功后,初始化数据,变成修改
+            this.formData.Id = res.data.item
+          this.initDatas()
+          this.gettreelist()
+          this.customerCheckBuildList()
+          this.$message({
               type: 'success',
               message: res.data.message
-            });
-            this.dialogVisible = false
+            })
+          this.dialogVisible = false
             this.positionDialogVisible = false
-
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
-          }
+            })
+        }
         }).catch(err => {
           console.error(err)
-        });
-      },
+        })
+    },
 
-      updateEntity() {
+      updateEntity () {
         api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
           if (res.data.code === 0) {
-            //保存成功后,初始化数据,变成修改
-            this.initDatas();
-            this.gettreelist();
-            this.customerCheckBuildList();
-            this.$message({
+            // 保存成功后,初始化数据,变成修改
+            this.initDatas()
+          this.gettreelist()
+          this.customerCheckBuildList()
+          this.$message({
               type: 'success',
               message: res.data.message
-            });
-            this.dialogVisible = false
+            })
+          this.dialogVisible = false
             this.positionDialogVisible = false
-
           } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
-          }
+            })
+        }
         }).catch(err => {
           console.error(err)
-        });
-      },
+        })
+    },
 
-      /*getDictOptions () {
+      /* getDictOptions () {
         api.getDictList(this.$axios).then(res => {
           console.log(res.data.items)
           this.thrUnitList = res.data.items['ThrUnitList']
@@ -467,34 +462,33 @@
         })
       },*/
 
-
-      setNodeParentZero() {
-        this.formData.ParentId = 0;
-        this.tmpShowSelectNodeName = "根节点";
+      setNodeParentZero () {
+        this.formData.ParentId = 0
+      this.tmpShowSelectNodeName = '根节点';
       },
 
-      setNodeParentCurrent() {
-        this.formData.ParentId = this.selectNodeId;
-        this.tmpShowSelectNodeName = this.selectNodeName;
-      },
+      setNodeParentCurrent () {
+        this.formData.ParentId = this.selectNodeId
+      this.tmpShowSelectNodeName = this.selectNodeName
+    },
 
-      orgtreeNodeClick(data) {
-        this.selectNodeId = data.id + '';
-        this.selectNodeName = data.PositionName + '';
+      orgtreeNodeClick (data) {
+        this.selectNodeId = data.id + ''
+      this.selectNodeName = data.PositionName + ''
 
-        this.currentPage = 1;
-        this.initDatas();
-      },
+      this.currentPage = 1
+      this.initDatas()
+    },
 
-      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') {
@@ -503,16 +497,16 @@
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()
       },
-      deleteConfirm(row) {
+      deleteConfirm (row) {
         this.$confirm('此操作将永久删除该位置, 是否继续?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -521,31 +515,31 @@
           this.deleteEntity(row)
         })
       },
-      deleteEntity(row) {
-        row.deleteConfirmFlag = false;
-        api.deleteEntity(row.Id, this.$axios).then(res => {
+      deleteEntity (row) {
+        row.deleteConfirmFlag = false
+      api.deleteEntity(row.Id, this.$axios).then(res => {
           if (res.data.code === 0) {
-            this.initDatas();
-            this.gettreelist();
-            this.$message({
+            this.initDatas()
+          this.gettreelist()
+          this.$message({
               type: 'success',
               message: res.data.message
-            });
+            })
 
-          } else {
+        } else {
             this.$message({
               type: 'warning',
               message: res.data.message
-            });
-          }
+            })
+        }
         }).catch(err => {
           console.error(err)
-        });
-      },
+        })
+    },
 
-      customerCheckBuildList() {
+      customerCheckBuildList () {
         let params = {
-          CustomerId: this.CustomerId + "",
+          CustomerId: this.CustomerId + ''
         }
         api.customerCheckBuildList(params, this.$axios).then(res => {
           this.customerOrigList = res.data.items
@@ -555,15 +549,15 @@
         })
       },
 
-      gettreelist() {
+      gettreelist () {
         let params = {
-          CustomerId: this.CustomerId + '',
-        };
+          CustomerId: this.CustomerId + ''
+        }
 
-        api.customerPositionTreeOut(params, this.$axios).then(res => {
+      api.customerPositionTreeOut(params, this.$axios).then(res => {
           this.customerTreeList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId',
-            'Id,CustomerId,ParentId,PositionName,PositionCode,PositionType,PositionTypeId');
-        })
+            'Id,CustomerId,ParentId,PositionName,PositionCode,PositionType,PositionTypeId')
+      })
           .catch(err => {
             // handle error
             console.error(err)
@@ -614,16 +608,16 @@
         this.positionDialogVisible = true
       },
 
-      getParentNode(parentId) {
+      getParentNode (parentId) {
         api.getEntity(parentId, this.$axios).then(res => {
-          this.tmpShowSelectNodeName = res.data.PositionName;
-        }).catch(err => {
+          this.tmpShowSelectNodeName = res.data.PositionName
+      }).catch(err => {
           // handle error
           console.error(err)
         })
       },
 
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -636,20 +630,20 @@
         }
       },
 
-      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
+    },
 
-      //设备类型
-      getProjectType() {
+      // 设备类型
+      getProjectType () {
         let _this = this
         _this.$axios.get('/testtype/testypetreeall', {})
           .then(res => {
@@ -667,11 +661,10 @@
             // handle error
             console.error(err)
           })
-      },
+      }
 
     }
   }
-
 </script>
 
 <style lang="scss">

+ 4 - 4
src/dashoo.cn/frontend_web/src/pages/lims/secondunitform/positionmgr.vue

@@ -12,7 +12,7 @@
   export default {
     name: 'positionmgr',
     components: {
-      CustomerPosition,
+      CustomerPosition
     },
     computed: {
       ...mapGetters({
@@ -35,7 +35,7 @@
           Address: '',
           DepartmentId: '',
           DepartmentName: ''
-        },
+        }
       }
     },
     methods: {
@@ -46,8 +46,8 @@
             _this.customerForm = res.data.items
           }).catch(err => {
             console.error(err)
-        })
-      },
+          })
+      }
     }
   }
 </script>