|
|
@@ -0,0 +1,229 @@
|
|
|
+<template>
|
|
|
+ <ele-modal
|
|
|
+ width="80%"
|
|
|
+ :visible="visible"
|
|
|
+ append-to-body
|
|
|
+ custom-class="ele-dialog-form"
|
|
|
+ :title="title"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :before-close="handleBeforeClose"
|
|
|
+ maxable
|
|
|
+ >
|
|
|
+ <header-title title="基本信息"></header-title>
|
|
|
+ <el-form
|
|
|
+ :model="addForm"
|
|
|
+ :rules="formRules"
|
|
|
+ ref="ruleFormRef"
|
|
|
+ label-width="150px"
|
|
|
+ v-loading="loading"
|
|
|
+ >
|
|
|
+ <el-row> </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <!-- 底部按钮 -->
|
|
|
+ <template #footer>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <el-button
|
|
|
+ :loading="butLoading"
|
|
|
+ type="primary"
|
|
|
+ @click="submit('submit')"
|
|
|
+ :disabled="productionInfo && productionInfo.executeStatus == 2"
|
|
|
+ >
|
|
|
+ 一键报工
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ v-if="productionInfo && productionInfo.executeStatus == 2"
|
|
|
+ @click="handleBeforeClose"
|
|
|
+ >
|
|
|
+ 关闭
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </ele-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import { submit } from '@/api/entrust';
|
|
|
+ import {
|
|
|
+ recordRulesDetailPage,
|
|
|
+ getRecordRulesDetail
|
|
|
+ } from '@/api/recordRules/index.js';
|
|
|
+ import DictSelection from '@/components/Dict/DictSelection.vue';
|
|
|
+ import SelectUser from '@/components/select/SelectUser/index.vue';
|
|
|
+ import { saveRuleRecord } from '@/api/producetaskrulerecord/index.js';
|
|
|
+
|
|
|
+ export default {
|
|
|
+ components: { SelectUser },
|
|
|
+ emits: ['reload'],
|
|
|
+ props: {
|
|
|
+ isTempRecord: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ const formDate = {
|
|
|
+ id: null,
|
|
|
+ workshopArea: '',
|
|
|
+ checkFinishTime: '',
|
|
|
+ checkValidity: null,
|
|
|
+ checkValidityUnit: '',
|
|
|
+ conclution: null,
|
|
|
+ isTempRecord: this.isTempRecord,
|
|
|
+ details: [],
|
|
|
+ planList: [],
|
|
|
+ deviceId: 0,
|
|
|
+ deviceName: '',
|
|
|
+ batchNo: '',
|
|
|
+ executeMethod: 0,
|
|
|
+ formingNum: 0,
|
|
|
+ itemType: 0,
|
|
|
+ produceRoutingId: 0,
|
|
|
+ produceRoutingName: '',
|
|
|
+ produceTaskConfigId: 0,
|
|
|
+ produceTaskId: 0,
|
|
|
+ produceTaskName: '',
|
|
|
+ productCode: '',
|
|
|
+ productModel: '',
|
|
|
+ productName: '',
|
|
|
+ recordRulesClassify: null,
|
|
|
+ ruleId: 0,
|
|
|
+ ruleName: '',
|
|
|
+ reportWorkType: 0,
|
|
|
+ specification: '',
|
|
|
+ workOrderCode: '',
|
|
|
+ workOrderId: 0
|
|
|
+ };
|
|
|
+
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ formDate,
|
|
|
+ addForm: JSON.parse(JSON.stringify(formDate)),
|
|
|
+ formRules: {
|
|
|
+ checkFinishTime: [
|
|
|
+ { required: true, message: '请选择检查完成时间', trigger: 'blur' },
|
|
|
+ { required: true, message: '请选择检查完成时间', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ conclution: [
|
|
|
+ { required: true, message: '请选择结论', trigger: 'blur' },
|
|
|
+ { required: true, message: '请选择结论', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ checkValidity: [
|
|
|
+ { required: true, message: '请输入检查有效期', trigger: 'blur' },
|
|
|
+ { required: true, message: '请输入检查有效期', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ checkValidityUnit: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择检查有效期单位',
|
|
|
+ trigger: 'blur'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择检查有效期单位',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ productionInfo: null,
|
|
|
+ list: [],
|
|
|
+ ruleInfo: null,
|
|
|
+ showSelectUser: false,
|
|
|
+ currentRow: null,
|
|
|
+ butLoading: false,
|
|
|
+ // 工艺路线
|
|
|
+ workOrderInfo: null,
|
|
|
+ // 加载中 loading
|
|
|
+ loading: false,
|
|
|
+ title: '任务确认'
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ methods: {
|
|
|
+ open(productionInfo, workOrderInfo) {
|
|
|
+ console.log(
|
|
|
+ 'productionInfo, workOrderInfo',
|
|
|
+ productionInfo,
|
|
|
+ workOrderInfo
|
|
|
+ );
|
|
|
+ this.visible = true;
|
|
|
+ this.productionInfo = productionInfo;
|
|
|
+ this.workOrderInfo = workOrderInfo;
|
|
|
+
|
|
|
+ this.addForm.batchNo = workOrderInfo.batchNo;
|
|
|
+ this.addForm.executeMethod = productionInfo.executeMethod;
|
|
|
+ this.addForm.formingNum = workOrderInfo.formingNum;
|
|
|
+ this.addForm.itemType = productionInfo.itemType;
|
|
|
+ this.addForm.produceRoutingId = workOrderInfo.produceRoutingId;
|
|
|
+ this.addForm.produceRoutingName = workOrderInfo.produceRoutingName;
|
|
|
+ this.addForm.produceTaskConfigId = productionInfo.produceTaskConfigId;
|
|
|
+ this.addForm.produceTaskId = productionInfo.produceTaskId;
|
|
|
+ this.addForm.produceTaskName = productionInfo.produceTaskName;
|
|
|
+ this.addForm.productCode = workOrderInfo.productCode;
|
|
|
+ this.addForm.productModel = workOrderInfo.model;
|
|
|
+ this.addForm.productName = workOrderInfo.productName;
|
|
|
+ this.addForm.reportWorkType = productionInfo.reportWorkType;
|
|
|
+ this.addForm.specification = workOrderInfo.specification;
|
|
|
+ this.addForm.workOrderCode = workOrderInfo.code;
|
|
|
+ this.addForm.workOrderId = workOrderInfo.id;
|
|
|
+ this.itemTaskName = productionInfo.itemTaskName;
|
|
|
+
|
|
|
+ console.log('this.productionInfo', this.productionInfo);
|
|
|
+ console.log('this.addForm', this.addForm);
|
|
|
+ },
|
|
|
+ handleBeforeClose() {
|
|
|
+ this.addForm = JSON.parse(JSON.stringify(this.formDate));
|
|
|
+ console.log('this.$refs.ruleFormRef', this.addForm);
|
|
|
+ this.$refs.ruleFormRef?.clearValidate();
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.visible = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 提交
|
|
|
+ submit(type) {
|
|
|
+ console.log('this.addForm', this.addForm);
|
|
|
+
|
|
|
+ // 验证表单
|
|
|
+ this.$refs.ruleFormRef.validate(async (valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 提交
|
|
|
+ this.butLoading = true;
|
|
|
+ try {
|
|
|
+ await saveRuleRecord(this.addForm);
|
|
|
+ this.$message.success('报工成功!');
|
|
|
+
|
|
|
+ this.butLoading = false;
|
|
|
+
|
|
|
+ // 返回
|
|
|
+ this.$emit('reload');
|
|
|
+
|
|
|
+ this.handleBeforeClose();
|
|
|
+ } catch (error) {
|
|
|
+ this.butLoading = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+ .modal-body {
|
|
|
+ padding: 16px;
|
|
|
+ min-height: 100px;
|
|
|
+ }
|
|
|
+ .modal-footer {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 10px;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-form-item .el-form-item {
|
|
|
+ margin-bottom: -5px;
|
|
|
+ }
|
|
|
+</style>
|