| | |
| | | <div class="print-page"> |
| | | <div class="delivery-note"> |
| | | <div class="header"> |
| | | <div class="company-name">é¼è¯çå®ä¸æé责任å
¬å¸</div> |
| | | <div class="company-name">æ¹åé¹åçµåæéå
¬å¸</div> |
| | | <div class="document-title">é¶å®åè´§å</div> |
| | | </div> |
| | | |
| | |
| | | <script setup lang="ts"> |
| | | import {computed} from "vue"; |
| | | import {computed, onMounted} from "vue"; |
| | | |
| | | defineOptions({ |
| | | name: "ReportingDetail" |
| | |
| | | set: (value: boolean) => emits("update:isShow", value), |
| | | }); |
| | | |
| | | const otherData = ref([]) |
| | | const init = () => { |
| | | if (props.row.otherData !== null && props.row.otherData !== '') { |
| | | otherData.value = JSON.parse(props.row.otherData); |
| | | } |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | init(); |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | <el-descriptions-item label="æ¥åºæ°é">{{ row.quantity || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="åä½">{{ row.scrapQty || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å建æ¶é´">{{ row.createTime || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item |
| | | v-for="item in otherData" |
| | | :label="`${item.parameterItem}`" |
| | | > |
| | | {{ item.value || '-' }} |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import {computed, reactive, ref, watch} from "vue"; |
| | | import {getDeviceLedger} from "@/api/equipmentManagement/ledger"; |
| | | |
| | | defineOptions({ |
| | | name: "ProductionRecordForm" |
| | | }); |
| | | |
| | | const props = defineProps({ |
| | | list: { |
| | | type: Array, |
| | | default() { |
| | | return []; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | const formRef = ref(); |
| | | const formData = reactive({ |
| | | list: [] as any[], |
| | | }); |
| | | |
| | | const fieldLabel = (item: any) => { |
| | | if (!item.unit || item.unit === "/") { |
| | | return item.parameterItem; |
| | | } |
| | | return `${item.parameterItem}ï¼${item.unit}ï¼`; |
| | | }; |
| | | |
| | | const getType = (item: any) => item.type || "ææ¬æ ¼å¼"; |
| | | |
| | | const rules = computed(() => { |
| | | const result: Record<string, any[]> = {}; |
| | | formData.list.forEach((item, index) => { |
| | | if (String(item.isRequired) === "1") { |
| | | result[`list.${index}.value`] = [{required: true, message: `请è¾å
¥${item.parameterItem}`, trigger: "blur"}]; |
| | | } |
| | | }); |
| | | return result; |
| | | }); |
| | | |
| | | const deviceOptions = ref([]); |
| | | const loadDeviceName = async () => { |
| | | const {data} = await getDeviceLedger(); |
| | | deviceOptions.value = data; |
| | | }; |
| | | |
| | | const initData = () => { |
| | | formData.list = props.list || []; |
| | | formData.list.forEach(item => { |
| | | if (item.value === undefined) { |
| | | item.value = null; |
| | | } |
| | | }); |
| | | loadDeviceName() |
| | | }; |
| | | |
| | | const submitData = async () => { |
| | | const valid = await formRef.value.validate().catch(() => false) |
| | | |
| | | if (valid) { |
| | | return formData.list |
| | | } else { |
| | | return null |
| | | } |
| | | } |
| | | |
| | | watch( |
| | | () => props.list, |
| | | () => { |
| | | initData(); |
| | | }, |
| | | {immediate: true, deep: true} |
| | | ); |
| | | |
| | | defineExpose({ |
| | | submitData |
| | | }) |
| | | </script> |
| | | |
| | | <template> |
| | | <el-form ref="formRef" :model="formData" :rules="rules" label-width="120px"> |
| | | <el-form-item |
| | | v-for="(item, index) in formData.list" |
| | | :key="item.id" |
| | | :label="fieldLabel(item)" |
| | | :prop="`list.${index}.value`" |
| | | > |
| | | <el-input-number |
| | | v-if="getType(item) === 'æ°å¼æ ¼å¼'" |
| | | v-model="item.value" |
| | | :controls="false" |
| | | style="width: 100%" |
| | | placeholder="请è¾å
¥" |
| | | /> |
| | | <el-date-picker |
| | | v-else-if="getType(item) === 'æ¶é´æ ¼å¼'" |
| | | v-model="item.value" |
| | | type="datetime" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | placeholder="è¯·éæ©" |
| | | style="width: 100%" |
| | | /> |
| | | <el-date-picker |
| | | v-else-if="getType(item) === 'æ¥ææ ¼å¼'" |
| | | v-model="item.value" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | placeholder="è¯·éæ©" |
| | | style="width: 100%" |
| | | /> |
| | | <el-select |
| | | v-else-if="getType(item) === 'æ¯/å¦éæ¡'" |
| | | v-model="item.value" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | style="width: 100%" |
| | | > |
| | | <el-option label="æ¯" value="æ¯"/> |
| | | <el-option label="å¦" value="å¦"/> |
| | | </el-select> |
| | | <el-select |
| | | v-else-if="getType(item) === 'æºå°éæ©'" |
| | | v-model="item.value" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="(item, index) in deviceOptions" |
| | | :key="index" |
| | | :label="item.deviceName" |
| | | :value="item.deviceName" |
| | | ></el-option> |
| | | </el-select> |
| | | <el-input |
| | | v-else |
| | | v-model="item.value" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | |
| | | :value="user.userId"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <ProductionRecordForm ref="productionRecordFormRef" :list="processParamList"/> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | |
| | | import QRCode from "qrcode"; |
| | | import {getCurrentInstance, reactive, toRefs} from "vue"; |
| | | import FilesDia from "./components/filesDia.vue"; |
| | | import { |
| | | listPage as listProcessParamPage, |
| | | } from "@/api/productionManagement/productProcessParameter.js"; |
| | | |
| | | const {proxy} = getCurrentInstance(); |
| | | const {priority_type} = proxy.useDict("priority_type"); |
| | | |
| | | const CopperPrintingForm = defineAsyncComponent(() => import("./components/CopperPrintingForm.vue")); |
| | | const VoltageSortingForm = defineAsyncComponent(() => import("./components/VoltageSortingForm.vue")); |
| | | const ProductionRecordForm = defineAsyncComponent(() => import("./components/ProductionRecordForm.vue")); |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "ä¼å
级", |
| | |
| | | productProcessRouteItemId: "", |
| | | userId: "", |
| | | productMainId: null, |
| | | otherData: {} |
| | | }); |
| | | const productionRecordFormRef = ref(); |
| | | |
| | | // æ¬æ¬¡ç产æ°ééªè¯è§å |
| | | const validateQuantity = (rule, value, callback) => { |
| | |
| | | }); |
| | | }; |
| | | |
| | | const showReportDialog = row => { |
| | | const processParamPage = reactive({ |
| | | current: 1, |
| | | size: 9999, |
| | | total: 0, |
| | | }); |
| | | const getProcessParamList = async (row) => { |
| | | const params = { |
| | | processId: row.processId, |
| | | ...processParamPage, |
| | | }; |
| | | const res = await listProcessParamPage(params) |
| | | return res.data.records |
| | | }; |
| | | |
| | | const processParamList = ref([]) |
| | | const showReportDialog = async row => { |
| | | currentReportRowData.value = row; |
| | | if (row.processName === 'å°é' || row.processName === 'å°é¶') { |
| | | copperPrintingFormVisible.value = true |
| | |
| | | voltageSortingFormVisible.value = true |
| | | return; |
| | | } |
| | | processParamList.value = await getProcessParamList(row) |
| | | reportForm.planQuantity = row.planQuantity; |
| | | reportForm.quantity = row.quantity !== undefined && row.quantity !== null ? row.quantity : null; |
| | | reportForm.productProcessRouteItemId = row.productProcessRouteItemId; |
| | |
| | | workOrderFilesRef.value?.openDialog(row); |
| | | }; |
| | | |
| | | const handleReport = () => { |
| | | const handleReport = async () => { |
| | | const data = await productionRecordFormRef.value.submitData() |
| | | reportForm.otherData = JSON.stringify(data || {}); |
| | | reportFormRef.value?.validate((valid) => { |
| | | if (!valid) { |
| | | return false; |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸è¯æ°éï¼" prop="defectiveQuantity"> |
| | | <el-input-number |
| | | :step="0.01" |
| | | :min="0" |
| | | :max="getMaxDefectiveQuantity()" |
| | | style="width: 100%" |
| | | v-model="form.defectiveQuantity" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | :precision="2" |
| | | |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸è¯åå ï¼" prop="defectiveReason"> |
| | | <el-select v-model="form.defectiveReason" placeholder="è¯·éæ©" clearable style="width: 100%"> |
| | | <el-option |
| | | v-for="dict in defective_reason" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ°éï¼" prop="quantity"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请è¾å
¥" clearable :precision="2" :disabled="processQuantityDisabled"/> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请è¾å
¥" clearable :precision="2" :disabled="operationType !== 'add'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref, reactive, toRefs, computed, getCurrentInstance, nextTick} from "vue"; |
| | | import {ref, reactive, toRefs, computed, getCurrentInstance, nextTick, watch} from "vue"; |
| | | import {getOptions} from "@/api/procurementManagement/procurementLedger.js"; |
| | | import {modelList, productTreeList} from "@/api/basicData/product.js"; |
| | | import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js"; |
| | | import { list } from "@/api/productionManagement/productionProcess"; |
| | | import { useDict } from "@/utils/dict.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | |
| | | |
| | | // è·ååå
¸æ°æ® |
| | | const { defective_reason } = useDict('defective_reason'); |
| | | |
| | | const dialogFormVisible = ref(false); |
| | | const operationType = ref('') |
| | |
| | | testStandardId: "", |
| | | unit: "", |
| | | quantity: "", |
| | | defectiveQuantity: "", |
| | | defectiveReason: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | }, |
| | |
| | | const currentProductId = ref(0); |
| | | const testStandardOptions = ref([]); // ææ éæ©ä¸ææ¡æ°æ® |
| | | const modelOptions = ref([]); |
| | | // ä¿ååå§ç defectiveQuantity å¼ï¼ç¨äºè®¡ç®ååéï¼ |
| | | const initialDefectiveQuantity = ref(0); |
| | | |
| | | // è·åä¸è¯æ°éæå¤§å¼ |
| | | const getMaxDefectiveQuantity = () => { |
| | | return form.value.quantity || 0; |
| | | }; |
| | | |
| | | // çå¬ä¸è¯æ°éååï¼èªå¨æ´æ°æ°é |
| | | // å½ defectiveQuantity å¢å æ¶ï¼quantity åå°ï¼å½ defectiveQuantity åå°æ¶ï¼quantity å¢å |
| | | watch(() => form.value.defectiveQuantity, (newVal, oldVal) => { |
| | | const newDefectiveQty = Number(newVal) || 0; |
| | | const oldDefectiveQty = Number(oldVal) || 0; |
| | | const currentQuantity = Number(form.value.quantity) || 0; |
| | | |
| | | // 计ç®ååéï¼æ°å¼ - æ§å¼ |
| | | const changeAmount = newDefectiveQty - oldDefectiveQty; |
| | | |
| | | // quantity åååå |
| | | form.value.quantity = Number((currentQuantity - changeAmount).toFixed(2)); |
| | | }); |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openDialog = async (type, row) => { |
| | |
| | | <div v-for="(item, index) in printData" :key="index" class="print-page"> |
| | | <div class="delivery-note"> |
| | | <div class="header"> |
| | | <div class="company-name">é¼è¯çå®ä¸æé责任å
¬å¸</div> |
| | | <div class="company-name">æ¹åé¹åçµåæéå
¬å¸</div> |
| | | <div class="document-title">é¶å®åè´§å</div> |
| | | </div> |
| | | |
| | |
| | | <div class="print-page"> |
| | | <div class="delivery-note"> |
| | | <div class="header"> |
| | | <div class="company-name">é¼è¯çå®ä¸æé责任å
¬å¸</div> |
| | | <div class="company-name">æ¹åé¹åçµåæéå
¬å¸</div> |
| | | <div class="document-title">é¶å®åè´§å</div> |
| | | </div> |
| | | |