|
|
@@ -6,7 +6,8 @@
|
|
|
<el-button type="primary" @click="save" :loading="loading" v-if="type != 'detail'">保存</el-button>
|
|
|
<el-button type="primary" @click="handleReporting" :loading="loading" v-if="type != 'detail'">报工完成</el-button>
|
|
|
</header-title>
|
|
|
- <base-info ref="baseInfoRefs" v-if="form" :form="form" :btnType="type" :qualityType1="qualityType"></base-info>
|
|
|
+ <base-info ref="baseInfoRefs" v-if="form" :form="form" :btnType="type" :qualityType1="qualityType"
|
|
|
+ @changeModel="changeModel" @changeNumber="changeNumber"></base-info>
|
|
|
<el-row>
|
|
|
<header-title title="质检内容">
|
|
|
<el-button type="primary" :loading="loading" v-if="type != 'detail'"
|
|
|
@@ -18,22 +19,27 @@
|
|
|
<el-tab-pane label="质检方案" name="3"></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-row>
|
|
|
+ <!-- -->
|
|
|
<el-row style="margin-top: 24px">
|
|
|
<el-table v-show="activeName === '1'" v-if="packingList.length > 0" ref="showPackingListTable"
|
|
|
- :data="paginatedPackingList" tooltip-effect="dark" :max-height="300" border row-key="id">
|
|
|
+ :data="paginatedPackingList" tooltip-effect="dark" :max-height="300" border row-key="id"
|
|
|
+ @selection-change="handleSelectionChange1">
|
|
|
+ <el-table-column type="selection" width="55" align="center" :reserve-selection="true"
|
|
|
+ :selectable="checkSelectable"></el-table-column>
|
|
|
<el-table-column label="序号" type="index" width="50" align="center"></el-table-column>
|
|
|
<template v-for="column in tableColumns">
|
|
|
<el-table-column :label="column.label" :prop="column.prop" :show-overflow-tooltip="true"
|
|
|
:width="column.width" :align="column.align"></el-table-column>
|
|
|
</template>
|
|
|
</el-table>
|
|
|
+ <el-pagination v-show="activeName === '1' && packingList.length > 0" @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange" :current-page="pagination.currentPage" :page-sizes="[10, 20, 50, 100]"
|
|
|
+ :page-size="pagination.pageSize" layout="total, sizes, prev, pager, next" :total="packingList.length"
|
|
|
+ style="margin-top: 16px" />
|
|
|
<!-- -->
|
|
|
<el-table v-show="activeName === '2'" v-if="sampleList.length > 0" ref="showSampleListTable"
|
|
|
- :data="paginatedSampleList" tooltip-effect="dark" :max-height="300" border row-key="id"
|
|
|
- @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" fixed="left"></el-table-column>
|
|
|
+ :data="paginatedSampleList" tooltip-effect="dark" :max-height="300" border row-key="id">
|
|
|
<el-table-column label="序号" type="index" width="50" align="center" fixed="left"></el-table-column>
|
|
|
-
|
|
|
<template v-for="column in tableColumns">
|
|
|
<el-table-column :key="column.prop" :label="column.label" :prop="column.prop" :fixed="column.fixed"
|
|
|
:show-overflow-tooltip="true" :width="column.width" :align="column.align">
|
|
|
@@ -43,9 +49,6 @@
|
|
|
{{ scope.row.categoryCode }}
|
|
|
</el-link>
|
|
|
</template>
|
|
|
- <!-- <template v-else-if="column.prop === 'weight'">-->
|
|
|
- <!-- <el-input v-model="scope.row.weight"></el-input>-->
|
|
|
- <!-- </template>-->
|
|
|
<template v-else>
|
|
|
{{ scope.row[column.prop] }}
|
|
|
</template>
|
|
|
@@ -110,7 +113,6 @@
|
|
|
:page-sizes="[10, 20, 50, 100]" :page-size="samplePagination.pageSize"
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="sampleList.length"
|
|
|
style="margin-top: 10px"></el-pagination>
|
|
|
-
|
|
|
<!-- -->
|
|
|
<el-table v-show="activeName === '3'" ref="showSchemeListTable" :data="paginatedSchemeList"
|
|
|
tooltip-effect="dark" :max-height="300" border row-key="id">
|
|
|
@@ -319,6 +321,40 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
+ checkSelectable(row, index) {
|
|
|
+ // 只有当质检方式为抽检(qualityMode=2)时才可选
|
|
|
+ return this.form.qualityMode === 2;
|
|
|
+ },
|
|
|
+ changeModel(val) {
|
|
|
+ this.form.qualityMode = val;
|
|
|
+ if (this.form.qualityMode == 1) {
|
|
|
+ this.sampleList = this.packingList;
|
|
|
+ this.samplePagination.currentPage = 1;
|
|
|
+ this.samplePagination.total = this.packingList.length;
|
|
|
+ } else {
|
|
|
+ this.sampleList = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeNumber(val) {
|
|
|
+ if (this.form.qualityMode !== 2) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (val <= 0) {
|
|
|
+ this.$refs.showPackingListTable.clearSelection();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (val > this.packingList.length) {
|
|
|
+ this.$message.warning('取样数量不能大于物料明细总数!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const rows = this.packingList.slice(0, val);
|
|
|
+ rows.forEach((row) => {
|
|
|
+ this.$refs.showPackingListTable.toggleRowSelection(row);
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
getNowDate() {
|
|
|
let date = new Date(),
|
|
|
obj = {
|
|
|
@@ -334,9 +370,18 @@ export default {
|
|
|
});
|
|
|
return obj;
|
|
|
},
|
|
|
- handleSelectionChange(val) {
|
|
|
- console.log(val, '选中数据')
|
|
|
+ handleSelectionChange1(selection) {
|
|
|
+ console.log(selection, '勾选列表');
|
|
|
+ if (this.form.qualityMode === 2) {
|
|
|
+ this.selectedList = selection;
|
|
|
+
|
|
|
+ this.sampleList = selection;
|
|
|
+ this.samplePagination.currentPage = 1;
|
|
|
+ this.samplePagination.total = selection.length;
|
|
|
+ this.form.sampleNumber = selection.length;
|
|
|
+ }
|
|
|
},
|
|
|
+
|
|
|
async open() {
|
|
|
this.type = this.$route.query.type;
|
|
|
this.qualityType = this.$route.query.qualityType;
|
|
|
@@ -417,6 +462,15 @@ export default {
|
|
|
handleClick(tab) {
|
|
|
this.activeName = tab.name;
|
|
|
},
|
|
|
+ // 来料清单列表分页方法
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.pagination.pageSize = val;
|
|
|
+ this.pagination.currentPage = 1;
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.pagination.currentPage = val;
|
|
|
+ },
|
|
|
+
|
|
|
// 样品列表分页方法
|
|
|
handleSampleSizeChange(val) {
|
|
|
this.samplePagination.pageSize = val;
|