|
@@ -209,64 +209,14 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
- <header-title
|
|
|
|
|
- v-if="addForm.reportWorkType == '2' && addForm.produceTaskId"
|
|
|
|
|
- title="物料清单"
|
|
|
|
|
- ></header-title>
|
|
|
|
|
-
|
|
|
|
|
- <ele-pro-table
|
|
|
|
|
- v-if="addForm.reportWorkType == '2' && addForm.produceTaskId"
|
|
|
|
|
- ref="table"
|
|
|
|
|
- row-key="id"
|
|
|
|
|
- :columns="materialColumns"
|
|
|
|
|
- :datasource="addForm.pickDetails"
|
|
|
|
|
- cache-key="prenatal-examination-material-list-table-2510231107"
|
|
|
|
|
- autoAmendPage
|
|
|
|
|
- :needPage="false"
|
|
|
|
|
- @refresh="getListByWorkOrderId"
|
|
|
|
|
- >
|
|
|
|
|
- <template v-slot:toolbar>
|
|
|
|
|
- <el-button type="primary" @click="openMaterialModal"
|
|
|
|
|
- >添加物料</el-button
|
|
|
|
|
- >
|
|
|
|
|
- </template>
|
|
|
|
|
-
|
|
|
|
|
- <template v-slot:reportQuantity="{ row }">
|
|
|
|
|
- <el-input-number
|
|
|
|
|
- size="small"
|
|
|
|
|
- v-model.number="row.reportQuantity"
|
|
|
|
|
- controls-position="right"
|
|
|
|
|
- :min="0"
|
|
|
|
|
- :max="row.feedQuantity"
|
|
|
|
|
- ></el-input-number>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-slot:qualifiedQuantity="{ row }">
|
|
|
|
|
- <el-input-number
|
|
|
|
|
- size="small"
|
|
|
|
|
- v-model.number="row.qualifiedQuantity"
|
|
|
|
|
- controls-position="right"
|
|
|
|
|
- :min="0"
|
|
|
|
|
- :max="qualifiedQuantityMax(row)"
|
|
|
|
|
- ></el-input-number>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-slot:noQualifiedQuantity="{ row }">
|
|
|
|
|
- <el-input-number
|
|
|
|
|
- size="small"
|
|
|
|
|
- v-model.number="row.noQualifiedQuantity"
|
|
|
|
|
- controls-position="right"
|
|
|
|
|
- :min="0"
|
|
|
|
|
- :max="noQualifiedQuantityMax(row)"
|
|
|
|
|
- ></el-input-number>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-slot:msg="{ row }">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="row.msg"
|
|
|
|
|
- type="textarea"
|
|
|
|
|
- rows="1"
|
|
|
|
|
- autosize
|
|
|
|
|
- ></el-input>
|
|
|
|
|
- </template>
|
|
|
|
|
- </ele-pro-table>
|
|
|
|
|
|
|
+ <material
|
|
|
|
|
+ v-if="addForm.produceTaskId"
|
|
|
|
|
+ :pickDetails.sync="addForm.pickDetails"
|
|
|
|
|
+ :previousOutputDetails="previousOutputDetails"
|
|
|
|
|
+ :workOrderId="addForm.workOrderId"
|
|
|
|
|
+ :ruleId="addForm.ruleId"
|
|
|
|
|
+ :produceTaskId="addForm.produceTaskId"
|
|
|
|
|
+ ></material>
|
|
|
|
|
|
|
|
<header-title
|
|
<header-title
|
|
|
title="检查项目"
|
|
title="检查项目"
|
|
@@ -423,8 +373,6 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<toolModal ref="toolModalRef" @chooseModal="chooseModal" />
|
|
<toolModal ref="toolModalRef" @chooseModal="chooseModal" />
|
|
|
-
|
|
|
|
|
- <materialModal ref="materialModalRef" @confirm="materialConfirm" />
|
|
|
|
|
</ele-modal>
|
|
</ele-modal>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -444,13 +392,13 @@
|
|
|
} from '@/api/producetaskrecordrulesrecord/index';
|
|
} from '@/api/producetaskrecordrulesrecord/index';
|
|
|
import toolModal from '@/views/batchRecord/components/toolModal.vue';
|
|
import toolModal from '@/views/batchRecord/components/toolModal.vue';
|
|
|
import { getTeam } from '@/api/produce/job.js';
|
|
import { getTeam } from '@/api/produce/job.js';
|
|
|
- import materialModal from './materialModal.vue';
|
|
|
|
|
import { getFactoryarea } from '@/api/aps/index';
|
|
import { getFactoryarea } from '@/api/aps/index';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import tableColumnsMixin from '@/mixins/tableColumnsMixin';
|
|
import tableColumnsMixin from '@/mixins/tableColumnsMixin';
|
|
|
|
|
+ import material from './material.vue';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- components: { SelectUser, toolModal, materialModal },
|
|
|
|
|
|
|
+ components: { SelectUser, toolModal, material },
|
|
|
mixins: [dictMixins, tableColumnsMixin],
|
|
mixins: [dictMixins, tableColumnsMixin],
|
|
|
emits: ['reload'],
|
|
emits: ['reload'],
|
|
|
props: {
|
|
props: {
|
|
@@ -609,140 +557,9 @@
|
|
|
teamUserList: [],
|
|
teamUserList: [],
|
|
|
teamList: [],
|
|
teamList: [],
|
|
|
teamAllList: [],
|
|
teamAllList: [],
|
|
|
- // 物料清单表头
|
|
|
|
|
- materialColumns: [
|
|
|
|
|
- {
|
|
|
|
|
- width: 45,
|
|
|
|
|
- type: 'index',
|
|
|
|
|
- columnKey: 'index',
|
|
|
|
|
- align: 'center'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '类型',
|
|
|
|
|
- prop: 'categoryLevelNamePath',
|
|
|
|
|
- minWidth: 120
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '编码',
|
|
|
|
|
- prop: 'categoryCode',
|
|
|
|
|
- minWidth: 120
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '名称',
|
|
|
|
|
- prop: 'categoryName',
|
|
|
|
|
- minWidth: 120
|
|
|
|
|
- },
|
|
|
|
|
- ,
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'modelType',
|
|
|
|
|
- label: '型号',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'specification',
|
|
|
|
|
- label: '规格',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- width: 160,
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'brandNum',
|
|
|
|
|
- label: '牌号',
|
|
|
|
|
- align: 'center'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'modelType',
|
|
|
|
|
- label: '型号',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'specification',
|
|
|
|
|
- label: '规格',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- width: 160,
|
|
|
|
|
- showOverflowTooltip: true
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'brandNum',
|
|
|
|
|
- label: '牌号',
|
|
|
|
|
- align: 'center'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '工序名称',
|
|
|
|
|
- prop: 'produceTaskName',
|
|
|
|
|
- minWidth: 120
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '数量',
|
|
|
|
|
- prop: 'feedQuantity',
|
|
|
|
|
- minWidth: 120,
|
|
|
|
|
- formatter: (row) => {
|
|
|
|
|
- return (row.feedQuantity || '') + (row.feedUnit || '');
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '当次报工数量',
|
|
|
|
|
- prop: 'reportQuantity',
|
|
|
|
|
- minWidth: 160,
|
|
|
|
|
- slot: 'reportQuantity'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '当次合格数量',
|
|
|
|
|
- prop: 'qualifiedQuantity',
|
|
|
|
|
- minWidth: 160,
|
|
|
|
|
- slot: 'qualifiedQuantity'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '当次不合格数量',
|
|
|
|
|
- prop: 'noQualifiedQuantity',
|
|
|
|
|
- minWidth: 160,
|
|
|
|
|
- slot: 'noQualifiedQuantity'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '不合格原因',
|
|
|
|
|
- prop: 'msg',
|
|
|
|
|
- minWidth: 160,
|
|
|
|
|
- slot: 'msg'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '已报工数量',
|
|
|
|
|
- prop: 'sumReportQuantity',
|
|
|
|
|
- minWidth: 120,
|
|
|
|
|
- formatter(row) {
|
|
|
|
|
- return (row.sumReportQuantity || 0) + row.feedUnit;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '未报工数量',
|
|
|
|
|
- prop: 'noReportQuantity',
|
|
|
|
|
- minWidth: 120,
|
|
|
|
|
- formatter(row) {
|
|
|
|
|
- if (row.sumReportQuantity != null) {
|
|
|
|
|
- return row.feedQuantity - row.sumReportQuantity + row.feedUnit;
|
|
|
|
|
- }
|
|
|
|
|
- return `${row.feedQuantity}${row.feedUnit || ''}`;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '合格总数',
|
|
|
|
|
- prop: 'sumQualifiedQuantity',
|
|
|
|
|
- minWidth: 120,
|
|
|
|
|
- formatter(row) {
|
|
|
|
|
- return (row.sumQualifiedQuantity || 0) + (row.feedUnit || '');
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '不合格总数',
|
|
|
|
|
- prop: 'sumNoQualifiedQuantity',
|
|
|
|
|
- minWidth: 120,
|
|
|
|
|
- formatter(row) {
|
|
|
|
|
- return (row.sumNoQualifiedQuantity || 0) + (row.feedUnit || '');
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- workshopAreaList: []
|
|
|
|
|
|
|
+ workshopAreaList: [],
|
|
|
|
|
+ // 上到工序的 产出明细
|
|
|
|
|
+ previousOutputDetails: []
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -940,15 +757,16 @@
|
|
|
async getListByWorkOrderId() {
|
|
async getListByWorkOrderId() {
|
|
|
if (!this.productionInfo.produceTaskId) return;
|
|
if (!this.productionInfo.produceTaskId) return;
|
|
|
// 查询物料信息
|
|
// 查询物料信息
|
|
|
- const materialList = await queryListByWorkOrderId({
|
|
|
|
|
|
|
+ const materialObject = await queryListByWorkOrderId({
|
|
|
workOrderId: this.addForm.workOrderId,
|
|
workOrderId: this.addForm.workOrderId,
|
|
|
recordId: this.productionInfo.recordId,
|
|
recordId: this.productionInfo.recordId,
|
|
|
produceTaskId: this.productionInfo.produceTaskId,
|
|
produceTaskId: this.productionInfo.produceTaskId,
|
|
|
ruleId: this.addForm.ruleId
|
|
ruleId: this.addForm.ruleId
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- console.log('materialList 物料信息', materialList);
|
|
|
|
|
- this.addForm.pickDetails = materialList;
|
|
|
|
|
|
|
+ console.log('materialList 物料信息', materialObject);
|
|
|
|
|
+ this.addForm.pickDetails = materialObject.pickDetails;
|
|
|
|
|
+ this.previousOutputDetails = materialObject.outputDetails;
|
|
|
},
|
|
},
|
|
|
// 规则信息
|
|
// 规则信息
|
|
|
async getRuleInfo() {
|
|
async getRuleInfo() {
|
|
@@ -999,6 +817,7 @@
|
|
|
},
|
|
},
|
|
|
// 提交
|
|
// 提交
|
|
|
submit(type) {
|
|
submit(type) {
|
|
|
|
|
+ console.log('this.addForm', this.addForm);
|
|
|
// 验证表单
|
|
// 验证表单
|
|
|
this.$refs.ruleFormRef.validate(async (valid) => {
|
|
this.$refs.ruleFormRef.validate(async (valid) => {
|
|
|
if (!valid) {
|
|
if (!valid) {
|
|
@@ -1229,58 +1048,6 @@
|
|
|
|
|
|
|
|
console.log('row', row);
|
|
console.log('row', row);
|
|
|
},
|
|
},
|
|
|
- // 选择物料
|
|
|
|
|
- openMaterialModal() {
|
|
|
|
|
- this.$refs.materialModalRef.open(
|
|
|
|
|
- {
|
|
|
|
|
- workOrderId: this.addForm.workOrderId,
|
|
|
|
|
- ruleId: this.addForm.ruleId,
|
|
|
|
|
- produceTaskId: this.workOrderInfo.produceTaskId
|
|
|
|
|
- },
|
|
|
|
|
- []
|
|
|
|
|
- );
|
|
|
|
|
- },
|
|
|
|
|
- materialConfirm(data) {
|
|
|
|
|
- // 选择物料后添加
|
|
|
|
|
- console.log('data', data);
|
|
|
|
|
-
|
|
|
|
|
- // 去重
|
|
|
|
|
- const list = data
|
|
|
|
|
- .filter((i) => {
|
|
|
|
|
- const any = this.addForm.pickDetails.find(
|
|
|
|
|
- (item) =>
|
|
|
|
|
- item.categoryCode === i.categoryCode &&
|
|
|
|
|
- item.produceTaskInstanceId === i.produceTaskInstanceId
|
|
|
|
|
- );
|
|
|
|
|
- return !any;
|
|
|
|
|
- })
|
|
|
|
|
- .map((i) => {
|
|
|
|
|
- i.ruleId = this.addForm.ruleId;
|
|
|
|
|
- return i;
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // 覆盖部分数据
|
|
|
|
|
- this.addForm.pickDetails = this.addForm.pickDetails.map((i) => {
|
|
|
|
|
- const item = data.find(
|
|
|
|
|
- (item) =>
|
|
|
|
|
- item.categoryCode === i.categoryCode &&
|
|
|
|
|
- item.produceTaskInstanceId === i.produceTaskInstanceId
|
|
|
|
|
- );
|
|
|
|
|
- if (item) {
|
|
|
|
|
- return {
|
|
|
|
|
- ...item,
|
|
|
|
|
- reportQuantity: i.reportQuantity,
|
|
|
|
|
- qualifiedQuantity: i.qualifiedQuantity,
|
|
|
|
|
- noQualifiedQuantity: i.noQualifiedQuantity,
|
|
|
|
|
- msg: i.msg
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- return i;
|
|
|
|
|
- });
|
|
|
|
|
- this.addForm.pickDetails = [...this.addForm.pickDetails, ...list];
|
|
|
|
|
- console.log('list', list);
|
|
|
|
|
- console.log('this.addForm.pickDetails', this.addForm.pickDetails);
|
|
|
|
|
- },
|
|
|
|
|
// qualifiedQuantityMax 最大合格数量
|
|
// qualifiedQuantityMax 最大合格数量
|
|
|
qualifiedQuantityMax(row) {
|
|
qualifiedQuantityMax(row) {
|
|
|
return row.reportQuantity - row.noQualifiedQuantity;
|
|
return row.reportQuantity - row.noQualifiedQuantity;
|