|
@@ -4,70 +4,87 @@
|
|
|
:close-on-press-escape="false" append-to-body width="80%" :maxable="true">
|
|
:close-on-press-escape="false" append-to-body width="80%" :maxable="true">
|
|
|
<header-title title="基本信息"></header-title>
|
|
<header-title title="基本信息"></header-title>
|
|
|
<base-info ref="baseInfoRefs" v-if="baseForm" :form="baseForm" :btnType="btnType" @resetTable="resetTable"
|
|
<base-info ref="baseInfoRefs" v-if="baseForm" :form="baseForm" :btnType="btnType" @resetTable="resetTable"
|
|
|
- @getList="getList" @changeModel="changeModel" @changeNumber="changeNumber" @table2="table2"></base-info>
|
|
|
|
|
|
|
+ @getList="getList" @changeModel="changeModel" @table2="table2" :packingLists="packingList"
|
|
|
|
|
+ @getCategoryInfo="getCategoryInfo"></base-info>
|
|
|
|
|
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<header-title title="质检内容"></header-title>
|
|
<header-title title="质检内容"></header-title>
|
|
|
|
|
+
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
- <el-tab-pane label="来源清单" name="1"></el-tab-pane>
|
|
|
|
|
- <el-tab-pane label="样品清单" name="2"></el-tab-pane>
|
|
|
|
|
- <el-tab-pane label="质检方案" name="3"></el-tab-pane>
|
|
|
|
|
|
|
+ <el-tab-pane label="来源清单" name="1">
|
|
|
|
|
+ <!-- 来料列表表格 -->
|
|
|
|
|
+ <ele-pro-table ref="table12" :columns="tableColumns" :datasource="datasource"
|
|
|
|
|
+ @selection-change="handleSelectionChange" :initLoad="false">
|
|
|
|
|
+ <template v-slot:toolbar>
|
|
|
|
|
+ <el-dropdown trigger="click" @command="handleSampleNumber">
|
|
|
|
|
+ <el-link type="primary" icon="el-icon-plus">取样</el-link>
|
|
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
|
|
+ <el-dropdown-item command="1">取整样</el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item command="2">取小样</el-dropdown-item>
|
|
|
|
|
+ </el-dropdown-menu>
|
|
|
|
|
+ </el-dropdown>
|
|
|
|
|
+
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:toolkit>
|
|
|
|
|
+ <template v-if="condition == 2">
|
|
|
|
|
+ <div style="display: flex;align-items: center;">
|
|
|
|
|
+ <el-input v-model="formData.number" style="width: 120px;" placeholder="请输入" size="mini"
|
|
|
|
|
+ @input="handleSampleSubmit"></el-input>
|
|
|
|
|
+ <DictSelection dictName="计量单位" clearable v-model="formData.sampleUnit" size="mini"
|
|
|
|
|
+ style="width: 120px;margin-left: 12px;" @change="handleSampleSubmit">
|
|
|
|
|
+ </DictSelection>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template>
|
|
|
|
|
+ <div style="margin-left: 12px;display: flex;align-items: center;">
|
|
|
|
|
+ <div>数量:</div>
|
|
|
|
|
+ <el-input v-model="formData.portion" style="width: 120px;margin:0 12px;" placeholder="请输入" size="mini"
|
|
|
|
|
+ @change="handleInput"></el-input>
|
|
|
|
|
+ <el-button type="primary" size="mini" @click="handleSampleSubmit"
|
|
|
|
|
+ style="margin-right: 12px;">确认</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </ele-pro-table>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ <el-tab-pane label="样品清单" name="2">
|
|
|
|
|
+ <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">
|
|
|
|
|
+ <el-table-column label="序号" type="index" width="50" align="center"></el-table-column>
|
|
|
|
|
+ <template v-for="column in tableColumns2">
|
|
|
|
|
+ <el-table-column label="样品编码" prop="sampleCode"></el-table-column>
|
|
|
|
|
+ <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 === '2' && sampleList.length > 0" @size-change="handleSampleSizeChange"
|
|
|
|
|
+ @current-change="handleSampleCurrentChange" :current-page="samplePagination.currentPage"
|
|
|
|
|
+ :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-tab-pane>
|
|
|
|
|
+ <el-tab-pane label="质检方案" name="3">
|
|
|
|
|
+ <el-table v-show="activeName === '3'" v-if="schemeList.length > 0" ref="showSchemeListTable"
|
|
|
|
|
+ :data="paginatedSchemeList" tooltip-effect="dark" :max-height="300" border row-key="id">
|
|
|
|
|
+ <el-table-column label="序号" type="index" width="50" align="center"></el-table-column>
|
|
|
|
|
+ <el-table-column label="质检方案编码" prop="qualitySchemeTemplateCode" align="center">
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="质检方案名称" prop="qualitySchemeTemplateName" align="center"></el-table-column>
|
|
|
|
|
+ <el-table-column label="质检类型" prop="categoryLevelClassName" align="center"></el-table-column>
|
|
|
|
|
+ <el-table-column label="质检项编码" prop="inspectionCode" align="center"></el-table-column>
|
|
|
|
|
+ <el-table-column label="质检项名称" prop="inspectionName" align="center"></el-table-column>
|
|
|
|
|
+ <el-table-column label="工艺参数" prop="defaultValue" align="center">
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <el-pagination v-show="activeName === '3' && schemeList.length > 0" @size-change="handleSchemeSizeChange"
|
|
|
|
|
+ @current-change="handleSchemeCurrentChange" :current-page="schemePagination.currentPage"
|
|
|
|
|
+ :page-sizes="[10, 20, 50, 100]" :page-size="schemePagination.pageSize"
|
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="schemeList.length"
|
|
|
|
|
+ style="margin-top: 10px"></el-pagination>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
</el-row>
|
|
</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
|
|
|
|
|
- @selection-change="handleSelectionChange" row-key="id">
|
|
|
|
|
- <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>
|
|
|
|
|
- <!-- label-class-name="DisabledSelection" -->
|
|
|
|
|
- <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">
|
|
|
|
|
- <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 === '2' && sampleList.length > 0" @size-change="handleSampleSizeChange"
|
|
|
|
|
- @current-change="handleSampleCurrentChange" :current-page="samplePagination.currentPage"
|
|
|
|
|
- :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'" v-if="schemeList.length > 0" ref="showSchemeListTable"
|
|
|
|
|
- :data="paginatedSchemeList" tooltip-effect="dark" :max-height="300" border row-key="id">
|
|
|
|
|
- <el-table-column label="序号" type="index" width="50" align="center"></el-table-column>
|
|
|
|
|
- <el-table-column label="质检方案编码" prop="qualitySchemeTemplateCode" align="center">
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="质检方案名称" prop="qualitySchemeTemplateName" align="center"></el-table-column>
|
|
|
|
|
- <el-table-column label="质检类型" prop="categoryLevelClassName" align="center"></el-table-column>
|
|
|
|
|
- <el-table-column label="质检项编码" prop="inspectionCode" align="center"></el-table-column>
|
|
|
|
|
- <el-table-column label="质检项名称" prop="inspectionName" align="center"></el-table-column>
|
|
|
|
|
- <el-table-column label="工艺参数" prop="defaultValue" align="center">
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
- <el-pagination v-show="activeName === '3' && schemeList.length > 0" @size-change="handleSchemeSizeChange"
|
|
|
|
|
- @current-change="handleSchemeCurrentChange" :current-page="schemePagination.currentPage"
|
|
|
|
|
- :page-sizes="[10, 20, 50, 100]" :page-size="schemePagination.pageSize"
|
|
|
|
|
- layout="total, sizes, prev, pager, next, jumper" :total="schemeList.length"
|
|
|
|
|
- style="margin-top: 10px"></el-pagination>
|
|
|
|
|
- </el-row>
|
|
|
|
|
-
|
|
|
|
|
<!-- <div class="add-product" @click="addProduct" v-if="btnType != 'detail'">
|
|
<!-- <div class="add-product" @click="addProduct" v-if="btnType != 'detail'">
|
|
|
<i class="el-icon-circle-plus-outline"></i>
|
|
<i class="el-icon-circle-plus-outline"></i>
|
|
|
</div> -->
|
|
</div> -->
|
|
@@ -82,6 +99,42 @@
|
|
|
下发
|
|
下发
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <ele-modal :visible.sync="takeAsampleVisible" title="选择取样信息" width="80vw" append-to-body @close="handleCancel"
|
|
|
|
|
+ :maxable="true">
|
|
|
|
|
+
|
|
|
|
|
+ <el-table ref="showSampleListTable" :data="selectedList" tooltip-effect="dark" :max-height="300" border
|
|
|
|
|
+ row-key="id" @selection-change="handleSelectionChange2">
|
|
|
|
|
+ <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
|
|
|
|
|
+ <el-table-column label="序号" type="index" width="50" align="center"></el-table-column>
|
|
|
|
|
+ <template v-for="column in tableColumns2">
|
|
|
|
|
+ <el-table-column :label="column.label" :prop="column.prop" :show-overflow-tooltip="true" :width="column.width"
|
|
|
|
|
+ :align="column.align">
|
|
|
|
|
+ <!-- <template slot-scope="scope">
|
|
|
|
|
+ <template v-if="column.prop === 'measureQuantity'">
|
|
|
|
|
+ <el-input v-model="scope.row.measureQuantity" type="number"></el-input>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else-if="column.prop === 'measureUnit'">
|
|
|
|
|
+ <DictSelection dictName="计量单位" clearable v-model="scope.row.measureUnit">
|
|
|
|
|
+ </DictSelection>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else-if="column.prop === 'isUnpack'">
|
|
|
|
|
+ <el-switch v-model="scope.row.isUnpack">
|
|
|
|
|
+ </el-switch>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ {{ scope.row[column.prop] }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </template> -->
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <div style="width: 100%;text-align: right;margin-top: 12px;">
|
|
|
|
|
+ <el-button type="primary" @click="handleConfirm">确定</el-button>
|
|
|
|
|
+ <el-button @click="handleCancel">取消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </ele-modal>
|
|
|
</ele-modal>
|
|
</ele-modal>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -135,6 +188,7 @@ export default {
|
|
|
qualificationRate: '',
|
|
qualificationRate: '',
|
|
|
totalWeight: '',
|
|
totalWeight: '',
|
|
|
sampleNumber: null,
|
|
sampleNumber: null,
|
|
|
|
|
+ sampleMeasureUnit: '',
|
|
|
sampleProportion: '',
|
|
sampleProportion: '',
|
|
|
supplierMark: '',
|
|
supplierMark: '',
|
|
|
// planReceiveId: '',
|
|
// planReceiveId: '',
|
|
@@ -148,6 +202,77 @@ export default {
|
|
|
// 表单数据
|
|
// 表单数据
|
|
|
baseForm: { ...defaultForm() },
|
|
baseForm: { ...defaultForm() },
|
|
|
tableColumns: [
|
|
tableColumns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'selection',
|
|
|
|
|
+ type: 'selection',
|
|
|
|
|
+ width: 45,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ selectable: (row, index) => {
|
|
|
|
|
+ // 只有当质检方式为抽检(qualityMode=2)时才可选
|
|
|
|
|
+ return this.btnType != 'issued' || this.baseForm.qualityMode === 2;
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'index',
|
|
|
|
|
+ label: '序号',
|
|
|
|
|
+ type: 'index',
|
|
|
|
|
+ width: 55,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ fixed: 'left'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '编码',
|
|
|
|
|
+ prop: 'categoryCode',
|
|
|
|
|
+ width: 150,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '名称',
|
|
|
|
|
+ prop: 'categoryName',
|
|
|
|
|
+ width: '150',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ { label: '批次号', prop: 'batchNo', align: 'center' },
|
|
|
|
|
+ { label: '发货条码', prop: 'barcodes', align: 'center' },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '包装编码', prop: 'packageNo', align: 'center',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ { label: '包装数量', prop: 'packingQuantity', align: 'center' },
|
|
|
|
|
+ { label: '包装单位', prop: 'packingUnit', align: 'center' },
|
|
|
|
|
+ { label: '计量数量', prop: 'measureQuantity', align: 'center' },
|
|
|
|
|
+ { label: '计量单位', prop: 'measureUnit', align: 'center' },
|
|
|
|
|
+ { label: '物料代号', prop: 'materielDesignation', align: 'center' },
|
|
|
|
|
+ { label: '客户代号', prop: 'clientCode', align: 'center' },
|
|
|
|
|
+ { label: '供应商名称', prop: 'supplierName', align: 'center', width: '120' },
|
|
|
|
|
+ { label: '供应商代号', prop: 'supplierCode', align: 'center', width: '120' },
|
|
|
|
|
+ { label: '刻码', prop: 'engrave', align: 'center' },
|
|
|
|
|
+ { label: '重量', prop: 'weight', align: 'center' },
|
|
|
|
|
+ { label: '重量单位', prop: 'weightUnit', align: 'center' },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '仓库', prop: 'warehouseName', align: 'center',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ { label: '货区', prop: 'areaName', align: 'center' },
|
|
|
|
|
+ { label: '货架', prop: 'goodsShelfName', align: 'center' },
|
|
|
|
|
+ { label: '货位', prop: 'goodsAllocationName', align: 'center' },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '生产日期', prop: 'productionDate', align: 'center',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '采购日期', prop: 'purchaseDate', align: 'center',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ tableColumns2: [
|
|
|
{
|
|
{
|
|
|
label: '编码',
|
|
label: '编码',
|
|
|
prop: 'categoryCode',
|
|
prop: 'categoryCode',
|
|
@@ -163,14 +288,12 @@ export default {
|
|
|
{ label: '批次号', prop: 'batchNo', align: 'center' },
|
|
{ label: '批次号', prop: 'batchNo', align: 'center' },
|
|
|
{ label: '发货条码', prop: 'barcodes', align: 'center' },
|
|
{ label: '发货条码', prop: 'barcodes', align: 'center' },
|
|
|
{ label: '包装编码', prop: 'packageNo', align: 'center' },
|
|
{ label: '包装编码', prop: 'packageNo', align: 'center' },
|
|
|
- // { label: '包装数量', prop: 'packingQuantity', align: 'center' },
|
|
|
|
|
- { label: '包装单位', prop: 'packingUnit', align: 'center' },
|
|
|
|
|
{ label: '计量数量', prop: 'measureQuantity', align: 'center' },
|
|
{ label: '计量数量', prop: 'measureQuantity', align: 'center' },
|
|
|
{ label: '计量单位', prop: 'measureUnit', align: 'center' },
|
|
{ label: '计量单位', prop: 'measureUnit', align: 'center' },
|
|
|
{ label: '物料代号', prop: 'materielDesignation', align: 'center' },
|
|
{ label: '物料代号', prop: 'materielDesignation', align: 'center' },
|
|
|
{ label: '客户代号', prop: 'clientCode', align: 'center' },
|
|
{ label: '客户代号', prop: 'clientCode', align: 'center' },
|
|
|
- { label: '供应商名称', prop: 'supplierName', align: 'center' ,width: '120' },
|
|
|
|
|
- { label: '供应商代号', prop: 'supplierCode', align: 'center' ,width: '120'},
|
|
|
|
|
|
|
+ // { label: '供应商名称', prop: 'supplierName', align: 'center', width: '120' },
|
|
|
|
|
+ // { label: '供应商代号', prop: 'supplierCode', align: 'center', width: '120' },
|
|
|
{ label: '刻码', prop: 'engrave', align: 'center' },
|
|
{ label: '刻码', prop: 'engrave', align: 'center' },
|
|
|
{ label: '重量', prop: 'weight', align: 'center' },
|
|
{ label: '重量', prop: 'weight', align: 'center' },
|
|
|
{ label: '重量单位', prop: 'weightUnit', align: 'center' },
|
|
{ label: '重量单位', prop: 'weightUnit', align: 'center' },
|
|
@@ -182,11 +305,6 @@ export default {
|
|
|
{ label: '采购日期', prop: 'purchaseDate', align: 'center' }
|
|
{ label: '采购日期', prop: 'purchaseDate', align: 'center' }
|
|
|
],
|
|
],
|
|
|
packingList: [],
|
|
packingList: [],
|
|
|
- pagination: {
|
|
|
|
|
- currentPage: 1,
|
|
|
|
|
- pageSize: 10,
|
|
|
|
|
- total: 0
|
|
|
|
|
- },
|
|
|
|
|
|
|
|
|
|
sampleList: [],
|
|
sampleList: [],
|
|
|
samplePagination: {
|
|
samplePagination: {
|
|
@@ -211,16 +329,22 @@ export default {
|
|
|
|
|
|
|
|
activeName: '1',
|
|
activeName: '1',
|
|
|
selectedList: [],
|
|
selectedList: [],
|
|
|
- isCheck: false
|
|
|
|
|
|
|
+ isCheck: false,
|
|
|
|
|
+
|
|
|
|
|
+ rowIds: '',
|
|
|
|
|
+
|
|
|
|
|
+ takeAsampleVisible: false,
|
|
|
|
|
+ confirmSampleData: [],
|
|
|
|
|
+ formData: {
|
|
|
|
|
+ number: 1,
|
|
|
|
|
+ sampleUnit: '',
|
|
|
|
|
+ portion: null
|
|
|
|
|
+ },
|
|
|
|
|
+ condition: null,
|
|
|
|
|
+ isConsumable: '',
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
- paginatedPackingList() {
|
|
|
|
|
- const start =
|
|
|
|
|
- (this.pagination.currentPage - 1) * this.pagination.pageSize;
|
|
|
|
|
- const end = start + this.pagination.pageSize;
|
|
|
|
|
- return this.packingList.slice(start, end);
|
|
|
|
|
- },
|
|
|
|
|
// 分页后的样品列表
|
|
// 分页后的样品列表
|
|
|
paginatedSampleList() {
|
|
paginatedSampleList() {
|
|
|
const { currentPage, pageSize } = this.samplePagination;
|
|
const { currentPage, pageSize } = this.samplePagination;
|
|
@@ -239,16 +363,27 @@ export default {
|
|
|
|
|
|
|
|
created() { },
|
|
created() { },
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ async datasource({ page, limit, where }) {
|
|
|
|
|
+
|
|
|
|
|
+ const res = await getInventoryListByPlanId({ ...where, page, limit });
|
|
|
|
|
+
|
|
|
|
|
+ if (res.list.length > 1) {
|
|
|
|
|
+ this.isCheck = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.isCheck = false
|
|
|
|
|
+ }
|
|
|
|
|
+ this.packingList = res.list;
|
|
|
|
|
+ console.log(this.packingList, '===========================================this.packingList')
|
|
|
|
|
+ return res.list;
|
|
|
|
|
+ },
|
|
|
// 切换质检内容
|
|
// 切换质检内容
|
|
|
handleClick(tab) {
|
|
handleClick(tab) {
|
|
|
this.activeName = tab.name;
|
|
this.activeName = tab.name;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- checkSelectable(row, index) {
|
|
|
|
|
- // 只有当质检方式为抽检(qualityMode=2)时才可选
|
|
|
|
|
- return this.btnType != 'issued' || this.baseForm.qualityMode === 2;
|
|
|
|
|
- },
|
|
|
|
|
async open(type, row) {
|
|
async open(type, row) {
|
|
|
|
|
+ this.visible = true;
|
|
|
|
|
+
|
|
|
this.activeName = '1';
|
|
this.activeName = '1';
|
|
|
this.btnType = type;
|
|
this.btnType = type;
|
|
|
this.title =
|
|
this.title =
|
|
@@ -287,41 +422,35 @@ export default {
|
|
|
}
|
|
}
|
|
|
// 如果是编辑或者详情,则查询物料清单、质检方案和样品列表
|
|
// 如果是编辑或者详情,则查询物料清单、质检方案和样品列表
|
|
|
if (row.id) {
|
|
if (row.id) {
|
|
|
- // this.getGoodsList(
|
|
|
|
|
- // this.baseForm?.planSourceCode,
|
|
|
|
|
- // this.baseForm?.productCode,
|
|
|
|
|
- // row?.id
|
|
|
|
|
- // );
|
|
|
|
|
|
|
+ this.rowIds = row.id;
|
|
|
|
|
+
|
|
|
//操作行点击时查询清单
|
|
//操作行点击时查询清单
|
|
|
- await this.getInventoryList(row?.id);
|
|
|
|
|
- //操作行点击时查询质检
|
|
|
|
|
- await this.getTemplateList(row?.id);
|
|
|
|
|
|
|
+ // await this.getInventoryList();
|
|
|
|
|
+ await this.reload({ planId: row.id });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//操作行点击时查询样品
|
|
//操作行点击时查询样品
|
|
|
await this.getSampleList(row?.id);
|
|
await this.getSampleList(row?.id);
|
|
|
|
|
+ //操作行点击时查询质检
|
|
|
|
|
+ await this.getTemplateList(row?.id);
|
|
|
|
|
|
|
|
- if (this.baseForm.qualityMode == 1) {
|
|
|
|
|
- this.sampleList = this.packingList;
|
|
|
|
|
- this.samplePagination.currentPage = 1;
|
|
|
|
|
- this.samplePagination.total = this.packingList.length;
|
|
|
|
|
- } else {
|
|
|
|
|
- this.sampleList = [];
|
|
|
|
|
|
|
+ if (this.baseForm.productId) {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.baseInfoRefs.getProductDetails(this.baseForm.productId)
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
const code = await getCode('qms_plan_code');
|
|
const code = await getCode('qms_plan_code');
|
|
|
this.baseForm.code = code;
|
|
this.baseForm.code = code;
|
|
|
}
|
|
}
|
|
|
- this.visible = true;
|
|
|
|
|
- },
|
|
|
|
|
- async getInventoryList(id) {
|
|
|
|
|
- let res = await getInventoryListByPlanId({
|
|
|
|
|
- planId: id
|
|
|
|
|
- });
|
|
|
|
|
- console.log(res.list, 'yyyyyyyyyyyyyy清单----------------------------');
|
|
|
|
|
|
|
|
|
|
- this.packingList = res?.list || [];
|
|
|
|
|
- this.pagination.currentPage = 1;
|
|
|
|
|
- this.pagination.total = this.packingList.length;
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ reload(where) {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ if (this.$refs.table12 && this.$refs.table12.reload)
|
|
|
|
|
+ this.$refs.table12.reload({ page: 1, where: where });
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
async getSampleList(id) {
|
|
async getSampleList(id) {
|
|
|
let res = await getSampleListByPlanId({
|
|
let res = await getSampleListByPlanId({
|
|
@@ -343,14 +472,14 @@ export default {
|
|
|
this.schemePagination.currentPage = 1;
|
|
this.schemePagination.currentPage = 1;
|
|
|
this.schemePagination.total = this.schemeList.length;
|
|
this.schemePagination.total = this.schemeList.length;
|
|
|
},
|
|
},
|
|
|
- async getList(receiveNo, productCode, productCategoryId, productCategoryName, categoryid, batchNo,supplierName, supplierMark) {
|
|
|
|
|
|
|
+ async getList(receiveNo, productCode, productCategoryId, productCategoryName, categoryid, batchNo, supplierName, supplierMark) {
|
|
|
//通过来源和产品 获取来料清单
|
|
//通过来源和产品 获取来料清单
|
|
|
- await this.getGoodsList(receiveNo, productCode, null, productCategoryId, productCategoryName, categoryid, batchNo,supplierName, supplierMark);
|
|
|
|
|
|
|
+ await this.getGoodsList(receiveNo, productCode, null, productCategoryId, productCategoryName, categoryid, batchNo, supplierName, supplierMark);
|
|
|
|
|
|
|
|
//通过来源和产品 获取质检方案
|
|
//通过来源和产品 获取质检方案
|
|
|
this.getQualityTemplate(productCode);
|
|
this.getQualityTemplate(productCode);
|
|
|
},
|
|
},
|
|
|
- async getGoodsList(receiveNo, productCode, ids, productCategoryId, productCategoryName, categoryid, batchNo,supplierName, supplierMark) {
|
|
|
|
|
|
|
+ async getGoodsList(receiveNo, productCode, ids, productCategoryId, productCategoryName, categoryid, batchNo, supplierName, supplierMark) {
|
|
|
let res;
|
|
let res;
|
|
|
const res1 = await outInRecordsPage({
|
|
const res1 = await outInRecordsPage({
|
|
|
sourceBizNo: receiveNo,
|
|
sourceBizNo: receiveNo,
|
|
@@ -363,11 +492,6 @@ export default {
|
|
|
if (res1.list.length > 0) {
|
|
if (res1.list.length > 0) {
|
|
|
console.log(res1.list[0].status, 'status=2 不赋值')
|
|
console.log(res1.list[0].status, 'status=2 不赋值')
|
|
|
if (res1.list[0].status != 2) {
|
|
if (res1.list[0].status != 2) {
|
|
|
- // res1.list.forEach(item => ({
|
|
|
|
|
- // ...item,
|
|
|
|
|
- // supplierName :supplierName,
|
|
|
|
|
- // supplierMark :supplierMark,
|
|
|
|
|
- // }))
|
|
|
|
|
res = res1.list
|
|
res = res1.list
|
|
|
this.isCheck = true;
|
|
this.isCheck = true;
|
|
|
} else {
|
|
} else {
|
|
@@ -385,8 +509,6 @@ export default {
|
|
|
if (resData) {
|
|
if (resData) {
|
|
|
if (resData.qualityControl != 2) {
|
|
if (resData.qualityControl != 2) {
|
|
|
this.isCheck = false;
|
|
this.isCheck = false;
|
|
|
- // resData.supplierName = supplierName;
|
|
|
|
|
- // resData.supplierMark = supplierMark;
|
|
|
|
|
res = [resData];
|
|
res = [resData];
|
|
|
} else {
|
|
} else {
|
|
|
res = []
|
|
res = []
|
|
@@ -410,7 +532,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
this.packingList = _arr1;
|
|
this.packingList = _arr1;
|
|
|
this.pagination.total = this.packingList.length;
|
|
this.pagination.total = this.packingList.length;
|
|
|
- console.log(this.packingList, '来料清单');
|
|
|
|
|
|
|
+
|
|
|
if (this.packingList.length > 1) {
|
|
if (this.packingList.length > 1) {
|
|
|
this.baseForm.productNumber = this.packingList.length;
|
|
this.baseForm.productNumber = this.packingList.length;
|
|
|
} else {
|
|
} else {
|
|
@@ -527,24 +649,13 @@ export default {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
|
- if (this.baseForm.qualityMode === 2) {
|
|
|
|
|
- this.selectedList = selection;
|
|
|
|
|
-
|
|
|
|
|
- this.sampleList = selection;
|
|
|
|
|
- // console.log(this.sampleList, 'sampleList勾选列表')
|
|
|
|
|
- // this.samplePagination.currentPage = 1;
|
|
|
|
|
- // this.samplePagination.total = selection.length;
|
|
|
|
|
- this.baseForm.sampleNumber = selection.length;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ console.log(selection, 'gouxuan')
|
|
|
|
|
|
|
|
- // 来料清单列表分页方法
|
|
|
|
|
- handleSizeChange(val) {
|
|
|
|
|
- this.pagination.pageSize = val;
|
|
|
|
|
- this.pagination.currentPage = 1;
|
|
|
|
|
- },
|
|
|
|
|
- handleCurrentChange(val) {
|
|
|
|
|
- this.pagination.currentPage = val;
|
|
|
|
|
|
|
+ this.selectedList = selection;
|
|
|
|
|
+
|
|
|
|
|
+ this.formData.portion = selection.length;
|
|
|
|
|
+
|
|
|
|
|
+ this.baseForm.sampleNumber = selection.length;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 样品列表分页方法
|
|
// 样品列表分页方法
|
|
@@ -566,6 +677,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
changeModel(val) {
|
|
changeModel(val) {
|
|
|
this.baseForm.qualityMode = val;
|
|
this.baseForm.qualityMode = val;
|
|
|
|
|
+ this.baseForm.sampleNumber = ''
|
|
|
console.log(this.baseForm.productNumber, 'productNumberproductNumber数量')
|
|
console.log(this.baseForm.productNumber, 'productNumberproductNumber数量')
|
|
|
if (this.baseForm.qualityMode == 1) {
|
|
if (this.baseForm.qualityMode == 1) {
|
|
|
this.aaa()
|
|
this.aaa()
|
|
@@ -574,45 +686,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- changeNumber(val) {
|
|
|
|
|
- if (this.baseForm.qualityMode !== 2) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (val <= 0) {
|
|
|
|
|
- this.$refs.showPackingListTable.clearSelection();
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- console.log('取样数量', val, this.isCheck)
|
|
|
|
|
-
|
|
|
|
|
- if (this.isCheck) {
|
|
|
|
|
- if (val > this.packingList.length) {
|
|
|
|
|
- this.$message.warning('取样数量不能大于来源清单数量!');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- const rows = this.packingList.slice(0, val);
|
|
|
|
|
- rows.forEach((row) => {
|
|
|
|
|
- this.$refs.showPackingListTable.toggleRowSelection(row);
|
|
|
|
|
- });
|
|
|
|
|
- if (this.baseForm.qualityMode == 1) {
|
|
|
|
|
- this.sampleList = this.packingList;
|
|
|
|
|
- this.samplePagination.currentPage = 1;
|
|
|
|
|
- this.samplePagination.total = this.packingList.length;
|
|
|
|
|
- } else {
|
|
|
|
|
- this.sampleList = this.selectedList;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- } else {
|
|
|
|
|
- if (val > this.packingList[0].measureQuantity) {
|
|
|
|
|
- this.$message.warning('取样数量不能大于计量数量!');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- const num = Number(val);
|
|
|
|
|
- if (num) {
|
|
|
|
|
- this.getUnpackSamList(this.packingList, num);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
resetTable() {
|
|
resetTable() {
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.table1();
|
|
this.table1();
|
|
@@ -718,7 +791,117 @@ export default {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSampleNumber(val) {
|
|
|
|
|
+
|
|
|
|
|
+ this.condition = val;
|
|
|
|
|
+
|
|
|
|
|
+ if (this.selectedList.length == 0) {
|
|
|
|
|
+ this.$message.warning('请先选择样品!');
|
|
|
|
|
+ return
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (val == 1) {
|
|
|
|
|
+ this.sampleList = this.selectedList
|
|
|
|
|
+ this.activeName = '2'
|
|
|
|
|
+ this.$message.success('取样成功!');
|
|
|
|
|
+ return;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (this.formData.number == null && this.formData.sampleUnit == '') {
|
|
|
|
|
+ this.$message.warning('请先选择取样的数量和单位!');
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$refs.table.clearSelection();
|
|
|
|
|
+ },
|
|
|
|
|
+ handleInput() {
|
|
|
|
|
+ if (this.formData.portion == null || this.formData.portion == '' || this.formData.portion == 0) {
|
|
|
|
|
+ debugger;
|
|
|
|
|
+ this.$message.warning('生成取样数量不能为空!');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ console.log(this.isCheck, 'this.isCheck')
|
|
|
|
|
+ if (this.isCheck) {
|
|
|
|
|
+ if (this.formData.portion > this.packingList.length) {
|
|
|
|
|
+ this.$message.warning('取样数量不能大于来源清单数量!');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const rows = this.packingList.slice(0, this.formData.portion);
|
|
|
|
|
+ rows.forEach((row) => {
|
|
|
|
|
+ this.$refs.table.toggleRowSelection(row);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (this.formData.portion > this.packingList[0].measureQuantity) {
|
|
|
|
|
+ this.$message.warning('取样数量不能大于计量数量!');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ getNewSampleList(measureQ, unit, nums) {
|
|
|
|
|
+ this.sampleList = [];
|
|
|
|
|
+ let data = [];
|
|
|
|
|
+
|
|
|
|
|
+ this.selectedList.forEach(oldItem => {
|
|
|
|
|
+
|
|
|
|
|
+ delete oldItem.id;
|
|
|
|
|
+
|
|
|
|
|
+ for (let i = 0; i < nums; i++) {
|
|
|
|
|
+ data.push({
|
|
|
|
|
+ ...oldItem,
|
|
|
|
|
+ measureQuantity: measureQ,
|
|
|
|
|
+ measureUnit: unit
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ console.log(data, 'datadatadatadatadatadata', nums)
|
|
|
|
|
+
|
|
|
|
|
+ this.sampleList = data;
|
|
|
|
|
+ },
|
|
|
|
|
+ getCategoryInfo(val) {
|
|
|
|
|
+ this.isConsumable = val.isConsumable;
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSampleSubmit() {
|
|
|
|
|
+
|
|
|
|
|
+ if (this.formData.portion == null || this.formData.portion == 0) {
|
|
|
|
|
+ this.$message.warning('生成取样数量不能为空!');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.baseForm.sampleMeasureUnit = this.formData.sampleUnit
|
|
|
|
|
+ if (this.condition == 1) {
|
|
|
|
|
+ this.sampleList = this.selectedList
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let measureQ = this.formData.number;
|
|
|
|
|
+ let unit = this.formData.sampleUnit;
|
|
|
|
|
+ let nums = Number(this.formData.portion);
|
|
|
|
|
+
|
|
|
|
|
+ this.getNewSampleList(measureQ, unit, nums)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.activeName = '2'
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ handleCancel() {
|
|
|
|
|
+ this.takeAsampleVisible = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSelectionChange2(selection) {
|
|
|
|
|
+ console.log(selection, '123')
|
|
|
|
|
+ this.confirmSampleData = selection;
|
|
|
|
|
+ },
|
|
|
|
|
+ handleConfirm() {
|
|
|
|
|
+
|
|
|
|
|
+ //赋值取样数量和取样单位
|
|
|
|
|
+ // this.baseForm.sampleNumber = this.sampleData[0].measureQuantity
|
|
|
|
|
+ // this.baseForm.sampleMeasureUnit = this.sampleData[0].measureUnit
|
|
|
|
|
+ if (this.confirmSampleData.length > 0) {
|
|
|
|
|
+ this.sampleList = this.confirmSampleData;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.sampleList = this.selectedList;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.takeAsampleVisible = false;
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|