Commit d651113f authored by mahui's avatar mahui

init

parent 6b6b8e4d
...@@ -236,7 +236,8 @@ ...@@ -236,7 +236,8 @@
function getDetail(){ function getDetail(){
api.getPatrolDetail({id:props.order_id}).then((res)=>{ api.getPatrolDetail({id:props.order_id}).then((res)=>{
if(res.code==0){ if(res.code==0){
res.data.CreatedAt = myPublic.dateFormat.format(res.data.CreatedAt) res.data.content = myPublic.isJsonString(res.data.content)? JSON.parse(res.data.content):[];
res.data.CreatedAt = myPublic.dateFormat.format(res.data.CreatedAt);
Object.assign(state.detail,{...res.data}); Object.assign(state.detail,{...res.data});
} }
}); });
......
...@@ -90,7 +90,11 @@ ...@@ -90,7 +90,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="巡检内容:"> <el-form-item label="巡检内容:">
<!--<el-input v-model="formData.content" clearable placeholder="请输入"/>--> <template v-for="item in formData.content">
<div class="check-one" style="display: inline-flex;width: 200px;">
<el-checkbox v-model="item.check" :label="item.title" size="large" />
</div>
</template>
</el-form-item> </el-form-item>
<el-form-item label="巡检图片:"> <el-form-item label="巡检图片:">
<new-upload v-if="dialogFormVisible" :limit="99" :list="formData.image?formData.image.split(','):[]" @upload="(file)=>formData.image = file.join(',')" :multiply="true"></new-upload> <new-upload v-if="dialogFormVisible" :limit="99" :list="formData.image?formData.image.split(','):[]" @upload="(file)=>formData.image = file.join(',')" :multiply="true"></new-upload>
...@@ -144,7 +148,72 @@ ...@@ -144,7 +148,72 @@
// 自动化生成的字典(可能为空)以及字段 // 自动化生成的字典(可能为空)以及字段
const partol_typeOptions = ref([]) const partol_typeOptions = ref([])
const formData = ref({ const formData = ref({
content: '', content: [
{
title:'检查格栅井',
check:false
},
{
title:'格栅井照片',
check:false
},
{
title:'检查调节池',
check:false
},
{
title:'检查厌氧池',
check:false
},
{
title:'检查缺氧池',
check:false
},
{
title:'检查好氧池',
check:false
},
{
title:'检查清水池',
check:false
},
{
title:'格栅污泥池',
check:false
},
{
title:'检查出水井',
check:false
},
{
title:'清水池照片',
check:false
},
{
title:'检查各井口及井盖',
check:false
},
{
title:'检查水泵系统',
check:false
},
{
title:'检查风机系统',
check:false
},
{
title:'检查加药系统',
check:false
},
{
title:'检查监控系统',
check:false
},
{
title:'检查设备房',
check:false
}
],
description: '', description: '',
image: '', image: '',
partolName: '', partolName: '',
...@@ -276,7 +345,8 @@ ...@@ -276,7 +345,8 @@
const res = await findQshPartol({ID: row.ID}) const res = await findQshPartol({ID: row.ID})
type.value = 'update' type.value = 'update'
if (res.code === 0) { if (res.code === 0) {
formData.value = res.data.reqshPartol res.data.reqshPartol.content = JSON.parse(res.data.reqshPartol.content)||[];
Object.assign(formData.value,res.data.reqshPartol)
dialogFormVisible.value = true dialogFormVisible.value = true
} }
} }
...@@ -310,7 +380,72 @@ ...@@ -310,7 +380,72 @@
const closeDialog = () => { const closeDialog = () => {
dialogFormVisible.value = false dialogFormVisible.value = false
formData.value = { formData.value = {
content: '', content: [
{
title:'检查格栅井',
check:false
},
{
title:'格栅井照片',
check:false
},
{
title:'检查调节池',
check:false
},
{
title:'检查厌氧池',
check:false
},
{
title:'检查缺氧池',
check:false
},
{
title:'检查好氧池',
check:false
},
{
title:'检查清水池',
check:false
},
{
title:'格栅污泥池',
check:false
},
{
title:'检查出水井',
check:false
},
{
title:'清水池照片',
check:false
},
{
title:'检查各井口及井盖',
check:false
},
{
title:'检查水泵系统',
check:false
},
{
title:'检查风机系统',
check:false
},
{
title:'检查加药系统',
check:false
},
{
title:'检查监控系统',
check:false
},
{
title:'检查设备房',
check:false
}
],
description: '', description: '',
image: '', image: '',
partolName: '', partolName: '',
...@@ -321,16 +456,18 @@ ...@@ -321,16 +456,18 @@
} }
// 弹窗确定 // 弹窗确定
const enterDialog = async () => { const enterDialog = async () => {
let res let res;
let p = JSON.parse(JSON.stringify(formData.value));
p.content = JSON.stringify(formData.value.content);
switch (type.value) { switch (type.value) {
case 'create': case 'create':
res = await createQshPartol(formData.value) res = await createQshPartol(p)
break break
case 'update': case 'update':
res = await updateQshPartol(formData.value) res = await updateQshPartol(p)
break break
default: default:
res = await createQshPartol(formData.value) res = await createQshPartol(p)
break break
} }
if (res.code === 0) { if (res.code === 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment