|
@@ -4,8 +4,18 @@
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="6">征地补偿标准:</el-col>
|
|
|
<el-col :span="18">
|
|
|
- <el-select v-model="bcbz" style="width: 90%" @change="selectZDBZ" placeholder="请选择">
|
|
|
- <el-option v-for="item in bcbzList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ <el-select
|
|
|
+ v-model="bcbz"
|
|
|
+ style="width: 90%"
|
|
|
+ @change="selectZDBZ"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in bcbzList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -15,46 +25,75 @@
|
|
|
</el-table-column> -->
|
|
|
<el-table-column prop="jg" label="房屋结构" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.jg" v-show="scope.row.seen" @focus="handleSetFoucsSetData(scope.row)"
|
|
|
- @blur="loseFoucs(scope.row)"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.jg"
|
|
|
+ v-show="scope.row.seen"
|
|
|
+ @focus="handleSetFoucsSetData(scope.row)"
|
|
|
+ @blur="loseFoucs(scope.row)"
|
|
|
+ ></el-input>
|
|
|
<div v-show="!scope.row.seen">{{ scope.row.jg }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="grade" label="等级" width="60">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.grade" v-show="scope.row.seen" @focus="handleSetFoucsSetData(scope.row)"
|
|
|
- @blur="loseFoucs(scope.row)"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.grade"
|
|
|
+ v-show="scope.row.seen"
|
|
|
+ @focus="handleSetFoucsSetData(scope.row)"
|
|
|
+ @blur="loseFoucs(scope.row)"
|
|
|
+ ></el-input>
|
|
|
<div v-show="!scope.row.seen">{{ scope.row.grade }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="bz" label="单价(元/平方米)" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.bz" v-show="scope.row.seen" @focus="handleSetFoucsSetData(scope.row)"
|
|
|
- @blur="loseFoucs(scope.row)"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.bz"
|
|
|
+ v-show="scope.row.seen"
|
|
|
+ @focus="handleSetFoucsSetData(scope.row)"
|
|
|
+ @blur="loseFoucs(scope.row)"
|
|
|
+ ></el-input>
|
|
|
<div v-show="!scope.row.seen">{{ scope.row.bz }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="des" label="结构及装饰特征(规格)">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.des" v-show="scope.row.seen" @focus="handleSetFoucsSetData(scope.row)"
|
|
|
- @blur="loseFoucs(scope.row)"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.des"
|
|
|
+ v-show="scope.row.seen"
|
|
|
+ @focus="handleSetFoucsSetData(scope.row)"
|
|
|
+ @blur="loseFoucs(scope.row)"
|
|
|
+ ></el-input>
|
|
|
<div v-show="!scope.row.seen">{{ scope.row.des }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column fixed="right" label="操作" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
|
|
|
- <el-button type="text" size="small" @click="handleDeleteClick(scope.row)">删除</el-button>
|
|
|
+ <el-button @click="handleClick(scope.row)" type="text" size="small"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="handleDeleteClick(scope.row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<el-row justify="center" type="flex">
|
|
|
<el-button type="primary" @click="save()">保存</el-button>
|
|
|
- <el-button type="primary" @click="saveAs()">另存为</el-button>
|
|
|
+ <el-button type="primary" @click="saveAs('ruleForm')">另存为</el-button>
|
|
|
<el-button type="primary" @click="reset()">重置</el-button>
|
|
|
<el-button type="primary" @click="delBZ()">删除</el-button>
|
|
|
</el-row>
|
|
|
- <el-dialog title="标准名称设置" :modal="false" :visible.sync="dialogFormVisible" append-to-body="true" width="20rem">
|
|
|
+ <el-dialog
|
|
|
+ title="标准名称设置"
|
|
|
+ :modal="false"
|
|
|
+ :visible.sync="dialogFormVisible"
|
|
|
+ append-to-body="true"
|
|
|
+ width="20rem"
|
|
|
+ >
|
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm">
|
|
|
<el-form-item label="名称" prop="name">
|
|
|
<el-input v-model="ruleForm.name" autocomplete="off"></el-input>
|
|
@@ -62,10 +101,18 @@
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogFormVisible = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm('ruleForm')"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="编辑" :modal="false" :visible.sync="editFormVisible" append-to-body="true" width="20rem">
|
|
|
+ <el-dialog
|
|
|
+ title="编辑"
|
|
|
+ :modal="false"
|
|
|
+ :visible.sync="editFormVisible"
|
|
|
+ append-to-body="true"
|
|
|
+ width="20rem"
|
|
|
+ >
|
|
|
<el-form :model="oldRow" :rules="rowRules" ref="rowForm">
|
|
|
<el-form-item label="房屋结构" prop="jg">
|
|
|
<el-select v-model="oldRow.jg">
|
|
@@ -77,26 +124,49 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="房屋等级" prop="grade">
|
|
|
- <el-input v-model.number="oldRow.grade" type="number" min="1" max="5"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model.number="oldRow.grade"
|
|
|
+ type="number"
|
|
|
+ min="1"
|
|
|
+ max="5"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="单价(元/平方米)" prop="bz">
|
|
|
- <el-input v-model.number="oldRow.bz" type="number" min="0" max="10000000000"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model.number="oldRow.bz"
|
|
|
+ type="number"
|
|
|
+ min="0"
|
|
|
+ max="10000000000"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="规格" prop="des">
|
|
|
- <el-input type="textarea" :rows="4" v-model="oldRow.des" autocomplete="off"></el-input>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :rows="4"
|
|
|
+ v-model="oldRow.des"
|
|
|
+ autocomplete="off"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="editFormVisible = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="submitEditForm('rowForm')">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="submitEditForm('rowForm')"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import {
|
|
|
- getCqBcbzList, getCqBcbzItemList, getCqBcbzById,
|
|
|
- addCqBcbz, updateCqBcbz, updateCqBcbzItem, delCqBcbzItem, delCqBcbz
|
|
|
+ getCqBcbzList,
|
|
|
+ getCqBcbzItemList,
|
|
|
+ getCqBcbzById,
|
|
|
+ addCqBcbz,
|
|
|
+ updateCqBcbz,
|
|
|
+ updateCqBcbzItem,
|
|
|
+ delCqBcbzItem,
|
|
|
+ delCqBcbz,
|
|
|
} from "@/api/zt/ztApi.js";
|
|
|
export default {
|
|
|
props: {
|
|
@@ -111,12 +181,10 @@ export default {
|
|
|
name: "ZDShowInfo",
|
|
|
data() {
|
|
|
var bzValidate = (rule, value, callback) => {
|
|
|
- if (value == "" || value == null)
|
|
|
- callback(new Error("不能为空"))
|
|
|
+ if (value == "" || value == null) callback(new Error("不能为空"));
|
|
|
else if (value < 0) {
|
|
|
- callback(new Error("不能小于0"))
|
|
|
- }
|
|
|
- else callback()
|
|
|
+ callback(new Error("不能小于0"));
|
|
|
+ } else callback();
|
|
|
};
|
|
|
return {
|
|
|
editFormVisible: false,
|
|
@@ -132,12 +200,8 @@ export default {
|
|
|
],
|
|
|
},
|
|
|
rulesEdit: {
|
|
|
- grade: [
|
|
|
- { validate: bzValidate, trigger: 'blur' }
|
|
|
- ],
|
|
|
- bz: [
|
|
|
- { validate: bzValidate, trigger: 'blur' }
|
|
|
- ],
|
|
|
+ grade: [{ validate: bzValidate, trigger: "blur" }],
|
|
|
+ bz: [{ validate: bzValidate, trigger: "blur" }],
|
|
|
},
|
|
|
|
|
|
// rowForm: {
|
|
@@ -148,15 +212,26 @@ export default {
|
|
|
// },
|
|
|
|
|
|
rowRules: {
|
|
|
-
|
|
|
grade: [
|
|
|
// { required: true, message: "不能为空", trigger: "blur" },
|
|
|
- { type: 'number', min: 1, max: 5, message: "范围1-5之间", trigger: 'blur' }
|
|
|
+ {
|
|
|
+ type: "number",
|
|
|
+ min: 1,
|
|
|
+ max: 5,
|
|
|
+ message: "范围1-5之间",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
],
|
|
|
bz: [
|
|
|
// { required: true, message: "不能为空", trigger: "blur" },
|
|
|
// /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
|
|
|
- { type: 'number', min: 0, max: 10000000000, message: "不能小于0", trigger: 'blur' }
|
|
|
+ {
|
|
|
+ type: "number",
|
|
|
+ min: 0,
|
|
|
+ max: 10000000000,
|
|
|
+ message: "不能小于0",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
],
|
|
|
},
|
|
|
/**
|
|
@@ -296,53 +371,53 @@ export default {
|
|
|
that.bcbz = that.cqValue;
|
|
|
if (window.isUseDB) {
|
|
|
that.curBCBZ = {
|
|
|
- id: '',
|
|
|
- name: '',
|
|
|
- bcbz: []
|
|
|
- }
|
|
|
- getCqBcbzList().then((res) => {
|
|
|
- that.bcbzList = res.rows;
|
|
|
- if (that.bcbz == null || that.bcbz == "") {
|
|
|
- if (that.bcbzList.length > 0) {
|
|
|
- that.cqValue = that.bcbzList[0].id
|
|
|
- that.bcbz = that.cqValue
|
|
|
- that.curBCBZ.id = that.bcbz
|
|
|
- that.curBCBZ.name = that.bcbzList[0].name;
|
|
|
+ id: "",
|
|
|
+ name: "",
|
|
|
+ bcbz: [],
|
|
|
+ };
|
|
|
+ getCqBcbzList()
|
|
|
+ .then((res) => {
|
|
|
+ that.bcbzList = res.rows;
|
|
|
+ if (that.bcbz == null || that.bcbz == "") {
|
|
|
+ if (that.bcbzList.length > 0) {
|
|
|
+ that.cqValue = that.bcbzList[0].id;
|
|
|
+ that.bcbz = that.cqValue;
|
|
|
+ that.curBCBZ.id = that.bcbz;
|
|
|
+ that.curBCBZ.name = that.bcbzList[0].name;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ var item = that.bcbzList.find((t) => t.id == that.bcbz);
|
|
|
+ if (item) {
|
|
|
+ that.curBCBZ.id = item.id;
|
|
|
+ that.curBCBZ.name = item.name;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
- var item = that.bcbzList.find(t => t.id == that.bcbz)
|
|
|
- if (item) {
|
|
|
- that.curBCBZ.id = item.id;
|
|
|
- that.curBCBZ.name = item.name;
|
|
|
- }
|
|
|
- }
|
|
|
- var queryParams =
|
|
|
- {
|
|
|
- "bz": null,
|
|
|
- "des": null,
|
|
|
- "grade": null,
|
|
|
- "id": null,
|
|
|
- "jg": null,
|
|
|
- "pid": that.bcbz
|
|
|
- }
|
|
|
- getCqBcbzItemList(queryParams).then((response) => {
|
|
|
- if (response) {
|
|
|
- that.curBCBZ.bcbz = response.rows;
|
|
|
- }
|
|
|
- }).catch((err) => {
|
|
|
- console.log(err)
|
|
|
+ var queryParams = {
|
|
|
+ bz: null,
|
|
|
+ des: null,
|
|
|
+ grade: null,
|
|
|
+ id: null,
|
|
|
+ jg: null,
|
|
|
+ pid: that.bcbz,
|
|
|
+ };
|
|
|
+ getCqBcbzItemList(queryParams)
|
|
|
+ .then((response) => {
|
|
|
+ if (response) {
|
|
|
+ that.curBCBZ.bcbz = response.rows;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
})
|
|
|
- }).catch((err) => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- }
|
|
|
- else {
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
that.bcbzList = JSON.parse(JSON.stringify(window.ZSBC.CQBCList));
|
|
|
if (that.cqValue != null && that.cqValue != "") {
|
|
|
that.curBCBZ = that.bcbzList.find((t) => t.id == that.bcbz);
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
if (that.bcbzList.length > 0) {
|
|
|
that.cqValue = that.bcbzList[0].id;
|
|
|
that.bcbz = that.cqValue;
|
|
@@ -359,36 +434,35 @@ export default {
|
|
|
if (that.bcbz && that.bcbz != "") {
|
|
|
if (window.isUseDB) {
|
|
|
that.curBCBZ = {
|
|
|
- id: '',
|
|
|
- name: '',
|
|
|
- bcbz: []
|
|
|
- }
|
|
|
- var queryParams =
|
|
|
- {
|
|
|
- "bz": null,
|
|
|
- "des": null,
|
|
|
- "grade": null,
|
|
|
- "id": null,
|
|
|
- "jg": null,
|
|
|
- "pid": that.bcbz
|
|
|
- }
|
|
|
- getCqBcbzItemList(queryParams).then((response) => {
|
|
|
- if (response) {
|
|
|
- that.curBCBZ.bcbz = response.rows;
|
|
|
- }
|
|
|
- }).catch((err) => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- }
|
|
|
- else {
|
|
|
+ id: "",
|
|
|
+ name: "",
|
|
|
+ bcbz: [],
|
|
|
+ };
|
|
|
+ var queryParams = {
|
|
|
+ bz: null,
|
|
|
+ des: null,
|
|
|
+ grade: null,
|
|
|
+ id: null,
|
|
|
+ jg: null,
|
|
|
+ pid: that.bcbz,
|
|
|
+ };
|
|
|
+ getCqBcbzItemList(queryParams)
|
|
|
+ .then((response) => {
|
|
|
+ if (response) {
|
|
|
+ that.curBCBZ.bcbz = response.rows;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
this.bcbzList = JSON.parse(JSON.stringify(window.ZSBC.CQBCList));
|
|
|
if (this.cqValue != undefined && this.cqValue != "") {
|
|
|
this.curBCBZ = this.bcbzList.find((t) => t.id == this.bcbz);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
- that.$message.warning("请选择标准")
|
|
|
+ } else {
|
|
|
+ that.$message.warning("请选择标准");
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -416,18 +490,17 @@ export default {
|
|
|
var item = {
|
|
|
id: that.curBCBZ.id,
|
|
|
name: that.curBCBZ.name,
|
|
|
- bcbz: that.curBCBZ.bcbz
|
|
|
- }
|
|
|
- updateCqBcbz(item).then((res) => {
|
|
|
- if (res)
|
|
|
- that.getInitData();
|
|
|
- that.$layer.alert("保存完成");
|
|
|
-
|
|
|
- }).catch((err) => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- }
|
|
|
- else {
|
|
|
+ bcbz: that.curBCBZ.bcbz,
|
|
|
+ };
|
|
|
+ updateCqBcbz(item)
|
|
|
+ .then((res) => {
|
|
|
+ if (res) that.getInitData();
|
|
|
+ that.$layer.alert("保存完成");
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
var index = window.ZSBC.CQBCList.findIndex((t) => t.value == this.bcbz);
|
|
|
if (index > -1) {
|
|
|
window.ZSBC.CQBCList[index] = this.curBCBZ;
|
|
@@ -438,12 +511,16 @@ export default {
|
|
|
/***
|
|
|
* 另存为
|
|
|
*/
|
|
|
- saveAs() {
|
|
|
+ saveAs(formName) {
|
|
|
+ debugger;
|
|
|
// if (this.bcbz == "") {
|
|
|
// this.$layer.alert("请选择补偿标准");
|
|
|
// return
|
|
|
// }
|
|
|
this.dialogFormVisible = true;
|
|
|
+ this.$nextTick(function () {
|
|
|
+ this.$refs[formName].resetFields();
|
|
|
+ });
|
|
|
},
|
|
|
submitForm(formName) {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
@@ -451,8 +528,6 @@ export default {
|
|
|
// alert('submit!');
|
|
|
this.dialogFormVisible = false;
|
|
|
this.saveData();
|
|
|
-
|
|
|
-
|
|
|
} else {
|
|
|
console.log("error submit!!");
|
|
|
return false;
|
|
@@ -473,17 +548,16 @@ export default {
|
|
|
bcbz: that.curBCBZ.bcbz,
|
|
|
};
|
|
|
if (window.isUseDB) {
|
|
|
- addCqBcbz(newBCBZ).then((res) => {
|
|
|
- if (res)
|
|
|
- that.getInitData();
|
|
|
- that.lyoption.content.parent.initSetting();
|
|
|
- that.$layer.alert("保存完成");
|
|
|
-
|
|
|
- }).catch((err) => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- }
|
|
|
- else {
|
|
|
+ addCqBcbz(newBCBZ)
|
|
|
+ .then((res) => {
|
|
|
+ if (res) that.getInitData();
|
|
|
+ that.lyoption.content.parent.initSetting();
|
|
|
+ that.$layer.alert("保存完成");
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
window.ZSBC.CQBCList.push(newBCBZ);
|
|
|
that.bcbzList = window.ZSBC.CQBCList;
|
|
|
that.bcbz = val;
|
|
@@ -491,7 +565,7 @@ export default {
|
|
|
},
|
|
|
updateZDWindow() {
|
|
|
var that = this;
|
|
|
- that.$layer.close(window.zdWindowId)
|
|
|
+ that.$layer.close(window.zdWindowId);
|
|
|
window.zdWindowId = this.$layer.iframe({
|
|
|
layerStyle: {
|
|
|
padding: "0.3vw 1vw 0.3vw 2.5vw",
|
|
@@ -520,32 +594,35 @@ export default {
|
|
|
* 编辑按钮
|
|
|
*/
|
|
|
handleClick(row) {
|
|
|
- debugger
|
|
|
+ debugger;
|
|
|
|
|
|
- this.oldRow = row;
|
|
|
+ this.oldRow = JSON.parse(JSON.stringify(row));
|
|
|
this.editFormVisible = true;
|
|
|
},
|
|
|
handleDeleteClick(row) {
|
|
|
var that = this;
|
|
|
- if (row == undefined)
|
|
|
- return;
|
|
|
- var index = that.curBCBZ.bcbz.findIndex(t => t.id = row.id)
|
|
|
- var formId = that.$layer.confirm("确定要删除吗?", {}, function () {
|
|
|
- delCqBcbzItem([row.id]).then((res) => {
|
|
|
- if (res) {
|
|
|
- that.$message("数据已删除!");
|
|
|
- if (index > -1)
|
|
|
- that.curBCBZ.bcbz.splice(index, 1)
|
|
|
- that.$layer.close(formId)
|
|
|
- }
|
|
|
- }).catch((err) => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
-
|
|
|
- }, function () {
|
|
|
- return
|
|
|
- });
|
|
|
-
|
|
|
+ if (row == undefined) return;
|
|
|
+ var index = that.curBCBZ.bcbz.findIndex((t) => (t.id = row.id));
|
|
|
+ var formId = that.$layer.confirm(
|
|
|
+ "确定要删除吗?",
|
|
|
+ {},
|
|
|
+ function () {
|
|
|
+ delCqBcbzItem([row.id])
|
|
|
+ .then((res) => {
|
|
|
+ if (res) {
|
|
|
+ that.$message("数据已删除!");
|
|
|
+ if (index > -1) that.curBCBZ.bcbz.splice(index, 1);
|
|
|
+ that.$layer.close(formId);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ function () {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
/**
|
|
|
* 开启行编辑
|
|
@@ -558,46 +635,51 @@ export default {
|
|
|
// if (!this.chageBCBZ())
|
|
|
// return false;
|
|
|
// else {
|
|
|
- console.log(this.oldRow.bz)
|
|
|
- console.log(this.oldRow.grade)
|
|
|
+ console.log(this.oldRow.bz);
|
|
|
+ console.log(this.oldRow.grade);
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
-
|
|
|
if (valid) {
|
|
|
// alert('submit!');
|
|
|
this.editFormVisible = false;
|
|
|
this.updateItem();
|
|
|
// this.$layer.alert("保存完成");
|
|
|
- return true
|
|
|
+ return true;
|
|
|
} else {
|
|
|
console.log("error submit!!");
|
|
|
return false;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
// }
|
|
|
},
|
|
|
/**
|
|
|
- *
|
|
|
+ *
|
|
|
*/
|
|
|
updateItem() {
|
|
|
- var that = this
|
|
|
- var model =
|
|
|
- {
|
|
|
- "bz": that.oldRow.bz,
|
|
|
- "des": that.oldRow.des,
|
|
|
- "grade": that.oldRow.grade,
|
|
|
- "id": that.oldRow.id,
|
|
|
- "jg": that.oldRow.jg,
|
|
|
- "pid": that.oldRow.pid,
|
|
|
-
|
|
|
- }
|
|
|
- updateCqBcbzItem(model).then((res) => {
|
|
|
- if (res)
|
|
|
- that.$layer.alert("保存完成");
|
|
|
-
|
|
|
- }).catch((err) => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
+ var that = this;
|
|
|
+ var model = {
|
|
|
+ bz: that.oldRow.bz,
|
|
|
+ des: that.oldRow.des,
|
|
|
+ grade: that.oldRow.grade,
|
|
|
+ id: that.oldRow.id,
|
|
|
+ jg: that.oldRow.jg,
|
|
|
+ pid: that.oldRow.pid,
|
|
|
+ };
|
|
|
+ updateCqBcbzItem(model)
|
|
|
+ .then((res) => {
|
|
|
+ if (res) {
|
|
|
+ that.$layer.alert("保存完成");
|
|
|
+ debugger;
|
|
|
+ let bcbz = that.curBCBZ.bcbz.find((c) => c.id == model.id);
|
|
|
+ bcbz.bz = model.bz;
|
|
|
+ bcbz.des = model.des;
|
|
|
+ bcbz.grade = model.grade;
|
|
|
+ bcbz.jg = model.jg;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
},
|
|
|
/**
|
|
|
* 保存当前行
|
|
@@ -608,12 +690,12 @@ export default {
|
|
|
},
|
|
|
chageBCBZ() {
|
|
|
if (this.oldRow.grade < 1) {
|
|
|
- this.$message.warning('不能小于1');
|
|
|
- return false
|
|
|
+ this.$message.warning("不能小于1");
|
|
|
+ return false;
|
|
|
}
|
|
|
if (this.oldRow.bz < 0) {
|
|
|
- this.$message.warning('不能小于0');
|
|
|
- return false
|
|
|
+ this.$message.warning("不能小于0");
|
|
|
+ return false;
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
@@ -622,31 +704,32 @@ export default {
|
|
|
|
|
|
var formId = that.$layer.confirm("确定要删除吗?", {}, function () {
|
|
|
if (window.isUseDB) {
|
|
|
- delCqBcbz(that.bcbz).then((res) => {
|
|
|
- if (res) {
|
|
|
- that.$layer.alert("数据已删除");
|
|
|
- that.cqValue = "";
|
|
|
- that.bcbz = that.cqValue;
|
|
|
- that.getInitData();
|
|
|
- that.lyoption.content.parent.initSetting()
|
|
|
- }
|
|
|
- }).catch((err) => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- }
|
|
|
- else {
|
|
|
- var index = window.ZSBC.CQBCList.findIndex(t => t.id == that.bcbz);
|
|
|
+ delCqBcbz(that.bcbz)
|
|
|
+ .then((res) => {
|
|
|
+ if (res) {
|
|
|
+ that.$layer.alert("数据已删除");
|
|
|
+ that.cqValue = "";
|
|
|
+ that.bcbz = that.cqValue;
|
|
|
+ that.getInitData();
|
|
|
+ that.lyoption.content.parent.initSetting();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ var index = window.ZSBC.CQBCList.findIndex((t) => t.id == that.bcbz);
|
|
|
if (index > -1) {
|
|
|
window.ZSBC.CQBCList.splice(index, 1);
|
|
|
}
|
|
|
that.cqValue = "";
|
|
|
that.bcbz = that.cqValue;
|
|
|
- that.getInitData()
|
|
|
- that.lyoption.content.parent.initSetting()
|
|
|
+ that.getInitData();
|
|
|
+ that.lyoption.content.parent.initSetting();
|
|
|
}
|
|
|
- that.$layer.close(formId)
|
|
|
- })
|
|
|
- }
|
|
|
+ that.$layer.close(formId);
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -659,7 +742,7 @@ export default {
|
|
|
color: #02a7f0;
|
|
|
font-weight: 400;
|
|
|
} */
|
|
|
-.el-input>>>.el-input__inner {
|
|
|
+.el-input >>> .el-input__inner {
|
|
|
text-align: right !important;
|
|
|
}
|
|
|
|