diff --git a/api/safe.js b/api/safe.js new file mode 100644 index 0000000..5ecd34b --- /dev/null +++ b/api/safe.js @@ -0,0 +1,55 @@ +import http from '@/http/api.js' +// 安全点检-根据设备编码查询点检项@param {string} code 设备编码 +const getSpotCheckByCode = (code) => { + return http.request({ + url: `/blade-desk/pdaLoad/getSpotCheckByEcCode/${code}`, + method: 'GET' + }) +} +// 安全点检-提交点检数据 @param {object} data 提交参数 { sscList: [...] } +const saveSpotCheck = (data) => { + return http.request({ + url: '/blade-desk/pdaSave/saveBySpotCheck', + method: 'POST', + data + }) +} +// 安全巡检-根据编码查询巡检点 @param {String} code 巡检点编码 +const getInspectionByCode = (code) => { + return http.request({ + url: `/blade-desk/pdaLoad/getInspectionByEcCode/${code}`, + method: 'GET' + }) +} +// 安全巡检-提交巡检数据 @param {object} data 提交参数 { icList: [...] } +const saveInspection = (data) => { + return http.request({ + url: '/blade-desk/pdaSave/saveByInspection', + method: 'POST', + data + }) +} +// 设备报修-根据设备编码查询设备信息@param {string} deviceCode 设备编码 +const getEcByDeviceCode = (deviceCode) => { + return http.request({ + url: '/blade-desk/pdaLoad/getEcByDeviceCode', + method: 'POST', + data: { deviceCode } + }) +} +// 设备报修-提交设备报修 @param {object} data 报修数据 +const saveEqRepair = (data) => { + return http.request({ + url: '/blade-desk/pdaSave/saveEqRepair', + method: 'POST', + data + }) +} +export default { + getInspectionByCode, + saveInspection, + getSpotCheckByCode, + saveSpotCheck, + getEcByDeviceCode, + saveEqRepair +} \ No newline at end of file diff --git a/api/sanitation.js b/api/sanitation.js new file mode 100644 index 0000000..2af5ae7 --- /dev/null +++ b/api/sanitation.js @@ -0,0 +1,38 @@ +import http from '@/http/api.js' +// 废水/废气巡检-根据巡检点编码查询任务 +const getInspectionBySan = (params) => { + return http.request({ + url: '/blade-desk/pdaLoad/getInspectionBySan', + method: 'POST', + data: params + }) +} +// 废水/废气巡检-提交巡检结果 +const savePatrolIns = (data) => { + return http.request({ + url: '/blade-desk/pdaSave/savePatrolIns', + method: 'POST', + data + }) +} +// 酸雾塔加药接口-根据设备编码查询加药记录 @param {string} code 设备编码 +const epDosingRecByCode = (code) => { + return http.request({ + url: `/blade-desk/pdaLoad/epDosingRecByCode/${code}`, + method: 'GET' + }) +} +// 酸雾塔加药接口-提交加药记录 @param {object} data 加药数据 +const saveEpDosingRec = (data) => { + return http.request({ + url: '/blade-desk/pdaSave/saveEpDosingRec', + method: 'POST', + data + }) +} +export default { + getInspectionBySan, + savePatrolIns, + epDosingRecByCode, + saveEpDosingRec +} \ No newline at end of file diff --git a/pages/index/menu.js b/pages/index/menu.js index 6239177..7f69e61 100644 --- a/pages/index/menu.js +++ b/pages/index/menu.js @@ -220,71 +220,71 @@ const menus = { ], }, - // { - // title: '安环管理', - // children: [ - // { - // key: "spotCheck", - // title: "安全点检", - // url: "../safe/spotCheck", - // bgColor: '', - // limit: 'RB2315', - // icon: { - // size: 20, - // color: '#00b7ee', - // type: '' - // } - // }, - // { - // key: "inspection", - // title: "安全巡检", - // url: "../safe/inspection", - // bgColor: '', - // limit: 'RB2316', - // icon: { - // size: 20, - // color: '#00b7ee', - // type: '' - // } - // }, - // { - // key: "waterInspection", - // title: "废水巡检", - // url: "../sanitation/waterInspection", - // bgColor: '', - // limit: 'RB2318', - // icon: { - // size: 20, - // color: '#00b7ee', - // type: '' - // } - // }, - // { - // key: "gasInspection", - // title: "废气巡检", - // url: "../sanitation/gasInspection", - // bgColor: '', - // limit: 'RB2319', - // icon: { - // size: 20, - // color: '#00b7ee', - // type: '' - // } - // }, - // { - // key: "bsTower", - // title: "酸雾塔", - // url: "../sanitation/bsTower", - // bgColor: '', - // limit: 'RB2319', - // icon: { - // size: 20, - // color: '#00b7ee', - // type: '' - // } - // }, - // ] - // }, + { + title: '安环管理', + children: [ + // { + // key: "spotCheck", + // title: "安全点检", + // url: "../safe/spotCheck", + // bgColor: '', + // limit: 'RB2315', + // icon: { + // size: 20, + // color: '#00b7ee', + // type: '' + // } + // }, + { + key: "inspection", + title: "安全巡检", + url: "../safe/inspection", + bgColor: '', + limit: 'RB2316', + icon: { + size: 20, + color: '#00b7ee', + type: '' + } + }, + { + key: "waterInspection", + title: "废水巡检", + url: "../sanitation/waterInspection", + bgColor: '', + limit: 'RB2318', + icon: { + size: 20, + color: '#00b7ee', + type: '' + } + }, + { + key: "gasInspection", + title: "废气巡检", + url: "../sanitation/gasInspection", + bgColor: '', + limit: 'RB2319', + icon: { + size: 20, + color: '#00b7ee', + type: '' + } + }, + { + key: "bsTower", + title: "酸雾塔", + url: "../sanitation/bsTower", + bgColor: '', + limit: 'RB2319', + icon: { + size: 20, + color: '#00b7ee', + type: '' + } + }, + ] + }, { title: '物流配送', children: [ diff --git a/pages/plan/workReport.vue b/pages/plan/workReport.vue index 070e81c..579eb10 100644 --- a/pages/plan/workReport.vue +++ b/pages/plan/workReport.vue @@ -271,6 +271,33 @@ export default { twoInputFcous: true, }; }, + // 新增 watch 监听 + watch: { + // 监听报废数量的变化 + 'formData.scrapQty'(newVal) { + // 确保有总数量数据,且报废数量是有效数字 + if (this.tableObj.notWorkQty !== undefined && this.tableObj.notWorkQty !== null) { + const totalQty = Number(this.tableObj.notWorkQty); + const scrap = Number(newVal); + + // 如果报废数量是有效数字 + if (!isNaN(scrap)) { + // 计算剩余可合格数量:总数量 - 报废数量 + let remainingQty = totalQty - scrap; + + // 防止出现负数,最小为0 + if (remainingQty < 0) { + remainingQty = 0; + // 可选:如果报废超过总数,可以提示用户或强制修正报废数量 + // uni.showToast({ title: '报废数量不能超过总数量', icon: 'none' }); + } + + // 更新合格数量 + this.formData.workQty = remainingQty; + } + } + } + }, methods: {}, onNavigationBarButtonTap(btn) { this.$refs.ifrm.topMenuClick(btn); diff --git a/pages/safe/inspection.vue b/pages/safe/inspection.vue index a91e223..9b68716 100644 --- a/pages/safe/inspection.vue +++ b/pages/safe/inspection.vue @@ -1,231 +1,243 @@ \ No newline at end of file diff --git a/pages/safe/spotCheck.vue b/pages/safe/spotCheck.vue index 7a64749..af2724d 100644 --- a/pages/safe/spotCheck.vue +++ b/pages/safe/spotCheck.vue @@ -1,120 +1,137 @@