|
|
|
@ -11,23 +11,29 @@ |
|
|
|
|
<el-button type="primary" |
|
|
|
|
size="large" |
|
|
|
|
@click="handleFormSubmit" |
|
|
|
|
> |
|
|
|
|
v-if="addUpdateShowButton"> |
|
|
|
|
确定</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
size="small" |
|
|
|
|
@click="seachToUpdate" |
|
|
|
|
v-if="shouldShowButton"> |
|
|
|
|
修改</el-button> |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
</basic-container> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import {getList, getDetail, add, update, remove, takeEffect, lapse} from "@/api/inspection/inspectionobject"; |
|
|
|
|
import {mapGetters} from "vuex"; |
|
|
|
|
import {getToken} from "@/util/auth"; |
|
|
|
|
import {getList, getDetail, add, update, remove, takeEffect, lapse} from "@/api/inspection/inspectionobject"; |
|
|
|
|
import {mapGetters} from "vuex"; |
|
|
|
|
import {getToken} from "@/util/auth"; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: "inspectionobjectDetail", |
|
|
|
|
export default { |
|
|
|
|
name: "inspectionrouteDetail", |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
addUpdateShowButton:{}, |
|
|
|
|
shouldShowButton:{}, |
|
|
|
|
readonlyForm:{}, |
|
|
|
|
frame_class: '', |
|
|
|
|
form: {}, |
|
|
|
@ -40,6 +46,7 @@ |
|
|
|
|
label: "对象编号", |
|
|
|
|
prop: "objectNo", |
|
|
|
|
span:8, |
|
|
|
|
disabled: true, |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入对象编号", |
|
|
|
@ -105,6 +112,12 @@ |
|
|
|
|
label: "对象状态", |
|
|
|
|
prop: "istatus", |
|
|
|
|
search:true, |
|
|
|
|
type: "select", |
|
|
|
|
dicUrl: "/api/daf-system/dict/dictionary?code=istatus", |
|
|
|
|
props: { |
|
|
|
|
label: "dictValue", |
|
|
|
|
value: "dictKey" |
|
|
|
|
}, |
|
|
|
|
span:8, |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
@ -123,6 +136,11 @@ |
|
|
|
|
trigger: "blur" |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "取消原因", |
|
|
|
|
prop: "cancelReason", |
|
|
|
|
span: 8, |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
data: [] |
|
|
|
@ -132,7 +150,7 @@ |
|
|
|
|
...mapGetters(["permission"]), |
|
|
|
|
permissionList() { |
|
|
|
|
// this.option.column = this.option.column.filter(v => { |
|
|
|
|
// return this.permission['inspectionobject_col_' + v.prop] |
|
|
|
|
// return this.permission['inspectionroute_col_' + v.prop] |
|
|
|
|
// }) |
|
|
|
|
return { |
|
|
|
|
addBtn: false, |
|
|
|
@ -146,10 +164,19 @@ |
|
|
|
|
if(["view"].includes(this.$route.query.frameMode)){ |
|
|
|
|
this.readonlyForm = true; |
|
|
|
|
this.addUpdateShowButton = false; |
|
|
|
|
this.shouldShowButton=true; |
|
|
|
|
this.frame_class = 'frame_class'; |
|
|
|
|
}else{ |
|
|
|
|
const objectNo = this.findObject(this.option.column, "objectNo"); |
|
|
|
|
objectNo.value = ' '; |
|
|
|
|
objectNo.disabled = true; |
|
|
|
|
const iStatus = this.findObject(this.option.column, "istatus"); |
|
|
|
|
iStatus.display = false; |
|
|
|
|
const cancelReason = this.findObject(this.option.column, "cancelReason"); |
|
|
|
|
cancelReason.display = false; |
|
|
|
|
this.readonlyForm = false; |
|
|
|
|
this.addUpdateShowButton = true; |
|
|
|
|
this.shouldShowButton=false; |
|
|
|
|
this.frame_class = null; |
|
|
|
|
} |
|
|
|
|
this.SearchDetail(); |
|
|
|
@ -170,12 +197,12 @@ |
|
|
|
|
}, |
|
|
|
|
// 处理表单提交 |
|
|
|
|
Submit() { |
|
|
|
|
if(this.$route.query.frameMode=="add"){ |
|
|
|
|
this.$confirm("是否新增所填数据?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.form.checkStatus="1" |
|
|
|
|
add(this.form).then(()=>{ |
|
|
|
|
this.$router.push({ |
|
|
|
|
path: "/inspection/inspectionobject", |
|
|
|
@ -193,6 +220,40 @@ |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}else { |
|
|
|
|
this.$confirm("是否修改所填数据?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
alert(this.form.istatus) |
|
|
|
|
if (this.form.istatus==1){ |
|
|
|
|
this.form.cancelReason=""; |
|
|
|
|
} |
|
|
|
|
alert(this.form.cancelReason) |
|
|
|
|
update(this.form).then(() => { |
|
|
|
|
this.$router.push({ |
|
|
|
|
path: "/inspection/inspectionobject", |
|
|
|
|
query: {}, |
|
|
|
|
}); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
}).catch((error) => { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "error", |
|
|
|
|
message: "操作失败!" |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
seachToUpdate () { |
|
|
|
|
this.shouldShowButton=false; |
|
|
|
|
this.addUpdateShowButton=true; |
|
|
|
|
this.readonlyForm=false; |
|
|
|
|
this.frame_class = null; |
|
|
|
|
}, |
|
|
|
|
SearchDetail() { |
|
|
|
|
if (["view"].includes(this.$route.query.frameMode)) { |
|
|
|
@ -203,7 +264,7 @@ |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style> |
|
|
|
|