diff --git a/src/api/dev/deviceCheckDetailApi.js b/src/api/dev/deviceCheckDetailApi.js index 04cea3a3..64ca6554 100644 --- a/src/api/dev/deviceCheckDetailApi.js +++ b/src/api/dev/deviceCheckDetailApi.js @@ -19,3 +19,12 @@ export function deviceCheckDetailRepair(query) { ) } +export function deviceCheckDetailFinish(query) { + return axios( + { + url: `/udi/device/check/detail/finish`, + method: "POST", + data: query + } + ) +} diff --git a/src/views/dev/deptDeviceCheck.vue b/src/views/dev/deptDeviceCheck.vue index f0cefae0..aeb7698e 100644 --- a/src/views/dev/deptDeviceCheck.vue +++ b/src/views/dev/deptDeviceCheck.vue @@ -29,7 +29,7 @@ - + @@ -46,9 +46,9 @@ - - - + + + @@ -75,7 +75,7 @@ - + 查询 @@ -96,9 +96,9 @@ - - - + + + @@ -112,20 +112,26 @@ - + - + @@ -139,6 +145,7 @@ /> + - - + + + + - diff --git a/src/views/dev/js/deptDeviceCheck.js b/src/views/dev/js/deptDeviceCheck.js deleted file mode 100644 index 70813c8a..00000000 --- a/src/views/dev/js/deptDeviceCheck.js +++ /dev/null @@ -1,220 +0,0 @@ -import {detailByUserPage, deviceLogs, devicePage} from "@/api/dev/deviceInfoApi"; -import {deviceChangeStatus, deviceChangeType, deviceStatus} from "@/utils/enum"; -import { - deviceCheckPage, - deviceCheckPageByDept, - deviceCheckPrint, - deviceCheckPrintByDeviceCode -} from "@/api/dev/deviceCheckApi"; -import {deviceCheckDetailPage, deviceCheckDetailRepair} from "@/api/dev/deviceCheckDetailApi"; -import {deviceCheckDetailItemFinish, deviceCheckDetailItemPage} from "@/api/dev/deviceCheckDetailItemApi"; -import {copyProperties, getLoading} from "@/utils"; - -let query = { - page: 1, - limit: 10, - chargeDeptCode: null, - finishFlag: null, -} - -let detailQuery = { - page: 1, - limit: 10, - taskId: null, - deviceCode:null, -} - -let itemQuery = { - page: 1, - limit: 10, - taskId: null, - deviceCode: null, -} -let repairData = { - taskId: null, - deviceCode: null, - description: null, - diagnosisInfo: null, - innerFlag: true, - repairUserName: null, - repairUserPhone: null, -} - -export default { - name: "deptDeviceCheck", - computed: {}, - data() { - return { - clickRow: null, - showSearch: true, - loading: false, - total: .0, - list: [], - query: {...query}, - //设备详情============================================= - detailLoading: false, - detailQuery: {...detailQuery}, - detailList: [], - detailTotal: 0, - showLog: false, - //=================================================== - itemDialogFlag: false, - itemQuery: {...itemQuery}, - itemList: [], - itemTotal: 0, - itemLoading: false, - checkPrintData: null, - itemRow: null, - itemRules: { - normalFlag: [{required: true, message: "请选择异常情况", trigger: ["change", "blur"]}], - suggestion: [{required: true, message: "巡检意见不能为空", trigger: ["change", "blur"]}], - }, - repairRow: null, - repairRules: { - innerFlag: [{ - required: true, - message: "请选择维修方式", - trigger: ["change", "blur"] - }], - repairUserName: [{ - required: true, - message: "维修人姓名不能为空", - trigger: ["change", "blur"] - }], - repairUserPhone: [{ - required: true, - message: "维修人电话不能为空", - trigger: ["change", "blur"] - }], - description: [{required: true, message: "问题描述不能为空", trigger: ["change", "blur"]}], - diagnosisInfo: [{required: true, message: "诊断信息不能为空", trigger: ["change", "blur"]}], - }, - repairId:null, - } - }, - created() { - this.getList() - }, - methods: { - commitRepair(){ - this.$refs.repairForm.validate(b => { - if (!b) { - return - } - let load = getLoading(this) - deviceCheckDetailRepair(this.repairRow).then(res => { - load.close() - if (res.code != 20000) { - this.$message.error(res.message) - return - } - this.$message.success(res.message) - this.getDetailList() - this.getList() - this.repairRow = null - }).catch(() => { - load.close() - }) - }) - }, - createRepair(row) { - let data = copyProperties(row, {...repairData}); - this.repairRow = _.extend({}, row, data) - }, - commitItemCheck() { - this.$refs.itemForm.validate(b => { - if (!b) { - return - } - let load = getLoading(this) - deviceCheckDetailItemFinish(this.itemRow).then(res => { - load.close() - if (res.code != 20000) { - this.$message.error(res.message) - return - } - this.$message.success(res.message) - this.getDetailItemList() - this.getDetailList() - this.getList() - this.itemRow = null - }).catch(() => { - load.close() - }) - }) - }, - openItem(row) { - this.itemQuery = { - ...itemQuery, - taskId: row.taskId, - deviceCode: row.deviceCode, - title: `[${row.deviceCode}]--${row.productName}(${row.nameCode})` - } - this.itemDialogFlag = true - this.getDetailItemList() - }, - getDetailItemList() { - this.itemLoading = true - deviceCheckDetailItemPage(this.itemQuery).then(res => { - this.itemLoading = false - if (res.code != 20000) { - this.$message.error(res.message) - return - } - this.itemList = res.data.list || [] - this.itemTotal = res.data.total || 0 - }).catch(e => { - this.itemLoading = false - this.itemList = [] - this.itemTotal = 0 - }) - }, - rowClick(row) { - if (this.clickRow && row.taskId == this.clickRow.taskId) { - return false - } - this.clickRow = row - this.detailQuery = {...detailQuery, taskId: row.taskId} - this.getDetailList() - }, - getDetailList() { - this.detailLoading = true - deviceCheckDetailPage(this.detailQuery).then(res => { - this.detailLoading = false - if (res.code != 20000) { - this.$message.error(res.message) - return - } - this.detailList = res.data.list || [] - this.detailTotal = res.data.total || 0 - }).catch(e => { - this.detailLoading = false - }) - }, - search() { - this.query.page = 1 - this.getList() - }, - onReset() { - this.query = {...query} - this.getList() - }, - getList() { - this.loading = true - deviceCheckPageByDept(this.query).then(res => { - this.loading = false - if (res.code != 20000) { - this.$message.error(res.message) - return - } - this.list = res.data.list || [] - this.total = res.data.total || 0 - - }).catch(e => { - this.list = [] - this.total = 0 - this.loading = false - }) - } - } -}