|
|
@@ -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">
|