|
|
|
@ -527,35 +527,35 @@ |
|
|
|
<div class="rq "> |
|
|
|
<el-table |
|
|
|
:height="400" |
|
|
|
:data="tableData" |
|
|
|
:data="templateTableData" |
|
|
|
border |
|
|
|
:row-class-name="rowClassName" |
|
|
|
@selection-change="handleDetailSelectionChange" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column type="selection" align="center" width="50"></el-table-column> |
|
|
|
<el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column> |
|
|
|
<el-table-column label="序号" align="center" prop="rowI" width="50"></el-table-column> |
|
|
|
<el-table-column prop="samplingLocation" header-align="center" align="center" :required="true" label="抽样位置A" width="150"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<el-input v-if="tableData[row.xh-1].isSubmit === 'Y'" v-model="tableData[row.xh-1].samplingLocation" readonly placeholder="请输入抽样位置A"></el-input> |
|
|
|
<el-input v-else :ref="`${row.xh-1}` + `a`" v-model="tableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" placeholder="请输入抽样位置A"></el-input> |
|
|
|
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocation" readonly placeholder="请输入抽样位置A"></el-input> |
|
|
|
<el-input v-else :ref="`${row.xh-1}` + `a`" v-model="templateTableData[row.xh-1].samplingLocation" @keyup.enter.native="nextFocus1(row.xh-1)" placeholder="请输入抽样位置A"></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="samplingLocationB" header-align="center" align="center" :required="true" label="抽样位置B" width="150"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<el-input v-if="tableData[row.xh-1].isSubmit === 'Y'" v-model="tableData[row.xh-1].samplingLocationB" readonly placeholder="请输入抽样位置B"></el-input> |
|
|
|
<el-input v-else :ref="`${row.xh-1}` + `b`" v-model="tableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" placeholder="请输入抽样位置B"></el-input> |
|
|
|
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].samplingLocationB" readonly placeholder="请输入抽样位置B"></el-input> |
|
|
|
<el-input v-else :ref="`${row.xh-1}` + `b`" v-model="templateTableData[row.xh-1].samplingLocationB" @keyup.enter.native="nextFocus2(row.xh-1)" placeholder="请输入抽样位置B"></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="subDetailValue" header-align="center" align="center" :required="true" label="实测值A" width="150"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<el-input v-if="tableData[row.xh-1].isSubmit === 'Y'" v-model="tableData[row.xh-1].subDetailValue" readonly placeholder="请输入实测值A"></el-input> |
|
|
|
<el-input v-else :ref="`${row.xh-1}` + `c`" v-model="tableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" placeholder="请输入实测值A"></el-input> |
|
|
|
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValue" readonly placeholder="请输入实测值A"></el-input> |
|
|
|
<el-input v-else :ref="`${row.xh-1}` + `c`" v-model="templateTableData[row.xh-1].subDetailValue" @keyup.enter.native="nextFocus3(row.xh-1)" placeholder="请输入实测值A"></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="subDetailValueB" header-align="center" align="center" :required="true" label="实测值B" width="150"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<el-input v-if="tableData[row.xh-1].isSubmit === 'Y'" v-model="tableData[row.xh-1].subDetailValueB" readonly placeholder="请输入实测值B"></el-input> |
|
|
|
<el-input v-else :ref="`${row.xh-1}` + `d`" v-model="tableData[row.xh-1].subDetailValueB" @keyup.enter.native="nextFocus4(row.xh-1)" placeholder="请输入实测值B"></el-input> |
|
|
|
<el-input v-if="templateTableData[row.xh-1].isSubmit === 'Y'" v-model="templateTableData[row.xh-1].subDetailValueB" readonly placeholder="请输入实测值B"></el-input> |
|
|
|
<el-input v-else :ref="`${row.xh-1}` + `d`" v-model="templateTableData[row.xh-1].subDetailValueB" @keyup.enter.native="nextFocus4(row.xh-1)" placeholder="请输入实测值B"></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -566,7 +566,7 @@ |
|
|
|
:current-page="pageIndex2" |
|
|
|
:page-sizes="[20, 50, 100, 200, 500]" |
|
|
|
:page-size="pageSize2" |
|
|
|
:total="totalPage2" |
|
|
|
:total="tableData.length" |
|
|
|
layout="total, sizes, prev, pager, next, jumper"> |
|
|
|
</el-pagination> |
|
|
|
</div> |
|
|
|
@ -965,6 +965,16 @@ |
|
|
|
comQcItemImageUploadFile, |
|
|
|
subDetailUpload |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
templateTableData () { |
|
|
|
let start = (this.pageIndex2 - 1) * this.pageSize2 |
|
|
|
let end = start + this.pageSize2 |
|
|
|
if (end > this.tableData.length){ |
|
|
|
end = this.tableData.length |
|
|
|
} |
|
|
|
return this.tableData.slice(start,end) |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
detailList: { |
|
|
|
deep: true, |
|
|
|
@ -3366,14 +3376,13 @@ |
|
|
|
// 子明细每页数 |
|
|
|
sizeChangeHandle2 (val) { |
|
|
|
this.pageSize2 = val |
|
|
|
this.pageIndex2 = 1 |
|
|
|
this.subDetailModal2() |
|
|
|
//this.subDetailModal2() |
|
|
|
}, |
|
|
|
|
|
|
|
// 子明细当前页 |
|
|
|
currentChangeHandle2 (val) { |
|
|
|
this.pageIndex2 = val |
|
|
|
this.subDetailModal2() |
|
|
|
//this.subDetailModal2() |
|
|
|
}, |
|
|
|
|
|
|
|
// 多选 |
|
|
|
@ -3589,14 +3598,10 @@ |
|
|
|
// 子明细记录信息查询 |
|
|
|
subDetailModal (row) { |
|
|
|
this.subDetailData = row |
|
|
|
this.subDetailData.limit = this.pageSize2 |
|
|
|
this.subDetailData.page = this.pageIndex2 |
|
|
|
this.pageIndex2 = 1 |
|
|
|
selectIPQCSubDetailedRecord(this.subDetailData).then(({data}) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.tableData = data.page.list |
|
|
|
this.pageIndex2 = data.page.currPage |
|
|
|
this.pageSize2 = data.page.pageSize |
|
|
|
this.totalPage2 = data.page.totalCount |
|
|
|
this.tableData = data.rows |
|
|
|
} |
|
|
|
}) |
|
|
|
this.batchAddData = { |
|
|
|
@ -3609,14 +3614,9 @@ |
|
|
|
|
|
|
|
// 子明细分页查询 |
|
|
|
subDetailModal2 () { |
|
|
|
this.subDetailData.limit = this.pageSize2 |
|
|
|
this.subDetailData.page = this.pageIndex2 |
|
|
|
selectIPQCSubDetailedRecord(this.subDetailData).then(({data}) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.tableData = data.page.list |
|
|
|
this.pageIndex2 = data.page.currPage |
|
|
|
this.pageSize2 = data.page.pageSize |
|
|
|
this.totalPage2 = data.page.totalCount |
|
|
|
this.tableData = data.rows |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
@ -3682,7 +3682,8 @@ |
|
|
|
// 子明细方法 |
|
|
|
// 表格的新增 |
|
|
|
rowClassName ({ row, rowIndex }) { |
|
|
|
row.xh = rowIndex + 1; |
|
|
|
row.xh = rowIndex + 1 |
|
|
|
row.rowI = this.tableData.indexOf(row) + 1 |
|
|
|
}, |
|
|
|
|
|
|
|
// 单选框选中数据 |
|
|
|
@ -3790,12 +3791,17 @@ |
|
|
|
if (action === "confirm") { |
|
|
|
let val = this.checkedDetail |
|
|
|
val.forEach((val, index) => { |
|
|
|
this.tableData.forEach((v, i) => { |
|
|
|
if (val.xh === v.xh) { |
|
|
|
this.tableData.splice(i, 1); |
|
|
|
// this.tableData.forEach((v, i) => { |
|
|
|
// if (val.xh === v.xh) { |
|
|
|
// this.tableData.splice(i, 1); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// console.log(this.tableData.indexOf(val)) |
|
|
|
this.tableData.splice(this.tableData.indexOf(val), 1) |
|
|
|
if (this.templateTableData.length === 0) { |
|
|
|
this.pageIndex2-- |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$message({ |
|
|
|
message: "删除成功!", |
|
|
|
type: "success", |
|
|
|
|