PDA-安环管理-酸雾塔-页面对接

test
ysn 5 days ago
parent 9ea88ab0fe
commit 5af91a028a
  1. 55
      api/safe.js
  2. 38
      api/sanitation.js
  3. 438
      pages/sanitation/bsTower.vue

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

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

@ -1,34 +1,38 @@
<template> <template>
<ifrm ref="ifrm"> <ifrm ref="ifrm">
<!-- 酸雾塔--> <!-- 酸雾塔-->
<uni-forms ref="form" err-show-type="toast"> <uni-forms ref="form" err-show-type="toast">
<uni-forms-item><input type="text" v-model="epDosingRecCode" @confirm="epDosingRecConfirm" <uni-forms-item>
class="uni-input-border" placeholder="编码" /></uni-forms-item> <input type="text" v-model="code" @confirm="epDosingRecConfirm" class="uni-input-border"
</uni-forms> placeholder="编码" />
<t-table> </uni-forms-item>
<t-tr> </uni-forms>
<t-td>编码</t-td> <t-table>
<t-td>{{ epDosingRec.bsTower.btCode }}</t-td> <t-tr>
</t-tr> <t-td>编码</t-td>
<t-tr> <t-td>{{ epDosingRec.btCode }}</t-td>
<t-td>名称</t-td> </t-tr>
<t-td>{{ epDosingRec.device }}</t-td> <t-tr>
</t-tr> <t-td>名称</t-td>
<t-tr> <t-td>{{ epDosingRec.device }}</t-td>
<t-td>药品名称</t-td> </t-tr>
<t-td>{{ epDosingRec.drug }}</t-td> <t-tr>
</t-tr> <t-td>药品名称</t-td>
<t-tr> <t-td>{{ epDosingRec.drug }}</t-td>
<t-td>剂量</t-td> </t-tr>
<t-td><input type="number" v-model="epDosingRec.dose"></t-td> <t-tr>
</t-tr> <t-td>剂量</t-td>
</t-table> <t-td><input type="number" v-model="epDosingRec.dose" /></t-td>
<view style="font-size: 36rpx;">备注</view> </t-tr>
<uni-forms ref="form" err-show-type="toast"> </t-table>
<uni-forms-item><uni-easyinput type="textarea" autoHeight v-model="epDosingRec.memo" <view style="font-size: 36rpx">备注</view>
placeholder="请输入内容"></uni-easyinput></uni-forms-item> <uni-forms ref="form" err-show-type="toast">
</uni-forms> <uni-forms-item>
<!-- <view class="photoTitleSize">{{uploader.length}}/9</view> <uni-easyinput type="textarea" autoHeight v-model="epDosingRec.memo" placeholder="请输入备注">
</uni-easyinput>
</uni-forms-item>
</uni-forms>
<!-- <view class="photoTitleSize">{{uploader.length}}/9</view>
<view class="showImage"> <view class="showImage">
<view v-for="(item, i) in uploader" :key="i" class="showImage-for"> <view v-for="(item, i) in uploader" :key="i" class="showImage-for">
<view class="view-image"> <view class="view-image">
@ -42,209 +46,203 @@
<image src="../../static/images/photo.png" @click="chooseImage()"></image> <image src="../../static/images/photo.png" @click="chooseImage()"></image>
</view> </view>
</view> --> </view> -->
<!-- :disabled="!(Object.keys(epDosingRec).length > 2)" --> <!-- :disabled="!(Object.keys(epDosingRec).length > 2)" -->
<view class="buttonBox"><button class="button" :disabled="!(Object.keys(this.epDosingRec.bsTower).length > 0)" <view class="buttonBox">
type="primary" @click="submitClick">提交</button></view> <button class="button" :disabled="!(Object.keys(this.epDosingRec).length > 0)" type="primary"
</ifrm> @click="submitClick">
提交
</button>
</view>
</ifrm>
</template> </template>
<script> <script>
import ifrm from '@/pages/index/ifrm'; import ifrm from "@/pages/index/ifrm";
import tTable from '@/components/t-table/t-table.vue'; import tTable from "@/components/t-table/t-table.vue";
import tTh from '@/components/t-table/t-th.vue'; import tTh from "@/components/t-table/t-th.vue";
import tTr from '@/components/t-table/t-tr.vue'; import tTr from "@/components/t-table/t-tr.vue";
import tTd from '@/components/t-table/t-td.vue'; import tTd from "@/components/t-table/t-td.vue";
import scan from '../../mixin/scan.js'; import scan from "../../mixin/scan.js";
export default { export default {
mixins: [scan], mixins: [scan],
components: { components: {
ifrm, ifrm,
tTable, tTable,
tTh, tTh,
tTr, tTr,
tTd tTd,
}, },
data() { data() {
return { return {
epDosingRecCode: '', code: "",
epDosingRec: { epDosingRec: {},
bsTower: {} uploader: [],
}, };
uploader: [] },
}; methods: {
}, chooseImage: async function() {
methods: { if (!this.epDosingRec.dorId) {
return uni.showToast({
title: "请先查询巡检点",
icon: "none",
});
}
uni.chooseImage({
// sourceType: ['album','camera'], //album camera 使
// sizeType: ['original', 'compressed'], //
count: 9,
success: (res) => {
uni.showLoading({
title: "上传中,请稍候",
});
var tempFilePaths = res.tempFilePaths;
for (var i = 0; i < tempFilePaths.length; i++) {
const file = res.tempFiles[i];
this.$uploadUtil
.upload(
file, {
theId: this.epDosingRec.dorId,
theTag: "EpDosingRec",
subTag: "appDoc",
},
tempFilePaths[i]
)
.then((upId) => {
uni.hideLoading();
//
this.uploader.push({
upId: upId,
imageUrl: file.path,
});
});
}
},
complete() {
uni.hideLoading();
},
});
},
previewImage: function(index) {
var imags = [];
this.uploader.forEach((item) => {
imags.push(item.imageUrl);
});
uni.previewImage({
current: index,
urls: imags,
});
},
chooseImage: async function() { removeScene(item, i) {
if (!this.epDosingRec.dorId) { //
return uni.showToast({ this.uploader.splice(i, 1);
title: '请先查询巡检点', // //
icon: 'none' this.$uploadUtil.asyncDelete(item.upId).then((data) => {
}); uni.showToast({
} title: "删除成功",
uni.chooseImage({ icon: "none",
// sourceType: ['album','camera'], //album camera 使 });
// sizeType: ['original', 'compressed'], // });
count: 9, // this.upIdList.splice(this.upIdList.findIndex((upId) => (upId === item.upId)), 1);
success: (res) => { },
uni.showLoading({
title: '上传中,请稍候'
});
var tempFilePaths = res.tempFilePaths;
for (var i = 0; i < tempFilePaths.length; i++) {
const file = res.tempFiles[i];
this.$uploadUtil.upload(file, {
theId: this.epDosingRec.dorId,
theTag: 'EpDosingRec',
subTag: 'appDoc'
}, tempFilePaths[i]).then((upId) => {
uni.hideLoading();
//
this.uploader.push({
upId: upId,
imageUrl: file.path
});
})
} getBarCode(code) {
}, this.getData(code);
complete() { },
uni.hideLoading(); epDosingRecConfirm(e) {
} this.getBarCode(e.target.value);
}) },
}, getData(code) {
previewImage: function(index) { this.epDosingRecValue = code;
var imags = []; this.$u.api.epDosingRecByCode(code).then((res) => {
this.uploader.forEach(item => { if (res.data == null) {
imags.push(item.imageUrl); return uni.showToast({
}) icon: "none",
uni.previewImage({ title: "此酸雾塔置暂无任务",
current: index, });
urls: imags }
}) this.epDosingRecValue = "";
}, this.epDosingRec = res.data;
uni.showToast({
removeScene(item, i) { title: "数据获取成功",
// });
this.uploader.splice(i, 1); });
// // },
this.$uploadUtil.asyncDelete(item.upId).then((data) => { submitClick() {
uni.showToast({ this.$u.api.saveEpDosingRec(this.epDosingRec).then((data) => {
title: '删除成功', uni.showToast({
icon: 'none' title: "保存成功",
}); });
}) this.epDosingRecValue = "";
// this.upIdList.splice(this.upIdList.findIndex((upId) => (upId === item.upId)), 1); this.epDosingRec = {
}, dose: null,
memo: "",
getBarCode(code) { };
this.getData(code); this.uploader = [];
}, });
epDosingRecConfirm(e) { },
this.getBarCode(e.target.value); },
}, onNavigationBarButtonTap(btn) {
getData(code) { this.$refs.ifrm.topMenuClick(btn);
this.epDosingRecValue = code; },
this.$ajax.request({ onShow() {},
url: 'pdaLoad/epDosingRecByCode/' + code, };
method: 'GET',
success: data => {
if (data == null) {
return uni.showToast({
icon: "none",
title: '此酸雾塔置暂无任务'
});
}
this.epDosingRecValue = '';
this.epDosingRec = data;
uni.showToast({
title: '数据获取成功'
});
}
});
},
submitClick() {
this.$ajax.request({
url: 'pdaSave/saveEpDosingRec',
method: 'POST',
data: this.epDosingRec,
success: data => {
uni.showToast({
title: '保存成功'
});
this.deviceRepairValue = '';
this.epDosingRec = {
bsTower: {},
dose: null,
memo: ''
};
this.uploader = []
}
});
}
},
onNavigationBarButtonTap(btn) {
this.$refs.ifrm.topMenuClick(btn);
},
onShow() {}
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.uni-forms-item { .uni-forms-item {
margin-bottom: 6px !important; margin-bottom: 6px !important;
} }
.photoTitleSize {
color: #a1a1a1;
text-align: right;
margin-right: 30rpx;
margin-top: -30rpx;
}
.showImage { .photoTitleSize {
display: flex; color: #a1a1a1;
flex-direction: row; text-align: right;
justify-content: flex-start; margin-right: 30rpx;
flex-wrap: wrap; margin-top: -30rpx;
margin-left: -20rpx; }
.showImage-for { .showImage {
display: flex;
flex-direction: row;
justify-content: flex-start;
flex-wrap: wrap;
margin-left: -20rpx;
display: flex; .showImage-for {
flex-direction: column; display: flex;
width: 200rpx; flex-direction: column;
margin-left: 30rpx; width: 200rpx;
height: 260rpx; margin-left: 30rpx;
height: 260rpx;
.view-icon { .view-icon {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
margin-top: -10rpx; margin-top: -10rpx;
} }
image { image {
border-width: 2rpx; border-width: 2rpx;
border-color: rgb(229, 229, 229); border-color: rgb(229, 229, 229);
border-style: solid; border-style: solid;
border-radius: 20rpx; border-radius: 20rpx;
width: 190rpx; width: 190rpx;
height: 190rpx; height: 190rpx;
} }
} }
} }
.view-center { .view-center {
margin: 0rpx 25rpx; margin: 0rpx 25rpx;
image { image {
border-width: 2rpx; border-width: 2rpx;
border-color: rgb(229, 229, 229); border-color: rgb(229, 229, 229);
border-style: solid; border-style: solid;
border-radius: 20rpx; border-radius: 20rpx;
width: 190rpx; width: 190rpx;
height: 190rpx; height: 190rpx;
} }
} }
</style> </style>
Loading…
Cancel
Save