Commit e4bbe86d by xue_wengang

Update addCgcs.vue

parent fa7186c8
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<div class="formContent"> <div class="formContent">
<div class="subTitle"> <div class="subTitle">
<span class="subTitle_shuxian"></span> <span class="subTitle_shuxian"></span>
<div class="subTitle_title">{{$route.query.id?'修改':'新增'}}成果测试</div> <div class="subTitle_title">
{{ $route.query.id ? "修改" : "新增" }}成果测试
</div>
</div> </div>
<el-form <el-form
ref="form" ref="form"
...@@ -17,26 +19,26 @@ ...@@ -17,26 +19,26 @@
<el-input v-model="form.bt"></el-input> <el-input v-model="form.bt"></el-input>
</el-form-item></div </el-form-item></div
></el-col> ></el-col>
<el-col :span="8" <!-- <el-col :span="8"
><div class="grid-content bg-purple"> ><div class="grid-content bg-purple">
<el-form-item label="组织单位"> <el-form-item label="组织单位">
<el-input v-model="form.zzdw"></el-input> <el-input v-model="form.zzdw"></el-input>
</el-form-item></div </el-form-item></div
></el-col> ></el-col> -->
<el-col :span="8" <el-col :span="8"
><div class="grid-content bg-purple"> ><div class="grid-content bg-purple">
<el-form-item label="测试人员"> <el-form-item label="测试人员">
<el-input v-model="form.csry"></el-input> <el-input v-model="form.csry"></el-input>
</el-form-item></div </el-form-item></div
></el-col> ></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8" <el-col :span="8"
><div class="grid-content bg-purple"> ><div class="grid-content bg-purple">
<el-form-item label="测试结果"> <el-form-item label="测试结果">
<el-input v-model="form.csjg"></el-input> <el-input v-model="form.csjg"></el-input>
</el-form-item></div </el-form-item></div
></el-col> ></el-col>
</el-row>
<el-row :gutter="20">
<!-- <el-col :span="8" <!-- <el-col :span="8"
><div class="grid-content bg-purple"> ><div class="grid-content bg-purple">
<el-form-item label="研判支撑主键"> <el-form-item label="研判支撑主键">
...@@ -48,14 +50,26 @@ ...@@ -48,14 +50,26 @@
<el-col :span="24" <el-col :span="24"
><div class="grid-content bg-purple"> ><div class="grid-content bg-purple">
<el-form-item label="测试内容"> <el-form-item label="测试内容">
<el-input v-model="form.csnr" type="textarea" :rows="4"></el-input> <el-input
v-model="form.csnr"
type="textarea"
:rows="4"
></el-input>
</el-form-item></div </el-form-item></div
></el-col> ></el-col>
</el-row> </el-row>
</el-form> </el-form>
<div class="btnWrap"> <div class="btnWrap">
<el-button v-if="$route.query.id" type="primary" size="small" @click="update">修改</el-button> <el-button
<el-button v-else type="primary" size="small" @click="save">保存</el-button> v-if="$route.query.id"
type="primary"
size="small"
@click="update"
>修改</el-button
>
<el-button v-else type="primary" size="small" @click="save"
>保存</el-button
>
</div> </div>
</div> </div>
</template> </template>
...@@ -79,7 +93,7 @@ export default { ...@@ -79,7 +93,7 @@ export default {
}, },
mounted() { mounted() {
if (this.$route.query.id) { if (this.$route.query.id) {
this.getDetail() this.getDetail();
} else { } else {
this.form.zzdw = JSON.parse(sessionStorage.getItem("userInfo")).unitcode; this.form.zzdw = JSON.parse(sessionStorage.getItem("userInfo")).unitcode;
} }
...@@ -87,15 +101,15 @@ export default { ...@@ -87,15 +101,15 @@ export default {
methods: { methods: {
save() { save() {
// this.form.zzdw = JSON.parse(sessionStorage.getItem("userInfo")).unitcode; // this.form.zzdw = JSON.parse(sessionStorage.getItem("userInfo")).unitcode;
this.form.glxxzjbh = this.$route.query.xxzjbh this.form.glxxzjbh = this.$route.query.xxzjbh;
this.doQueryRequest(this.form, "/ypzc/saveYpzccgcs").then((res) => { this.doQueryRequest(this.form, "/ypzc/saveYpzccgcs").then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success("保存成功"); this.$message.success("保存成功");
this.$router.push({ this.$router.push({
path: "/rzcxIndex/jszcyyglCgcs", path: "/rzcxIndex/jszcyyglCgcs",
query: { query: {
xxzjbh: this.$route.query.xxzjbh xxzjbh: this.$route.query.xxzjbh,
} },
}); });
} }
}); });
...@@ -107,19 +121,22 @@ export default { ...@@ -107,19 +121,22 @@ export default {
} else { } else {
this.$message.error("修改成功!"); this.$message.error("修改成功!");
} }
}) });
}, },
getDetail() { getDetail() {
this.doQueryRequest({ xxzjbh: this.$route.query.id }, "/ypzc/getYpcgcsxq").then((res) => { this.doQueryRequest(
{ xxzjbh: this.$route.query.id },
"/ypzc/getYpcgcsxq"
).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log(res) console.log(res);
this.form.bt = res.data.cgcs.bt this.form.bt = res.data.cgcs.bt;
this.form.csnr = res.data.cgcs.csnr this.form.csnr = res.data.cgcs.csnr;
this.form.zzdw = res.data.cgcs.zzdw this.form.zzdw = res.data.cgcs.zzdw;
this.form.csry = res.data.cgcs.csry this.form.csry = res.data.cgcs.csry;
this.form.csjg = res.data.cgcs.csjg this.form.csjg = res.data.cgcs.csjg;
this.form.glxxzjbh = res.data.cgcs.glxxzjbh this.form.glxxzjbh = res.data.cgcs.glxxzjbh;
this.form.xxzjbh = res.data.cgcs.xxzjbh this.form.xxzjbh = res.data.cgcs.xxzjbh;
} }
}); });
}, },
...@@ -133,8 +150,8 @@ export default { ...@@ -133,8 +150,8 @@ export default {
"content-type": "application/x-www-form-urlencoded", "content-type": "application/x-www-form-urlencoded",
}, },
}); });
} },
} },
}; };
</script> </script>
......
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