![]()
@@ -226,7 +285,8 @@
cancelOrder,
changeOrderOperator,
submitDefect,
- searchFileUrl
+ searchFileUrl,
+ getEmpyDeptList,
} from "@/api/eam/eam.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import Chooselist from '@/views/modules/common/Chooselist_eam'
@@ -271,6 +331,7 @@
status: '',
startDate:'',
endDate:'',
+ departmentName: '',
page: 1,
limit: 10,
},
@@ -396,6 +457,40 @@
status: true,
fixed: '',
},
+ {
+ userId: this.$store.state.user.name,
+ functionId: 101018,
+ serialNumber: '101018TableObjectID',
+ tableId: "101018Table",
+ tableName: "common",
+ columnProp: 'objectDesc',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '设备名称',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
+ {
+ userId: this.$store.state.user.name,
+ functionId: 101018,
+ serialNumber: '101018TableObjectID',
+ tableId: "101018Table",
+ tableName: "common",
+ columnProp: 'departmentName',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '设备部门',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
{
userId: this.$store.state.user.name,
functionId: 101018,
@@ -619,7 +714,40 @@
detailData: {},
detailModelFlag: false,
descImages: [],
- imageModalFlag: false
+ imageModalFlag: false,
+ departmentModelFlag: false,
+ departmentData: {
+ site: this.$store.state.user.site,
+ deptId: '',
+ deptName: '',
+ },
+ departmentListSelections: [],
+ departmentDetailList: [
+ {
+ columnProp: 'deptId',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '部门编码',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
+ {
+ columnProp: 'deptName',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '部门名称',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
+ ],
}
},
mounted () {
@@ -933,6 +1061,56 @@
this.imageModalFlag = true
},
+ // 获取部门列表
+ getDepartmentList(){
+ // 先清空缓存选中
+ this.$nextTick(() => this.$refs.departmentTable.clearSelection())
+ // 拿到选中的部门编号
+ let tempDataList = this.searchData.departmentName.split(';')
+ // 查询所有部门
+ getEmpyDeptList(this.departmentData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.departmentList = data.rows
+ this.departmentList.forEach(val => {
+ // 回显选中的部门
+ if (tempDataList.includes(val.deptName)) {
+ this.$nextTick(() => this.$refs.departmentTable.toggleRowSelection(val, true))
+ }
+ })
+ this.departmentModelFlag = true;
+ }else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
+ },
+ // 部门
+ departmentClickRow(row){
+ this.$refs.departmentTable.toggleRowSelection(row);
+ },
+ // 多选
+ selectionDepartment (val) {
+ this.departmentListSelections = val
+ },
+ getRowKeys(row) {
+ //唯一值,一般都为id
+ return row.deptId;
+ },
+ // 确认多选部门
+ confirmDepartment(){
+ this.searchData.departmentName = ''
+ for (let i = 0; i < this.departmentListSelections.length; i++) {
+ this.searchData.departmentName = this.searchData.departmentName + ";" + this.departmentListSelections[i].deptName
+ }
+ this.searchData.departmentName = this.searchData.departmentName.substring(1)
+ this.departmentModelFlag = false
+ },
+ // 清空搜索框部门
+ clearDepartmentName(){
+ this.searchData.departmentName = ''
+ }
+
}
}
diff --git a/src/views/modules/eam/eamWorkPlanForCheck.vue b/src/views/modules/eam/eamWorkPlanForCheck.vue
index dcab6a7..435ebf4 100644
--- a/src/views/modules/eam/eamWorkPlanForCheck.vue
+++ b/src/views/modules/eam/eamWorkPlanForCheck.vue
@@ -164,6 +164,22 @@
:editable=false>
+
+
+
+
+
+
+
+
+
@@ -188,11 +204,6 @@
选择审核人员
-
-
-
-
-
----------------------------------------------------选择设备----------------------------------------------------
@@ -294,6 +305,22 @@
placeholder="必选">
+
+
+
+
+
+
+
+
+
@@ -310,11 +337,6 @@
选择审核人员
-
-
-
-
-
----------------------------------------------------选择设备----------------------------------------------------
@@ -805,7 +827,8 @@
userId:'',
remark:'',
workOrderRule:'',
- planCycle: ''
+ planCycle: '',
+ taskStartDate: ''
},
objectData:{
site: this.$store.state.user.site,
@@ -884,6 +907,23 @@
status: true,
fixed: '',
},
+ {
+ userId: this.$store.state.user.name,
+ functionId: 101013,
+ serialNumber: '101013TablePlanEndDate',
+ tableId: "101013Table",
+ tableName: "点检计划表",
+ columnProp: 'taskStartDate',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '任务开始时间',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
{
userId: this.$store.state.user.name,
functionId: 101013,
@@ -1496,6 +1536,13 @@
trigger: 'change'
}
],
+ taskStartDateType:[
+ {
+ required: true,
+ message: ' ',
+ trigger: 'change'
+ }
+ ]
},
// 日期限制
pickerOptions: {
@@ -1855,7 +1902,7 @@
this.dataListSelections = val
},
addModal(){
- this.modalData={
+ this.modalData = {
flag: '1',
objectList: [],
functionType: 'A',
@@ -1879,7 +1926,8 @@
updateBy: this.$store.state.user.name,
remark: '',
workOrderRule: '',
- planCycle: '天'
+ planCycle: '天',
+ taskStartDate: ''
};
this.modalDisableFlag = false;
this.objectList = [];
@@ -1910,7 +1958,8 @@
updateBy:this.$store.state.user.name,
remark: row.remark,
workOrderRule: row.workOrderRule,
- planCycle: row.planCycle
+ planCycle: row.planCycle,
+ taskStartDate: row.taskStartDate
};
this.updateObjectList = [];
this.updateDetailData = {}
@@ -2018,6 +2067,12 @@
})
return
}
+ if (this.modalData.taskStartDate === '' || this.modalData.taskStartDate == null) {
+ this.$alert('请选择任务开始时间!', '错误', {
+ confirmButtonText: '确定'
+ })
+ return false
+ }
if(this.modalData.flag === '1'){
if(this.dataListSelections.length === 0){
this.$alert('请勾选设备!', '错误', {
diff --git a/src/views/modules/qc/qcItem.vue b/src/views/modules/qc/qcItem.vue
index 3a299ba..0d63bd2 100644
--- a/src/views/modules/qc/qcItem.vue
+++ b/src/views/modules/qc/qcItem.vue
@@ -2,14 +2,28 @@
-
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
查询
@@ -76,11 +90,11 @@
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
- :fixed="item.fixed==''?false:item.fixed"
+ :fixed="item.fixed === '' ? false : item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
- {{ scope.row[item.columnProp] }}
+ {{scope.row[item.columnProp]}}
@@ -97,13 +111,26 @@
+
+
+
-
+
+
+
+
-
+
@@ -112,25 +139,35 @@
- 检验方法编码
+ 方法编码
-
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -151,6 +188,7 @@
qcItemSave, // 新增项目
qcItemUpdate, // 修改项目
qcItemDelete, // 删除项目
+ InspectionTypeSearch
} from "@/api/qc/qc.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
@@ -186,16 +224,24 @@
exportList:[],
// 导出 end
searchData: {
+ site: this.$store.state.user.site,
itemNo: '',
itemDesc: '',
- itemType: 'D'
+ itemType: 'D',
+ inspectionTypeNo: '',
+ page: 1,
+ limit: 10,
},
+ pageIndex: 1,
+ pageSize: 50,
+ totalPage: 0,
height: 200,
dataList: [],
dataListLoading: false,
modalFlag: false,
modalDisableFlag: false,
modalData: {
+ site: this.$store.state.user.site,
flag: '',
itemNo: '',
itemDesc: '',
@@ -209,6 +255,7 @@
methodNo: '',
methodName: '',
updateBy: '',
+ inspectionTypeNo: ''
},
// 检验项目展示标头
columnList: [
@@ -272,6 +319,18 @@
status: true,
fixed: '',
},
+ {
+ columnProp: 'inspectionTypeNo',
+ headerAlign: 'center',
+ align: "center",
+ columnLabel: '检验类型',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
{
columnProp: 'defaultValue',
headerAlign: 'center',
@@ -386,7 +445,22 @@
trigger: 'change'
}
],
- }
+ inspectionTypeNoType:[
+ {
+ required: true,
+ message: ' ',
+ trigger: 'change'
+ }
+ ],
+ itemNoType:[
+ {
+ required: true,
+ message: ' ',
+ trigger: 'change'
+ }
+ ]
+ },
+ options: [],
}
},
mounted () {
@@ -397,6 +471,7 @@
created () {
this.getDataList()
this.favoriteIsOk()
+ this.InspectionTypeSearch()
},
methods: {
/**
@@ -445,6 +520,25 @@
}
})
},
+ // 每页数
+ sizeChangeHandle (val) {
+ this.pageSize = val
+ this.pageIndex = 1
+ this.getDataList()
+ },
+ // 当前页
+ currentChangeHandle (val) {
+ this.pageIndex = val
+ this.getDataList()
+ },
+ // 查询检验类型
+ InspectionTypeSearch(){
+ InspectionTypeSearch().then(({data}) => {
+ if (data.code === 0) {
+ this.options = data.rows
+ }
+ })
+ },
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 1036) {
@@ -454,13 +548,19 @@
},
// 获取数据列表
getDataList () {
+ this.searchData.limit = this.pageSize
+ this.searchData.page = this.pageIndex
qcItemSearch(this.searchData).then(({data}) => {
- this.dataList = data.rows
+ this.dataList = data.page.list
+ this.pageIndex = data.page.currPage
+ this.pageSize = data.page.pageSize
+ this.totalPage = data.page.totalCount
})
},
addModal () {
this.modalData = {
flag: '1',
+ site: this.$store.state.user.site,
createdBy: this.$store.state.user.name,
itemNo: '',
itemDesc: '',
@@ -473,6 +573,7 @@
methodNo: '',
methodName: '',
updateBy: '',
+ inspectionTypeNo: ''
}
this.modalDisableFlag = false
this.modalFlag = true
@@ -480,6 +581,7 @@
updateModal (row) {
this.modalData = {
flag: '2',
+ site: this.$store.state.user.site,
itemNo: row.itemNo,
itemDesc: row.itemDesc,
valueTypeDb: row.valueTypeDb,
@@ -492,6 +594,7 @@
methodNo: row.methodNo,
methodName: row.methodName,
updateBy: this.$store.state.user.name,
+ inspectionTypeNo: row.inspectionTypeNo
}
this.modalDisableFlag = true
this.modalFlag = true
@@ -504,7 +607,7 @@
type: 'warning'
}).then(() => {
qcItemDelete(row).then(({data}) => {
- if (data && data.code == 0) {
+ if (data && data.code === 0) {
this.getDataList()
this.$message({
message: '操作成功',
@@ -523,27 +626,29 @@
})
},
saveData () {
- if (this.modalData.itemDesc == '' || this.modalData.itemDesc == null) {
- this.$alert('请输入检验项目名称!', '错误', {
- confirmButtonText: '确定'
- })
- return false
+ if (this.modalData.itemNo === '' || this.modalData.itemNo == null) {
+ this.$message.warning('请输入检验项目编码!')
+ return
}
- if (this.modalData.valueTypeDb == '' || this.modalData.valueTypeDb == null) {
- this.$alert('请输入检验值类型!', '错误', {
- confirmButtonText: '确定'
- })
- return false
+ if (this.modalData.itemDesc === '' || this.modalData.itemDesc == null) {
+ this.$message.warning('请输入检验项目名称!')
+ return
}
- if (this.modalData.methodNo == '' || this.modalData.methodNo == null) {
- this.$alert('请选择检验方法!', '错误', {
- confirmButtonText: '确定'
- })
- return false
+ if (this.modalData.valueTypeDb === '' || this.modalData.valueTypeDb == null) {
+ this.$message.warning('请选择检验值类型!')
+ return
+ }
+ if (this.modalData.inspectionTypeNo === '' || this.modalData.inspectionTypeNo == null) {
+ this.$message.warning('请选择检验类型!')
+ return
+ }
+ if (this.modalData.methodNo === '' || this.modalData.methodNo == null) {
+ this.$message.warning('请选择检验方法!')
+ return
}
- if (this.modalData.flag == '1') {
+ if (this.modalData.flag === '1') {
qcItemSave(this.modalData).then(({data}) => {
- if (data && data.code == 0) {
+ if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
@@ -561,7 +666,7 @@
})
} else {
qcItemUpdate(this.modalData).then(({data}) => {
- if (data && data.code == 0) {
+ if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
@@ -588,7 +693,7 @@
}
userFavoriteList(userFavorite).then(({data}) => {
for (let i = 0; i < data.list.length; i++) {
- if(this.$route.meta.menuId==data.list[i].menuId){
+ if(this.$route.meta.menuId == data.list[i].menuId){
this.favorite = true
}
}
diff --git a/src/views/modules/qc/qcMethod.vue b/src/views/modules/qc/qcMethod.vue
index f7881ca..939441c 100644
--- a/src/views/modules/qc/qcMethod.vue
+++ b/src/views/modules/qc/qcMethod.vue
@@ -2,14 +2,28 @@
-
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
查询
@@ -87,14 +101,39 @@
+
+
+
-
+
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
@@ -111,12 +150,10 @@
qcMethodSave, // 检验方法新增
qcMethodUpdate, // 检验方法修改
qcMethodDelete, // 检验方法删除
+ InspectionTypeSearch, // 搜索所有检验类型
} from "@/api/qc/qc.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
export default {
- watch: {
-
- },
data () {
return {
// 是否收藏
@@ -129,9 +166,16 @@
exportList:[],
// 导出 end
searchData: {
+ site: this.$store.state.user.site,
methodNo: '',
methodName: '',
+ inspectionTypeNo: '',
+ page: 1,
+ limit: 10,
},
+ pageIndex: 1,
+ pageSize: 50,
+ totalPage: 0,
height: 200,
dataList: [],
dataListLoading: false,
@@ -144,12 +188,14 @@
createBy: this.$store.state.user.name
},
modalData: {
+ site: this.$store.state.user.site,
flag: '',
methodNo: '',
methodName: '',
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
methodRemark: '',
+ inspectionTypeNo: ''
},
// 标头展示
columnList: [
@@ -189,6 +235,18 @@
status: true,
fixed: '',
},
+ {
+ columnProp: 'inspectionTypeName',
+ headerAlign: 'center',
+ align: "center",
+ columnLabel: '检验类型',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
{
columnProp: 'createDate',
headerAlign: 'center',
@@ -239,14 +297,29 @@
},
],
rules:{
+ methodNoType:[
+ {
+ required: true,
+ message: ' ',
+ trigger: 'change'
+ }
+ ],
methodNameType:[
{
required: true,
message: ' ',
trigger: 'change'
}
+ ],
+ inspectionTypeNoType:[
+ {
+ required: true,
+ message: ' ',
+ trigger: 'change'
+ }
]
- }
+ },
+ options: [],
}
},
mounted () {
@@ -257,6 +330,7 @@
created () {
this.getDataList()
this.favoriteIsOk()
+ this.InspectionTypeSearch()
},
methods: {
/**
@@ -293,22 +367,41 @@
return acc
}, 0)
},
-
// 查询获取数据列表
getDataList () {
+ this.searchData.limit = this.pageSize
+ this.searchData.page = this.pageIndex
qcMethodSearch(this.searchData).then(({data}) => {
- this.dataList = data.rows
+ if (data.code === 0) {
+ this.dataList = data.page.list
+ this.pageIndex = data.page.currPage
+ this.pageSize = data.page.pageSize
+ this.totalPage = data.page.totalCount
+ }
})
},
+ // 每页数
+ sizeChangeHandle (val) {
+ this.pageSize = val
+ this.pageIndex = 1
+ this.getDataList()
+ },
+ // 当前页
+ currentChangeHandle (val) {
+ this.pageIndex = val
+ this.getDataList()
+ },
// 新增按钮
addModal () {
this.modalData = {
flag: '1',
+ site: this.$store.state.user.site,
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
methodNo: '',
methodName: '',
methodRemark: '',
+ inspectionTypeNo: ''
}
this.modalDisableFlag = false
this.modalFlag = true
@@ -317,11 +410,13 @@
updateModal (row) {
this.modalData = {
flag: '2',
+ site: this.$store.state.user.site,
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
methodNo: row.methodNo,
methodName: row.methodName,
methodRemark: row.methodRemark,
+ inspectionTypeNo: row.inspectionTypeNo
}
this.modalDisableFlag = true
this.modalFlag = true
@@ -334,7 +429,7 @@
type: 'warning'
}).then(() => {
qcMethodDelete(row).then(({data}) => {
- if (data && data.code == 0) {
+ if (data && data.code === 0) {
this.getDataList()
this.$message({
message: '操作成功',
@@ -354,15 +449,21 @@
},
// 新增/修改方法
saveData () {
- if (this.modalData.methodName == '' || this.modalData.methodName == null) {
- this.$alert('请输入检验方法名称!', '错误', {
- confirmButtonText: '确定'
- })
- return false
+ if (this.modalData.methodNo === '' || this.modalData.methodNo == null) {
+ this.$message.warning('请输入检验方法编码!')
+ return
+ }
+ if (this.modalData.methodName === '' || this.modalData.methodName == null) {
+ this.$message.warning('请输入检验方法名称!')
+ return
}
- if (this.modalData.flag == '1') { // 新增
+ if(this.modalData.inspectionTypeNo === ''|| this.modalData.inspectionTypeNo == null){
+ this.$message.warning('请选择检验类型!')
+ return
+ }
+ if (this.modalData.flag === '1') { // 新增
qcMethodSave(this.modalData).then(({data}) => {
- if (data && data.code == 0) {
+ if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
@@ -380,7 +481,7 @@
})
} else { // 修改
qcMethodUpdate(this.modalData).then(({data}) => {
- if (data && data.code == 0) {
+ if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
@@ -398,6 +499,14 @@
})
}
},
+ // 查询检验类型
+ InspectionTypeSearch(){
+ InspectionTypeSearch().then(({data}) => {
+ if (data.code === 0) {
+ this.options = data.rows
+ }
+ })
+ },
// 校验用户是否收藏
favoriteIsOk() {
@@ -405,13 +514,10 @@
userId: this.$store.state.user.id,
languageCode: this.$i18n.locale
}
- console.log(this.$route.meta.menuId)
userFavoriteList(userFavorite).then(({data}) => {
for (let i = 0; i < data.list.length; i++) {
- // let flag=false;
- if(this.$route.meta.menuId==data.list[i].menuId){
+ if(this.$route.meta.menuId == data.list[i].menuId){
this.favorite = true
- // flag=true;
}
}
})
@@ -423,17 +529,10 @@
functionId: this.$route.meta.menuId,
}
if (this.favorite) {
- // 取消收藏
- // this.$confirm(`确定取消收藏`, '提示', {
- // confirmButtonText: '确定',
- // cancelButtonText: '取消',
- // type: 'warning'
- // }).then(() => {
- removeUserFavorite(userFavorite).then(({data}) => {
- this.$message.success(data.msg)
- this.favorite = false
- })
- // })
+ removeUserFavorite(userFavorite).then(({data}) => {
+ this.$message.success(data.msg)
+ this.favorite = false
+ })
} else {
// 收藏
saveUserFavorite(userFavorite).then(({data}) => {
@@ -453,7 +552,7 @@
return this.exportList;
},
startDownload() {
- // this.exportData = this.dataList
+
},
finishDownload() {
@@ -471,7 +570,6 @@
let s = eval("(" + json + ")")
return s
},
- // 导出 end
}
}
diff --git a/src/views/modules/qc/qcTemplate.vue b/src/views/modules/qc/qcTemplate.vue
index d77d02e..d2d3984 100644
--- a/src/views/modules/qc/qcTemplate.vue
+++ b/src/views/modules/qc/qcTemplate.vue
@@ -2,9 +2,9 @@
-
-
-
+
+
+
diff --git a/src/views/modules/sys/sceneDynamicControlModel.vue b/src/views/modules/sys/sceneDynamicControlModel.vue
index eba6bae..7187ef4 100644
--- a/src/views/modules/sys/sceneDynamicControlModel.vue
+++ b/src/views/modules/sys/sceneDynamicControlModel.vue
@@ -2,14 +2,14 @@
-
-
-
+
+
+
-
+
-
+
@@ -60,11 +60,11 @@
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
- :fixed="item.fixed==''?false:item.fixed"
+ :fixed="item.fixed === '' ? false : item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
- {{ scope.row[item.columnProp] }}
+ {{scope.row[item.columnProp]}}
@@ -75,15 +75,15 @@
width="160"
label="操作">
- 控制
- 取消控制
+ 控制
+ 取消控制
编辑
-
+
@@ -96,7 +96,11 @@
-
+
+ 参数一:
+
+
+
@@ -113,6 +117,58 @@
关闭
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+
+
+ {{ scope.row[item.columnProp] }}
+
+
+
+
+
+
+ 确认
+ 关闭
+
+
@@ -120,8 +176,9 @@
import {
sysControlModelSearch, // 列表查询
controlData, // 控制
- sysControlModelUpdate // 编辑
+ sysControlModelUpdate, // 编辑
} from "@/api/base.js"
+import {getObjectList} from "@/api/eam/eam.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
export default {
data() {
@@ -158,6 +215,7 @@ export default {
thirdType: '',
secondType: '',
controlStyle: '',
+ parameterTable: ''
},
// 检验项目展示标头
columnList: [
@@ -270,18 +328,103 @@ export default {
fixed: '',
},
],
+ objectList: [],
+ objectModelFlag: false,
+ objectData: {
+ site: this.$store.state.user.site,
+ objectID: '',
+ objectDesc: ''
+ },
+ dataListSelections: [],
+ objectDetailList: [
+ {
+ columnProp: 'objectID',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '设备编码',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ },
+ {
+ columnProp: 'objectDesc',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '设备名称',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ }
+ ],
}
},
created() {
this.getDataList()
},
methods: {
+ // 点击行选中复选框
+ // 机修人员
+ objectClickRow(row){
+ this.$refs.objectTable.toggleRowSelection(row);
+ },
+ // 多选
+ selectionChangeHandle (val) {
+ this.dataListSelections = val
+ },
+ selectFlag(){
+ return true;
+ },
+ // 确认多选设备
+ confirmObject(){
+ if(this.dataListSelections.length === 0){
+ this.$message.warning("请勾选设备!")
+ return
+ }
+ this.modalData.thirdType = ''
+ for (let i = 0; i < this.dataListSelections.length; i++) {
+ this.modalData.thirdType = this.modalData.thirdType + ";" + this.dataListSelections[i].objectID
+ }
+ this.modalData.thirdType = this.modalData.thirdType.substring(1)
+ this.objectModelFlag = false
+ },
+
// 获取数据列表
getDataList () {
sysControlModelSearch(this.searchData).then(({data}) => {
this.dataList = data.rows
})
},
+
+ // 获取设备列表
+ getObjectList(){
+ // 先清空缓存选中
+ this.$nextTick(() => this.$refs.objectTable.clearSelection())
+ // 拿到选中的设备编号
+ let tempDataList = this.modalData.thirdType.split(';')
+ // 查询所有设备
+ getObjectList(this.objectData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.objectList = data.rows
+ this.objectList.forEach(val => {
+ // 回显选中的设备
+ if (tempDataList.includes(val.objectID)) {
+ this.$nextTick(() => this.$refs.objectTable.toggleRowSelection(val, true))
+ }
+ })
+ this.objectModelFlag = true;
+ }else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
+ },
// 控制
control(row){
this.modalData = {
@@ -296,9 +439,10 @@ export default {
thirdType: row.thirdType,
secondType: row.secondType,
controlStyle: row.controlStyle,
+ parameterTable: row.parameterTable
}
controlData(this.modalData).then(({data}) => {
- if (data && data.code == 0) {
+ if (data && data.code === 0) {
this.getDataList()
this.$message({
message: '操作成功',
@@ -328,13 +472,14 @@ export default {
thirdType: row.thirdType,
secondType: row.secondType,
controlStyle: row.controlStyle,
+ parameterTable: row.parameterTable
};
this.modalDisableFlag = true;
this.modalFlag = true;
},
// 保存编辑
saveData(){
- if (this.modalData.controlStyle == '' || this.modalData.controlStyle == null) {
+ if (this.modalData.controlStyle === '' || this.modalData.controlStyle == null) {
this.$alert('请选择控制方式!', '错误', {
confirmButtonText: '确定'
})
@@ -380,17 +525,10 @@ export default {
functionId: this.$route.meta.menuId,
}
if (this.favorite) {
- // 取消收藏
- // this.$confirm(`确定取消收藏`, '提示', {
- // confirmButtonText: '确定',
- // cancelButtonText: '取消',
- // type: 'warning'
- // }).then(() => {
- removeUserFavorite(userFavorite).then(({data}) => {
- this.$message.success(data.msg)
- this.favorite = false
- })
- // })
+ removeUserFavorite(userFavorite).then(({data}) => {
+ this.$message.success(data.msg)
+ this.favorite = false
+ })
} else {
// 收藏
saveUserFavorite(userFavorite).then(({data}) => {