|
@@ -30,21 +30,21 @@
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
<div v-for="(item,index) in attrList" :key="index">
|
|
<div v-for="(item,index) in attrList" :key="index">
|
|
- <el-form-item :label='item.name' prop="deviceId" v-if="item.name==='当日运转时间'" >
|
|
|
|
|
|
+ <el-form-item :label='item.name' prop="deviceId" >
|
|
<el-input
|
|
<el-input
|
|
|
|
+ v-if="item.isCollection===1"
|
|
v-model="item.fillContent" @input="attrList[index].fillContent = $event.target.fillContent"
|
|
v-model="item.fillContent" @input="attrList[index].fillContent = $event.target.fillContent"
|
|
clearable
|
|
clearable
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
disabled
|
|
disabled
|
|
/>
|
|
/>
|
|
|
|
+ <el-input
|
|
|
|
+ v-else
|
|
|
|
+ v-model="item.fillContent" @input="attrList[index].fillContent = $event.target.fillContent"
|
|
|
|
+ clearable
|
|
|
|
+ style="width: 200px"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item :label='item.name' prop="deviceId" v-else>
|
|
|
|
- <el-input
|
|
|
|
- v-model="item.fillContent" @input="attrList[index].fillContent = $event.target.fillContent"
|
|
|
|
- clearable
|
|
|
|
- style="width: 200px"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
</div>
|
|
</div>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button type="info" @click="deleteFillInfo">取消</el-button>
|
|
<el-button type="info" @click="deleteFillInfo">取消</el-button>
|
|
@@ -52,9 +52,6 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
</el-tabs>
|
|
</ContentWrap>
|
|
</ContentWrap>
|
|
@@ -68,8 +65,9 @@ import { IotOpeationFillApi, IotOpeationFillVO } from '@/api/pms/iotopeationfill
|
|
import IotOpeationFillForm from './IotOpeationFillForm.vue'
|
|
import IotOpeationFillForm from './IotOpeationFillForm.vue'
|
|
import Vue from "@vitejs/plugin-vue";
|
|
import Vue from "@vitejs/plugin-vue";
|
|
import {useUserStore} from "@/store/modules/user";
|
|
import {useUserStore} from "@/store/modules/user";
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
|
+import moment from 'moment';
|
|
|
|
+import { format } from 'date-fns';
|
|
/** 运行记录填报 列表 */
|
|
/** 运行记录填报 列表 */
|
|
defineOptions({ name: 'IotOpeationFill' })
|
|
defineOptions({ name: 'IotOpeationFill' })
|
|
|
|
|
|
@@ -119,28 +117,33 @@ const getList = async () => {
|
|
try {
|
|
try {
|
|
queryParams.deptId = deptId.split(",")[0];
|
|
queryParams.deptId = deptId.split(",")[0];
|
|
queryParams.userId = deptId.split(",")[1];
|
|
queryParams.userId = deptId.split(",")[1];
|
|
- queryParams.createTime = formatTimestamp(JSON.parse(deptId.split(",")[2]));
|
|
|
|
|
|
+ queryParams.createTime = formatTimestamp(JSON.parse(deptId.split(",")[2].substring(0,10)));
|
|
const data = await IotOpeationFillApi.getIotOpeationFillPage(queryParams)
|
|
const data = await IotOpeationFillApi.getIotOpeationFillPage(queryParams)
|
|
- list.value = data;
|
|
|
|
- list.value.forEach(function (item, index) {
|
|
|
|
- arry1.value[index] = item;
|
|
|
|
- });
|
|
|
|
- queryParams.deviceCategoryId = arry1.value[0].deviceCategoryId
|
|
|
|
- queryParams.deptId = arry1.value[0].deptId;
|
|
|
|
- queryParams.deviceCode = arry1.value[0].deviceCode;
|
|
|
|
- queryParams.deviceName = arry1.value[0].deviceName;
|
|
|
|
- queryParams.deviceId = arry1.value[0].deviceId;
|
|
|
|
- getAttrList();
|
|
|
|
|
|
+ if(data.length===0){
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: '改用户负责设备状态为非施工或待命,请调整',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ list.value = data;
|
|
|
|
+ list.value.forEach(function (item, index) {
|
|
|
|
+ arry1.value[index] = item;
|
|
|
|
+ });
|
|
|
|
+ queryParams.deviceCategoryId = arry1.value[0].deviceCategoryId
|
|
|
|
+ queryParams.deptId = arry1.value[0].deptId;
|
|
|
|
+ queryParams.deviceCode = arry1.value[0].deviceCode;
|
|
|
|
+ queryParams.deviceName = arry1.value[0].deviceName;
|
|
|
|
+ queryParams.deviceId = arry1.value[0].deviceId;
|
|
|
|
+ getAttrList();
|
|
|
|
+ }
|
|
} finally {
|
|
} finally {
|
|
loading.value = false
|
|
loading.value = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function formatTimestamp(timestamp) {
|
|
function formatTimestamp(timestamp) {
|
|
- const date = new Date(timestamp);
|
|
|
|
- const year = date.getFullYear();
|
|
|
|
- const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份是从0开始的
|
|
|
|
- const day = String(date.getDate()).padStart(2, '0');
|
|
|
|
- return `${year}-${month}-${day}`;
|
|
|
|
|
|
+ const date = new Date(timestamp*1000);
|
|
|
|
+ return moment.unix(timestamp).format('YYYY-MM-DD');
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
@@ -178,14 +181,16 @@ const getAttrList = async () => {
|
|
loading.value = true
|
|
loading.value = true
|
|
try {
|
|
try {
|
|
totalRunTime1 = 0;
|
|
totalRunTime1 = 0;
|
|
|
|
+ queryParams.createTime = formatTimestamp(JSON.parse(deptId.split(",")[2].substring(0,10)));
|
|
const data = await IotOpeationFillApi.getAttrs(queryParams)
|
|
const data = await IotOpeationFillApi.getAttrs(queryParams)
|
|
attrList.value = data;
|
|
attrList.value = data;
|
|
//totalRunTime1 = Number(attrList.value[0].totalRunTime).toFixed(2)
|
|
//totalRunTime1 = Number(attrList.value[0].totalRunTime).toFixed(2)
|
|
attrList.value.forEach(function (item,index){
|
|
attrList.value.forEach(function (item,index){
|
|
|
|
+
|
|
if(item.name==='累计运行时间'){
|
|
if(item.name==='累计运行时间'){
|
|
item.name = '当日运转时间'
|
|
item.name = '当日运转时间'
|
|
- totalRunTime1 = Number(item.totalRunTime).toFixed(2)
|
|
|
|
}
|
|
}
|
|
|
|
+ totalRunTime1 = Number(item.totalRunTime).toFixed(2)
|
|
item.fillContent = Number(item.fillContent).toFixed(2)
|
|
item.fillContent = Number(item.fillContent).toFixed(2)
|
|
item.deviceCode = queryParams.deviceCode;
|
|
item.deviceCode = queryParams.deviceCode;
|
|
item.deptId = queryParams.deptId;
|
|
item.deptId = queryParams.deptId;
|
|
@@ -200,13 +205,14 @@ const getAttrList = async () => {
|
|
/** 获取填写信息保存到后台*/
|
|
/** 获取填写信息保存到后台*/
|
|
const getFillInfo = async () => {
|
|
const getFillInfo = async () => {
|
|
try {
|
|
try {
|
|
|
|
+ alert(deptId)
|
|
attrList.value.forEach(function (item,index){
|
|
attrList.value.forEach(function (item,index){
|
|
item.pointName = item.name;
|
|
item.pointName = item.name;
|
|
- item.createTime = formatTimestamp(JSON.parse(deptId.split(",")[2]));
|
|
|
|
|
|
+ item.createTime = formatTimestamp(JSON.parse(deptId.split(",")[2].substring(0,10)));
|
|
item.userId = deptId.split(",")[1];
|
|
item.userId = deptId.split(",")[1];
|
|
|
|
+ item.id = deptId.split(",")[3];
|
|
})
|
|
})
|
|
const data = attrList.value as unknown as IotOpeationFillVO
|
|
const data = attrList.value as unknown as IotOpeationFillVO
|
|
-
|
|
|
|
await IotOpeationFillApi.insertLog(data)
|
|
await IotOpeationFillApi.insertLog(data)
|
|
message.success(t('common.createSuccess'))
|
|
message.success(t('common.createSuccess'))
|
|
// 发送操作成功的事件
|
|
// 发送操作成功的事件
|