From 998714594bd71e2eb3d4396ea667b2615b4a7958 Mon Sep 17 00:00:00 2001
From: shj <1790240199@qq.com>
Date: 星期三, 06 四月 2022 16:56:30 +0800
Subject: [PATCH] 清单
---
src/views/safetyproduction/reviewXG.vue | 231 +++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 151 insertions(+), 80 deletions(-)
diff --git a/src/views/safetyproduction/reviewXG.vue b/src/views/safetyproduction/reviewXG.vue
index 9ba6b88..4598c5f 100644
--- a/src/views/safetyproduction/reviewXG.vue
+++ b/src/views/safetyproduction/reviewXG.vue
@@ -9,7 +9,7 @@
<el-col :span="11">
<el-form-item label="A级要素">
<el-select
- v-model="formInline.region"
+ v-model="form.elementAName"
:disabled="true"
style="width: 100%"
>
@@ -21,7 +21,7 @@
<el-col :span="11" :offset="2" style="white-space: nowrap">
<el-form-item label="B级要素">
<el-select
- v-model="formInline.region"
+ v-model="form.elementBName"
:disabled="true"
style="width: 100%"
>
@@ -37,7 +37,7 @@
<el-input
:rows="3"
type="textarea"
- v-model="form.name"
+ v-model="form.standardizationRequirements"
placeholder=""
></el-input>
</el-form-item>
@@ -49,7 +49,7 @@
<el-input
type="textarea"
:rows="3"
- v-model="form.name"
+ v-model="form.enterpriseStandard"
placeholder=""
></el-input>
</el-form-item>
@@ -61,7 +61,7 @@
<el-input
type="textarea"
:rows="3"
- v-model="form.name"
+ v-model="form.reviewMethod"
placeholder=""
></el-input>
</el-form-item>
@@ -76,7 +76,7 @@
<el-input
type="textarea"
:rows="3"
- v-model="form.name"
+ v-model="form.veto"
placeholder=""
></el-input>
</el-form-item>
@@ -90,20 +90,25 @@
>
</el-col>
<el-col :span="12" style="text-align: right">
- <el-button type="primary" @click="dialogVisible=true" class="btns" size="mini" icon="el-icon-plus"
- >新增</el-button
- >
- </el-col>
+ <el-button
+ type="primary"
+ @click="coAdd('', '新增')"
+ class="btns"
+ size="mini"
+ icon="el-icon-plus"
+ >新增</el-button
+ >
+ </el-col>
</el-row>
<el-row>
<el-col :span="22" :offset="2">
<el-table
- :data="tableData"
+ :data="form.deductionList"
border
style="width: 99%; margin-left: 1%"
>
<el-table-column
- prop="date"
+ type="index"
align="center"
label="序号"
width="150"
@@ -115,42 +120,47 @@
label="说明"
></el-table-column>
<el-table-column align="center" label="操作" width="200px">
- <template slot-scope="scope">
- <el-button
- @click="handleClick(scope.row)"
- type="text"
- size="small"
- >编辑</el-button
- >
- <el-button type="text" size="small" style="color: red"
- >删除</el-button
- >
- </template>
- </el-table-column>
+ <template slot-scope="scope">
+ <el-button
+ @click="coAdd(scope.row, '编辑')"
+ type="text"
+ size="small"
+ >编辑</el-button
+ >
+ <el-button
+ type="text"
+ size="small"
+ style="color: red"
+ @click="listDel(scope.row)"
+ >删除</el-button
+ >
+ </template>
+ </el-table-column>
</el-table>
</el-col>
</el-row>
</div>
<el-row>
<el-col :span="24" style="padding: 20px 0; text-align: center">
- <el-button type="primary" class="btns">提交</el-button>
- <el-button>取消</el-button>
+ <el-button type="primary" @click="safetyInspectionItemA()" class="btns">提交</el-button>
+ <el-button @click="back()">取消</el-button>
</el-col>
</el-row>
</el-form>
</div>
</div>
- <el-dialog title="扣分详情" :visible.sync="dialogVisible" width="30%">
- <el-form ref="form" :model="form" label-width="54px">
- <el-form-item label="说明">
- <el-input v-model="form.name"></el-input>
- </el-form-item>
- <el-form-item label="扣分值">
- <el-input v-model="form.name"></el-input>
+ <el-dialog title="扣分详情" :visible.sync="dialogVisible" :close-on-click-modal="false" width="30%">
+ <el-form ref="form" :rules="rules" :model="formInline" label-width="54px">
+ <el-form-item label="说明" prop="name">
+ <el-input v-model="formInline.name"></el-input>
</el-form-item>
<el-form-item label="备注">
- <el-input v-model="form.name" :rows="5" type="textarea"></el-input>
+ <el-input
+ v-model="formInline.remark"
+ :rows="5"
+ type="textarea"
+ ></el-input>
</el-form-item>
</el-form>
<span
@@ -158,70 +168,129 @@
class="dialog-footer"
style="text-align: center; display: block"
>
- <el-button type="primary" class="btns" @click="dialogVisible = false"
+ <el-button type="primary" class="btns" @click="listAdd"
>确 定</el-button
>
- <el-button @click="dialogVisible = false">取 消</el-button>
+ <el-button @click="bacQx">取 消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Titlename from "../../components/Titlename/index.vue";
+import { safetyInspectionItemId } from "@/api/safetySelfInspection.js";
+import { safetyInspectionItemMod } from "@/api/safetyInspectionItem.js";
export default {
components: { Titlename },
data() {
return {
dialogVisible: false,
+ id: "",
resource: "0",
- form: {
- name: "",
- },
+ form: {},
formInline: {
- user: "",
- region: "",
+ name: "",
+ remark: "",
},
- tableData: [
- {
- date: "2016-05-02",
- name: "王小虎",
- province: "上海",
- city: "普陀区",
- address: "上海市普陀区金沙江路 1518 弄",
- zip: 200333,
- },
- {
- date: "2016-05-04",
- name: "王小虎",
- province: "上海",
- city: "普陀区",
- address: "上海市普陀区金沙江路 1517 弄",
- zip: 200333,
- },
- {
- date: "2016-05-01",
- name: "王小虎",
- province: "上海",
- city: "普陀区",
- address: "上海市普陀区金沙江路 1519 弄",
- zip: 200333,
- },
- {
- date: "2016-05-03",
- name: "王小虎",
- province: "上海",
- city: "普陀区",
- address: "上海市普陀区金沙江路 1516 弄",
- zip: 200333,
- },
- ],
- defaultProps: {
- children: "children",
- label: "label",
- },
+ name:"",
+ typeid:'',
+ rules: {
+ name: [
+ { required: true, message: "说明不能为空", trigger: "change" },
+ ],}
};
},
+ created() {
+ this.id = this.$route.query.idX;
+ this.typeid=this.$route.query.id;
+ this.name = this.$route.query.name
+ this.safeT(this.id);
+ },
methods: {
+ safeT(id) {
+ safetyInspectionItemId({ id: id }).then((res) => {
+ if (res.data.code == 200) {
+ this.form = res.data.result;
+ }
+ });
+ },
+ coAdd(val, type) {
+ this.$nextTick(() => {
+ this.$refs["form"].clearValidate();
+ });
+ this.titleN = type;
+ if (type == "新增") {
+ this.dialogVisible = true;
+ this.formInline = {
+ name: "",
+ remark: "",
+ };
+ } else {
+ this.dialogVisible = true;
+ this.index = this.form.deductionList.findIndex(
+ (item) => item.name == val.name
+ );
+ // this.formInline = val;
+ this.formInline=JSON.parse(JSON.stringify(val));
+ }
+ },
+ listAdd() {
+ this.$refs["form"].validate((valid) => {
+ if (valid) {
+ if (this.titleN == "新增") {
+ this.form.deductionList.push(this.formInline);
+ this.dialogVisible = false;
+ } else {
+ this.form.deductionList[this.index].name = this.formInline.name;
+ this.form.deductionList[this.index].space = this.formInline.space;
+ this.dialogVisible = false;
+ }
+ }
+ });
+ },
+ listDel(val) {
+ var i = this.form.deductionList.findIndex(
+ (item) => item.name == val.name
+ );
+ this.form.deductionList.splice(i, 1);
+ },
+ safetyInspectionItemA() {
+ safetyInspectionItemMod(this.form).then((res) => {
+ if (res.data.code == 200) {
+ this.$notify({
+ type: "success",
+ duration: 2000,
+ message: "修改成功",
+ title: "成功",
+ });
+ this.$router.push({
+ path:"/new",
+ query:{
+ name:this.name,
+ id:this.typeid
+ }
+ })
+ } else {
+ this.$message({
+ type: "warning",
+ message: res.data.message,
+ });
+ }
+ });
+ },
+ back(){
+ this.$router.push({
+ path:"/new",
+ query:{
+ name:this.name,
+ id:this.typeid
+ }
+ })
+ },
+ bacQx(){
+ this.dialogVisible = false;
+ this.safeT(this.id);
+ },
handleClick() {
this.dialogVisible = true;
},
@@ -251,6 +320,8 @@
width: 100%;
background-color: white;
border-radius: 5px;
+ height: 850px;
+ overflow-y:overlay;
}
.box-right-content {
padding: 15px 0;
@@ -259,4 +330,4 @@
background-color: #034ea2;
border: 1px solid #034ea2;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.2