|
@@ -22,6 +22,7 @@
|
|
|
|
|
|
|
|
<unqualified-product-review ref="unqualifiedProductReviewRef" />
|
|
<unqualified-product-review ref="unqualifiedProductReviewRef" />
|
|
|
<product-release-approval ref="productReleaseApproval" />
|
|
<product-release-approval ref="productReleaseApproval" />
|
|
|
|
|
+ <sampling-form ref="samplingForm" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -29,11 +30,15 @@
|
|
|
import printSelector from '../printSelector.vue';
|
|
import printSelector from '../printSelector.vue';
|
|
|
import unqualifiedProductReview from '../../print/electrodeBatchRecord/unqualifiedProductReview.vue';
|
|
import unqualifiedProductReview from '../../print/electrodeBatchRecord/unqualifiedProductReview.vue';
|
|
|
import productReleaseApproval from '../../print/electrodeBatchRecord/productReleaseApproval.vue';
|
|
import productReleaseApproval from '../../print/electrodeBatchRecord/productReleaseApproval.vue';
|
|
|
|
|
+ import samplingForm from '../../print/electrodeBatchRecord/samplingForm.vue';
|
|
|
import {
|
|
import {
|
|
|
checklistrecordPage,
|
|
checklistrecordPage,
|
|
|
checklistrecordQueryPrint
|
|
checklistrecordQueryPrint
|
|
|
} from '@/api/checklistrecord/index';
|
|
} from '@/api/checklistrecord/index';
|
|
|
- import { samplingRecordsPage } from '@/api/samplingRecords';
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ samplingRecordsPage,
|
|
|
|
|
+ querySamplingPrint
|
|
|
|
|
+ } from '@/api/samplingRecords';
|
|
|
import {
|
|
import {
|
|
|
getList as unacceptedProductPage,
|
|
getList as unacceptedProductPage,
|
|
|
queryPrint as queryUnacceptedProductPrint
|
|
queryPrint as queryUnacceptedProductPrint
|
|
@@ -43,6 +48,10 @@
|
|
|
import { recordingMethodList } from '@/utils/util.js';
|
|
import { recordingMethodList } from '@/utils/util.js';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import { buildReleaseOrderPrintData } from '../../utils/releaseOrderPrint';
|
|
import { buildReleaseOrderPrintData } from '../../utils/releaseOrderPrint';
|
|
|
|
|
+ import {
|
|
|
|
|
+ buildSamplingFormPrintData,
|
|
|
|
|
+ getSamplingPrintIds
|
|
|
|
|
+ } from '../../utils/samplingFormPrint';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'pendingBatchRecordTable',
|
|
name: 'pendingBatchRecordTable',
|
|
@@ -50,7 +59,8 @@
|
|
|
components: {
|
|
components: {
|
|
|
printSelector,
|
|
printSelector,
|
|
|
unqualifiedProductReview,
|
|
unqualifiedProductReview,
|
|
|
- productReleaseApproval
|
|
|
|
|
|
|
+ productReleaseApproval,
|
|
|
|
|
+ samplingForm
|
|
|
},
|
|
},
|
|
|
props: {
|
|
props: {
|
|
|
tableQuery: {
|
|
tableQuery: {
|
|
@@ -81,6 +91,13 @@
|
|
|
code: 'ZL-065'
|
|
code: 'ZL-065'
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
|
|
+ samplePrintOptions: [
|
|
|
|
|
+ {
|
|
|
|
|
+ key: 'samplingForm',
|
|
|
|
|
+ label: '取样单',
|
|
|
|
|
+ code: 'ZL-041'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
disposeList: []
|
|
disposeList: []
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -98,6 +115,9 @@
|
|
|
return `batchRecord-${this.tableType || 'pending'}-table`;
|
|
return `batchRecord-${this.tableType || 'pending'}-table`;
|
|
|
},
|
|
},
|
|
|
printOptions() {
|
|
printOptions() {
|
|
|
|
|
+ if (this.isSample) {
|
|
|
|
|
+ return this.samplePrintOptions;
|
|
|
|
|
+ }
|
|
|
if (this.isReleaseOrder) {
|
|
if (this.isReleaseOrder) {
|
|
|
return this.releaseOrderPrintOptions;
|
|
return this.releaseOrderPrintOptions;
|
|
|
}
|
|
}
|
|
@@ -333,6 +353,13 @@
|
|
|
|
|
|
|
|
if (this.isSample) {
|
|
if (this.isSample) {
|
|
|
return [
|
|
return [
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 45,
|
|
|
|
|
+ type: 'selection',
|
|
|
|
|
+ columnKey: 'selection',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ fixed: 'left'
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
width: 50,
|
|
width: 50,
|
|
|
type: 'index',
|
|
type: 'index',
|
|
@@ -668,6 +695,28 @@
|
|
|
}
|
|
}
|
|
|
if (key === 'productReleaseApproval') {
|
|
if (key === 'productReleaseApproval') {
|
|
|
await this.openReleaseOrderPrint();
|
|
await this.openReleaseOrderPrint();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (key === 'samplingForm') {
|
|
|
|
|
+ await this.openSamplingFormPrint();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ async openSamplingFormPrint() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const ids = getSamplingPrintIds(this.selection);
|
|
|
|
|
+ if (!ids.length) {
|
|
|
|
|
+ this.$message.warning('未获取到可打印数据的ID');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const res = await querySamplingPrint(ids);
|
|
|
|
|
+ const data = buildSamplingFormPrintData(res, this.selection);
|
|
|
|
|
+ if (!data) {
|
|
|
|
|
+ this.$message.warning('未查询到可打印的取样单数据');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$refs.samplingForm.open(data);
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ this.$message.error(error.message || '查询打印数据失败');
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async openReleaseOrderPrint() {
|
|
async openReleaseOrderPrint() {
|
|
@@ -747,7 +796,10 @@
|
|
|
first.unqualifiedProductsCode,
|
|
first.unqualifiedProductsCode,
|
|
|
selected.unqualifiedProductsCode
|
|
selected.unqualifiedProductsCode
|
|
|
),
|
|
),
|
|
|
- categoryName: this.getValue(first.categoryName, selected.categoryName),
|
|
|
|
|
|
|
+ categoryName: this.getValue(
|
|
|
|
|
+ first.categoryName,
|
|
|
|
|
+ selected.categoryName
|
|
|
|
|
+ ),
|
|
|
specification,
|
|
specification,
|
|
|
modelType: this.getValue(first.modelType, selected.modelType),
|
|
modelType: this.getValue(first.modelType, selected.modelType),
|
|
|
batchNo: this.getValue(first.batchNo, selected.batchNo),
|
|
batchNo: this.getValue(first.batchNo, selected.batchNo),
|
|
@@ -757,12 +809,11 @@
|
|
|
first.unqualifiedProductsCode,
|
|
first.unqualifiedProductsCode,
|
|
|
selected.unqualifiedProductsCode
|
|
selected.unqualifiedProductsCode
|
|
|
),
|
|
),
|
|
|
- unqualifiedDescription:
|
|
|
|
|
- this.getValue(
|
|
|
|
|
- first.unqualifiedReason,
|
|
|
|
|
- selected.unqualifiedDescription,
|
|
|
|
|
- selected.unqualifiedReason
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ unqualifiedDescription: this.getValue(
|
|
|
|
|
+ first.unqualifiedReason,
|
|
|
|
|
+ selected.unqualifiedDescription,
|
|
|
|
|
+ selected.unqualifiedReason
|
|
|
|
|
+ ),
|
|
|
unqualifiedReason: this.getValue(
|
|
unqualifiedReason: this.getValue(
|
|
|
first.unqualifiedReason,
|
|
first.unqualifiedReason,
|
|
|
selected.unqualifiedReason
|
|
selected.unqualifiedReason
|