|
@@ -33,22 +33,22 @@
|
|
|
<el-form-item :label='item.name' prop="deviceId" >
|
|
|
<el-input
|
|
|
v-if="item.isCollection===1"
|
|
|
- v-model="item.fillContent" @input="attrList[index].fillContent = $event.target.fillContent"
|
|
|
+ v-model="item.fillContent"
|
|
|
clearable
|
|
|
style="width: 200px"
|
|
|
disabled
|
|
|
/>
|
|
|
<el-input
|
|
|
v-else
|
|
|
- v-model="item.fillContent" @input="attrList[index].fillContent = $event.target.fillContent"
|
|
|
+ v-model="item.fillContent"
|
|
|
clearable
|
|
|
style="width: 200px"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<el-form-item>
|
|
|
- <el-button type="info" @click="deleteFillInfo">取消</el-button>
|
|
|
- <el-button type="primary" @click="getFillInfo">确定</el-button>
|
|
|
+ <el-button type="primary" @click="getFillInfo" v-show="showStatus">确定</el-button>
|
|
|
+ <el-button type="info" @click="deleteFillInfo" v-show="showStatus">取消</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -68,6 +68,7 @@ import {useUserStore} from "@/store/modules/user";
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import moment from 'moment';
|
|
|
import { format } from 'date-fns';
|
|
|
+import {cx} from "@fullcalendar/core/internal-common";
|
|
|
/** 运行记录填报 列表 */
|
|
|
defineOptions({ name: 'IotOpeationFill' })
|
|
|
|
|
@@ -83,6 +84,8 @@ const attrList = ref<IotOpeationFillVO[]>([]) // 列表的数据
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
const arry1 =ref([]);
|
|
|
let totalRunTime1: string = '123'
|
|
|
+let fillStatus = params.id.split(",")[4];
|
|
|
+let showStatus = true;
|
|
|
const queryParams = reactive({
|
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
@@ -101,16 +104,25 @@ const queryParams = reactive({
|
|
|
creDate: [],
|
|
|
createTime: [],
|
|
|
deviceCategoryId:1,
|
|
|
+ deviceId:undefined
|
|
|
})
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
-
|
|
|
+let cxStatus = true;
|
|
|
|
|
|
const formatDescription = async(row, column, cellValue) =>{
|
|
|
return cellValue.split(',').map(part => `<div>${part}</div>`).join('');
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+const showComponent = () => {
|
|
|
+ if(JSON.parse(fillStatus)=== 1){
|
|
|
+ showStatus = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
/** 查询列表 */
|
|
|
const getList = async () => {
|
|
|
loading.value = true
|
|
@@ -118,24 +130,19 @@ const getList = async () => {
|
|
|
queryParams.deptId = deptId.split(",")[0];
|
|
|
queryParams.userId = deptId.split(",")[1];
|
|
|
queryParams.createTime = formatTimestamp(JSON.parse(deptId.split(",")[2].substring(0,10)));
|
|
|
- const data = await IotOpeationFillApi.getIotOpeationFillPage(queryParams)
|
|
|
- if(data.length===0){
|
|
|
- ElMessage({
|
|
|
- message: '改用户负责设备状态为非施工或待命,请调整',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- }else{
|
|
|
+ queryParams.orderId = deptId.split(",")[3];
|
|
|
+ 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;
|
|
|
+ if(cxStatus){
|
|
|
+ queryParams.deviceCategoryId = list.value[0].deviceCategoryId
|
|
|
+ queryParams.deptId = list.value[0].deptId;
|
|
|
+ queryParams.deviceCode = list.value[0].deviceCode;
|
|
|
+ queryParams.deviceName = list.value[0].deviceName;
|
|
|
+ queryParams.deviceId = list.value[0].deviceId;
|
|
|
+ }
|
|
|
getAttrList();
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
} finally {
|
|
|
loading.value = false
|
|
|
}
|
|
@@ -168,6 +175,7 @@ const open = async (type: string, id?: number) => {
|
|
|
}
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
const openFill = (deviceCategoryId?:number,deviceId?:number,deptId?:number,deviceName?:string,deviceCode?:string) =>{
|
|
|
+
|
|
|
queryParams.deviceCategoryId = deviceCategoryId;
|
|
|
queryParams.deptId = deptId;
|
|
|
queryParams.deviceCode = deviceCode;
|
|
@@ -184,7 +192,6 @@ const getAttrList = async () => {
|
|
|
queryParams.createTime = formatTimestamp(JSON.parse(deptId.split(",")[2].substring(0,10)));
|
|
|
const data = await IotOpeationFillApi.getAttrs(queryParams)
|
|
|
attrList.value = data;
|
|
|
- //totalRunTime1 = Number(attrList.value[0].totalRunTime).toFixed(2)
|
|
|
attrList.value.forEach(function (item,index){
|
|
|
|
|
|
if(item.name==='累计运行时间'){
|
|
@@ -197,10 +204,10 @@ const getAttrList = async () => {
|
|
|
item.deviceId = queryParams.deviceId;
|
|
|
item.deviceCategoryId = queryParams.deviceCategoryId;
|
|
|
})
|
|
|
-
|
|
|
} finally {
|
|
|
loading.value = false
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
/** 获取填写信息保存到后台*/
|
|
|
const getFillInfo = async () => {
|
|
@@ -216,6 +223,7 @@ const getFillInfo = async () => {
|
|
|
message.success(t('common.createSuccess'))
|
|
|
// 发送操作成功的事件
|
|
|
emit('success')
|
|
|
+ cxStatus = false;
|
|
|
getList();
|
|
|
} finally {
|
|
|
|
|
@@ -260,7 +268,7 @@ const handleExport = async () => {
|
|
|
/** 初始化 **/
|
|
|
onMounted(() => {
|
|
|
getList()
|
|
|
-
|
|
|
+ showComponent()
|
|
|
})
|
|
|
</script>
|
|
|
<style scoped>
|