Commit e5d040b7 by liimin

合并

1 parent 1a6e057e
......@@ -96,7 +96,7 @@
import { isExistApi } from '@api/deviceManagement'
export default {
name: 'EditDialog',
data () {
data() {
return {
deviceNum: '',
deviceCode: '',
......@@ -142,31 +142,31 @@ export default {
},
watch: {
isVisible (val) {
isVisible(val) {
val && (this.deviceNum = this.editForm.deviceNum)
val && (this.deviceName = this.editForm.deviceName)
this.$refs.editRuleForm && this.$refs.editRuleForm.resetFields()
}
},
mounted () {},
mounted() {},
methods: {
async isCodeExist (rule, value, callback) {
async isCodeExist(rule, value, callback) {
if (this.deviceNum !== value || this.deviceName !== this.editForm.deviceName) {
const res = await isExistApi({ deviceNum: value, deviceName: this.editForm.deviceName, stationCode: this.editForm.stationCode })
res.deviceNum ? callback(new Error(rule.message)) : callback()
}
},
validateCode (value) {
validateCode(value) {
this.$refs.editRuleForm.validateField('deviceNum')
},
handleClose () {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm () {
handleConfirm() {
this.$refs.editRuleForm.validate((vaild) => {
if (vaild) {
this.$emit('confirmDialog')
......
......@@ -109,7 +109,7 @@ export default {
components: {
EditDialog
},
data () {
data() {
return {
// 编辑弹窗
editVisible: false,
......@@ -173,23 +173,23 @@ export default {
}
},
mounted () {
mounted() {
this.loadingGetList()
this.loadBaseData()
},
methods: {
async loadBaseData () {
async loadBaseData() {
const data = await this.$store.dispatch('d2admin/base/get', BaseData.STATION.KEY)
this.baseData.station = data
},
loadingGetList () {
loadingGetList() {
this.tableLoading = true
this.getList()
},
/* 接口请求-start */
getParams () {
getParams() {
return {
pageCount: this.pageSize,
pageSize: this.currentPage,
......@@ -197,7 +197,7 @@ export default {
}
},
getList () {
getList() {
const params = this.getParams()
getListApi(params).then(res => {
this.tableData = res.deviceList
......@@ -209,12 +209,12 @@ export default {
})
},
delObjMutiAttr (obj, keys) {
delObjMutiAttr(obj, keys) {
keys.map(key => delete obj[key])
return obj
},
editDevice (params) {
editDevice(params) {
params = this.delObjMutiAttr(params, ['createTime', 'keyWord', 'pageCount', 'pageSize', 'updateTime', 'stationName', 'stationCode'])
// console.log(params)
editApi(params).then(res => {
......@@ -227,7 +227,7 @@ export default {
},
// 导入
importFile (e) {
importFile(e) {
const name = e.target.files[0].name
this.fileInfo.fileType = name.split('.')[1]
// // 转码base64
......@@ -272,7 +272,7 @@ export default {
}
},
exportFile () {
exportFile() {
const params = this.getParams()
exportApi(params).then(res => {
this.$open(res.url)
......@@ -283,40 +283,40 @@ export default {
},
/* 接口请求-end */
// 搜索
handleSearch () {
handleSearch() {
this.loadingGetList()
},
// 页码
handleSizeChange (value) {
handleSizeChange(value) {
this.pageSize = value
// 调接口
this.loadingGetList()
},
handleCurrentChange (value) {
handleCurrentChange(value) {
this.currentPage = value
// 调接口
this.loadingGetList()
},
handleEditClose () {
handleEditClose() {
this.editVisible = !this.editVisible
},
handleEditConfirm () {
handleEditConfirm() {
var editParams = _.cloneDeep(this.editForm)
this.editDevice(editParams)
},
// 表格-编辑
handleEdit (row) {
handleEdit(row) {
// console.log(row)
this.editForm = _.cloneDeep(row)
this.editVisible = !this.editVisible
},
handleDelete (row) {
handleDelete(row) {
this.$confirm('确认删除?', '删除', {
comfirmButtonText: '确认',
cancelButtonText: '取消',
......
......@@ -115,7 +115,7 @@ import { mapActions } from 'vuex'
import notice from '@/common/notice'
export default {
name: 'fimsMaintainManagement',
data () {
data() {
return {
// 搜索
searchForm: {
......@@ -299,12 +299,12 @@ export default {
},
watch: {
'searchForm.createTime' (value) {
'searchForm.createTime'(value) {
!value && this.loadingGetList()
}
},
mounted () {
mounted() {
this.loadingGetList()
this.loadBaseData()
},
......@@ -312,7 +312,7 @@ export default {
methods: {
...mapActions('d2admin/base', ['load']),
async loadBaseData () {
async loadBaseData() {
const modelToOptions = { 'stationCode': 'station', 'subsystemTypeCode': 'subsys' }
const data = await this.load()
if (data) {
......@@ -323,22 +323,22 @@ export default {
}
},
loadingGetList () {
loadingGetList() {
this.tableLoading = true
this.getList()
},
/* 接口请求-start */
getParams () {
var time = [{attr: 'startTime', addTime: '00:00:00'}, {attr: 'endTime', addTime: '23:59:59'}]
this.searchForm.createTime && this.searchForm.createTime.map((value, i) => this.searchForm[time[i].attr] = value + ' ' + time[i].addTime)
getParams() {
var time = [{ attr: 'startTime', addTime: '00:00:00' }, { attr: 'endTime', addTime: '23:59:59' }]
this.searchForm.createTime && this.searchForm.createTime.map((value, i) => (this.searchForm[time[i].attr] = value + ' ' + time[i].addTime))
return {
pageCount: this.pageSize,
pageSize: this.currentPage,
...this.searchForm
}
},
getList () {
getList() {
const params = this.getParams()
delete params.createTime
// console.log(params)
......@@ -351,7 +351,7 @@ export default {
this.tableLoading = false
})
},
exportOrder () {
exportOrder() {
const params = this.getParams()
delete params.createTime
exportApi(params).then(res => {
......@@ -363,24 +363,24 @@ export default {
},
/* 接口请求-end */
// 搜索
handleSearch () {
handleSearch() {
this.loadingGetList()
},
// 页码
handleSizeChange (value) {
handleSizeChange(value) {
this.pageSize = value
// 调接口
this.loadingGetList()
},
handleCurrentChange (value) {
handleCurrentChange(value) {
this.currentPage = value
// 调接口
this.loadingGetList()
},
handleDelete (row) {
handleDelete(row) {
this.$confirm('确认删除?', '删除', {
comfirmButtonText: '确认',
cancelButtonText: '取消',
......
......@@ -15,7 +15,7 @@
<script>
export default {
name: 'DetailDialog',
data () {
data() {
return {
}
},
......@@ -29,10 +29,10 @@ export default {
pdfUrl: String
},
mounted () {},
mounted() {},
methods: {
handleClose () {
handleClose() {
this.$emit('closeDialog')
}
}
......
......@@ -121,7 +121,7 @@ export default {
components: {
DetailDialog
},
data () {
data() {
return {
detailVisible: false,
dialogTitle: '',
......@@ -189,23 +189,23 @@ export default {
},
watch: {
'searchForm.createTime' (value) {
'searchForm.createTime'(value) {
!value && this.loadingGetList()
}
},
mounted () {
mounted() {
this.loadingGetList()
},
methods: {
loadingGetList () {
loadingGetList() {
this.tableLoading = true
this.getList()
},
/* 接口请求-start */
getParams () {
var time = [{attr: 'startTime', addTime: '00:00:00'}, {attr: 'endTime', addTime: '23:59:59'}]
getParams() {
var time = [{ attr: 'startTime', addTime: '00:00:00' }, { attr: 'endTime', addTime: '23:59:59' }]
this.searchForm.createTime && this.searchForm.createTime.map((value, i) => this.searchForm[time[i].attr] = value + ' ' + time[i].addTime)
return {
pageCount: this.pageSize,
......@@ -213,7 +213,7 @@ export default {
...this.searchForm
}
},
getList () {
getList() {
const params = this.getParams()
!params.orderCode && delete params.orderCode
delete params.createTime
......@@ -228,7 +228,7 @@ export default {
})
},
exportFile () {
exportFile() {
const params = this.getParams()
!params.orderCode && delete params.orderCode
delete params.createTime
......@@ -241,29 +241,29 @@ export default {
},
/* 接口请求-end */
// 搜索
handleSearch () {
handleSearch() {
this.loadingGetList()
},
// 页码
handleSizeChange (value) {
handleSizeChange(value) {
this.pageSize = value
// 调接口
this.loadingGetList()
},
handleCurrentChange (value) {
handleCurrentChange(value) {
this.currentPage = value
// 调接口
this.loadingGetList()
},
handleDetailClose () {
handleDetailClose() {
this.detailVisible = !this.detailVisible
},
// 表格-查看详情
handleDetail (row) {
handleDetail(row) {
downloadApi({
orderCode: row.orderCode
}).then(res => {
......@@ -275,7 +275,7 @@ export default {
})
},
handleDelete (row) {
handleDelete(row) {
this.$confirm('确认删除?', '删除', {
comfirmButtonText: '确认',
cancelButtonText: '取消',
......
......@@ -123,7 +123,7 @@ export default {
components: {
EditDialog
},
data () {
data() {
return {
// 远程搜索-返回数组
// remoteOptionArr: {
......@@ -200,13 +200,13 @@ export default {
}
},
mounted () {
mounted() {
this.loadingGetList()
this.loadBaseData()
},
methods: {
async loadBaseData () {
async loadBaseData() {
const data = await this.$store.dispatch('d2admin/base/get', BaseData.SUBSYS.KEY)
this.baseData.subsys = data
},
......@@ -222,12 +222,12 @@ export default {
// this.loadingGetList()
// },
loadingGetList () {
loadingGetList() {
this.tableLoading = true
this.getList()
},
/* 接口请求-start */
getParams () {
getParams() {
return {
pageCount: this.pageSize,
pageSize: this.currentPage,
......@@ -244,7 +244,7 @@ export default {
// })
// },
getList () {
getList() {
const params = this.getParams()
getListApi(params).then(res => {
this.tableData = res.subsystemList
......@@ -256,10 +256,10 @@ export default {
})
},
editSubSystem (value) {
editSubSystem(value) {
// console.log(value)
const params = _.cloneDeep(this.editFormReset)
Object.keys(params).map(key => params[key] = value[key])
Object.keys(params).map(key => (params[key] = value[key]))
params.subsystemType = this.baseData.subsys.find(item => item.confCode === params.subsystemTypeCode).confValue
if (!value.id) {
delete params.id
......@@ -279,39 +279,39 @@ export default {
},
/* 接口请求-end */
// 搜索
handleSearch () {
handleSearch() {
this.loadingGetList()
},
// 页码
handleSizeChange (value) {
handleSizeChange(value) {
this.pageSize = value
// 调接口
this.loadingGetList()
},
handleCurrentChange (value) {
handleCurrentChange(value) {
this.currentPage = value
// 调接口
this.loadingGetList()
},
handleEditClose () {
handleEditClose() {
this.editVisible = !this.editVisible
},
handleEditConfirm () {
handleEditConfirm() {
var editParams = JSON.parse(JSON.stringify(this.editForm))
this.editSubSystem(editParams)
},
// 表格-编辑
handleEdit (row) {
handleEdit(row) {
this.editForm = JSON.parse(JSON.stringify(row))
this.editVisible = !this.editVisible
},
handleDelete (row) {
handleDelete(row) {
this.$confirm('确认删除?', '删除', {
comfirmButtonText: '确认',
cancelButtonText: '取消',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!