f1db964d by 杨威
2 parents 05c5cd69 ecf4e521
......@@ -2,13 +2,13 @@
<div class="main">
<div class="button">
<el-button type="primary" @click="oneExit">编辑</el-button>
<el-button type="primary">保存</el-button>
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="batchExit">批量修改</el-button>
</div>
<div class="table">
<table border="1">
<tr>
<td><input type="checkbox" @click="allcheck"/></td>
<td><input type="checkbox" @click="allcheck" v-model="isCheckAll"/></td>
<td>界址点号</td>
<td>顺序号</td>
<td>X坐标值</td>
......@@ -17,11 +17,13 @@
<td>界址点类型</td>
</tr>
<tr v-for="(item,index) in jzdlist" :key="index">
<td><input type="checkbox" v-model="item.isCheck"/></td>
<td><input type="checkbox" v-model="item.isCheck" @change="changeAll"/></td>
<td><input type="text" class="formInput" v-model="item.jzdh" readonly="readonly"/></td>
<td><input type="text" class="formInput" v-model="item.sxh" readonly="readonly"/></td>
<td><input type="text" class="formInput" v-model="item.xzbz" :readonly="item.iszb"/></td>
<td><input tepe="text" class="formInput" v-model="item.yzbz" :readonly="item.iszb"/></td>
<td><input type="text" class="formInput" v-model="item.xzbz" :readonly="item.iszb"
@keydown="oninput"/></td>
<td><input tepe="text" class="formInput" v-model="item.yzbz" :readonly="item.iszb"
@keydown="oninput"/></td>
<td>
<el-select v-model="item.jblx" :disabled="item.jbisdisabled">
<el-option
......@@ -94,6 +96,7 @@
props: {},
data() {
return {
isCheckAll: false,
centerDialogVisible: false,
jblx: [
{
......@@ -191,7 +194,6 @@
// 该标识码继承过来
let bsm = '401044005bad0557d5e3787239d8e18e';
queryjzd(bsm).then(res => {
debugger
for (let i = 0; i < res.result.length; i++) {
res.result[i]['isCheck'] = false;
res.result[i]['iszb'] = 'readonly';
......@@ -202,16 +204,40 @@
})
},
methods: {
save() {
console.log("保存....");
for (let item of this.jzdlist) {
if (item.isCheck) {
item.iszb = 'readonly';
item.jbisdisabled = true;
item.jzdisdisabled = true;
}
}
},
oninput(e) {
e.target.value = (e.target.value.match(/^\d*(\.?\d{0,0})/g)[0]) || null
},
changeAll(e) {
if (!e.target.checked) {
console.log("11111")
this.isCheckAll = false;
return
}
for (let item of this.jzdlist) {
if (!item.isCheck) {
this.isCheckAll = false;
return
}
}
this.isCheckAll = true;
},
allcheck(value) {
for (let item of this.jzdlist) {
item.isCheck = value.target.checked;
}
},
oneExit() {
console.log("oneExit......")
console.log(this.jzdlist)
for (let item of this.jzdlist) {
console.log(item)
if (item.isCheck) {
item.iszb = false;
item.jbisdisabled = false;
......