Merge branch 'dev_新疆_大罗素马铃薯new' of http://114.132.189.42:9002/r/product-inventory-management into dev_新疆_大罗素马铃薯new
| | |
| | | monthSaleHaveMoney: 0, |
| | | monthSaleMoney: 0, |
| | | todayInventoryNum: 0, |
| | | lastMonthSaleMoney: 0, |
| | | lastMonthPurchaseMoney: 0, |
| | | }); |
| | | |
| | | const qualityStatisticsObject = ref({ |
| | |
| | | }); |
| | | }); |
| | | |
| | | // 计ç®ç¯æ¯å¢é¿ç |
| | | const calculateGrowthRate = (current, last) => { |
| | | const currentVal = parseFloat(current) || 0; |
| | | const lastVal = parseFloat(last) || 0; |
| | | if (lastVal === 0) return currentVal > 0 ? 100 : 0; |
| | | return ((currentVal - lastVal) / lastVal * 100).toFixed(1); |
| | | }; |
| | | |
| | | const dashboardCards = computed(() => [ |
| | | { |
| | | key: "sales", |
| | | title: "é宿°æ®", |
| | | desc: "æ¬æéå®é¢(å
)", |
| | | value: formatNumber(businessInfo.value.monthSaleMoney), |
| | | subLabel: "æªå¼ç¥¨éé¢", |
| | | subValue: formatNumber(businessInfo.value.monthSaleHaveMoney), |
| | | trend: `å æ¯ ${ratioText(businessInfo.value.monthSaleHaveMoney, businessInfo.value.monthSaleMoney)}`, |
| | | subLabel: "䏿éå®", |
| | | subValue: formatNumber(businessInfo.value.lastMonthSaleMoney), |
| | | trend: (() => { |
| | | const rate = calculateGrowthRate(businessInfo.value.monthSaleMoney, businessInfo.value.lastMonthSaleMoney); |
| | | const num = parseFloat(rate); |
| | | if (num > 0) return `ç¯æ¯ â ${rate}%`; |
| | | if (num < 0) return `ç¯æ¯ â ${Math.abs(num)}%`; |
| | | return "ç¯æ¯æå¹³"; |
| | | })(), |
| | | icon: DataLine, |
| | | visible: visibleModules.value.sales, |
| | | }, |
| | |
| | | title: "éè´æ°æ®", |
| | | desc: "æ¬æéè´é¢(å
)", |
| | | value: formatNumber(businessInfo.value.monthPurchaseMoney), |
| | | subLabel: "å¾
仿¬¾éé¢", |
| | | subValue: formatNumber(businessInfo.value.monthPurchaseHaveMoney), |
| | | trend: `å æ¯ ${ratioText( |
| | | businessInfo.value.monthPurchaseHaveMoney, |
| | | businessInfo.value.monthPurchaseMoney |
| | | )}`, |
| | | subLabel: "䏿éè´", |
| | | subValue: formatNumber(businessInfo.value.lastMonthPurchaseMoney), |
| | | trend: (() => { |
| | | const rate = calculateGrowthRate(businessInfo.value.monthPurchaseMoney, businessInfo.value.lastMonthPurchaseMoney); |
| | | const num = parseFloat(rate); |
| | | if (num > 0) return `ç¯æ¯ â ${rate}%`; |
| | | if (num < 0) return `ç¯æ¯ â ${Math.abs(num)}%`; |
| | | return "ç¯æ¯æå¹³"; |
| | | })(), |
| | | icon: ShoppingCartFull, |
| | | visible: visibleModules.value.procurement, |
| | | }, |
| | |
| | | <template> |
| | | <div> |
| | | <div class="search_form" |
| | | style="margin-bottom: 10px"> |
| | | <el-form ref="searchFormRef" |
| | | :model="searchForm" |
| | | class="demo-form-inline"> |
| | | <div class="search_form" style="margin-bottom: 10px"> |
| | | <el-form ref="searchFormRef" :model="searchForm" class="demo-form-inline"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="4"> |
| | | <el-form-item label="åºåºæ¥æ" |
| | | prop="timeStr"> |
| | | <el-date-picker v-model="searchForm.timeStr" |
| | | <el-form-item label="åºåºæ¥æ" prop="timeStr"> |
| | | <el-date-picker |
| | | v-model="searchForm.timeStr" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable /> |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="产å大类" |
| | | prop="productName"> |
| | | <el-input v-model="searchForm.productName" |
| | | <el-form-item label="产å大类" prop="productName"> |
| | | <el-input |
| | | v-model="searchForm.productName" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="è§æ ¼åå·" |
| | | prop="model"> |
| | | <el-input v-model="searchForm.model" |
| | | <el-form-item label="è§æ ¼åå·" prop="model"> |
| | | <el-input |
| | | v-model="searchForm.model" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="æ¹å·" |
| | | prop="batchNo"> |
| | | <el-input v-model="searchForm.batchNo" |
| | | <el-form-item label="æ¹å·" prop="batchNo"> |
| | | <el-input |
| | | v-model="searchForm.batchNo" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥" |
| | | clearable /> |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="æ¥æº" |
| | | prop="recordType"> |
| | | <el-select v-model="searchForm.recordType" |
| | | <el-form-item label="æ¥æº" prop="recordType"> |
| | | <el-select |
| | | v-model="searchForm.recordType" |
| | | style="width: 240px" |
| | | placeholder="è¯·éæ©" |
| | | clearable> |
| | | <el-option v-for="item in stockRecordTypeOptions" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in stockRecordTypeOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" /> |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- æé® --> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <el-button type="primary" |
| | | @click="getList"> |
| | | æç´¢ |
| | | </el-button> |
| | | <el-button @click="resetSearch"> |
| | | éç½® |
| | | </el-button> |
| | | <el-button type="primary" @click="getList"> æç´¢ </el-button> |
| | | <el-button @click="resetSearch"> éç½® </el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | <div class="actions"> |
| | | <el-button type="primary" |
| | | @click="handleBatchApprove">审æ¹</el-button> |
| | | <el-button type="primary" @click="handleBatchApprove">审æ¹</el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="danger" |
| | | plain |
| | | @click="handleDelete">å é¤</el-button> |
| | | <el-button type="primary" |
| | | plain |
| | | @click="handlePrint">æå°</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | <el-button type="primary" plain @click="handlePrint">æå°</el-button> |
| | | </div> |
| | | <div class="table_list"> |
| | | <el-table :data="tableData" |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | v-loading="tableLoading" |
| | | @selection-change="handleSelectionChange" |
| | | :expand-row-keys="expandedRowKeys" |
| | | :row-key="(row) => row.id" |
| | | style="width: 100%" |
| | | height="calc(100vh - 18.5em)"> |
| | | <el-table-column align="center" |
| | | type="selection" |
| | | width="55" /> |
| | | <el-table-column align="center" |
| | | label="åºå·" |
| | | type="index" |
| | | width="60" /> |
| | | <el-table-column label="åºåºæ¹æ¬¡" |
| | | height="calc(100vh - 18.5em)" |
| | | > |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | <el-table-column |
| | | label="åºåºæ¹æ¬¡" |
| | | prop="outboundBatches" |
| | | min-width="100" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="åºåºæ¥æ" |
| | | prop="createTime" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="产å大类" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="åºåºæ¥æ" |
| | | prop="updateTime" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="产å大类" |
| | | prop="productName" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="è§æ ¼åå·" |
| | | prop="model" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="æ¹å·" |
| | | prop="batchNo" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="åä½" |
| | | prop="unit" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="åºåºæ°é" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="è§æ ¼åå·" prop="model" show-overflow-tooltip /> |
| | | <el-table-column label="æ¹å·" prop="batchNo" show-overflow-tooltip /> |
| | | <el-table-column label="åä½" prop="unit" show-overflow-tooltip /> |
| | | <el-table-column |
| | | label="åºåºæ°é" |
| | | prop="stockOutNum" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="åºåºäºº" |
| | | prop="createBy" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="æ¥æº" |
| | | prop="recordType" |
| | | show-overflow-tooltip> |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="åºåºäºº" prop="createBy" show-overflow-tooltip /> |
| | | <el-table-column label="æ¥æº" prop="recordType" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{ getRecordType(scope.row.recordType) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="审æ¹ç¶æ" |
| | | <el-table-column |
| | | label="审æ¹ç¶æ" |
| | | prop="approvalStatus" |
| | | show-overflow-tooltip> |
| | | show-overflow-tooltip |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getApprovalStatusTagType(scope.row.approvalStatus)" |
| | | size="small"> |
| | | <el-tag |
| | | :type="getApprovalStatusTagType(scope.row.approvalStatus)" |
| | | size="small" |
| | | > |
| | | {{ getApprovalStatusLabel(scope.row.approvalStatus) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination v-show="total > 0" |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :page="page.current" |
| | | :limit="page.size" |
| | | @pagination="paginationChange" /> |
| | | @pagination="paginationChange" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | getList(); |
| | | }; |
| | | |
| | | const paginationChange = obj => { |
| | | const paginationChange = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | |
| | | ...page, |
| | | topParentProductId: props.topParentProductId, |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | tableData.value.map(item => { |
| | | tableData.value.map((item) => { |
| | | item.children = []; |
| | | }); |
| | | total.value = res.data.total; |
| | |
| | | }); |
| | | }; |
| | | |
| | | const getRecordType = recordType => { |
| | | const getRecordType = (recordType) => { |
| | | return ( |
| | | stockRecordTypeOptions.value.find(item => item.value === recordType) |
| | | stockRecordTypeOptions.value.find((item) => item.value === recordType) |
| | | ?.label || "" |
| | | ); |
| | | }; |
| | |
| | | REJECTED: "驳å", |
| | | }; |
| | | |
| | | const getApprovalStatusLabel = status => { |
| | | const getApprovalStatusLabel = (status) => { |
| | | if (status === null || status === undefined || status === "") { |
| | | return "å¾
审æ¹"; |
| | | } |
| | |
| | | }; |
| | | |
| | | // éè¿/驳ååºå®è²ï¼å
¶ä½ï¼å«å¾
审æ¹ã空å¼ãæªæ å°ä½ææ¡ä¸ºå¾
审æ¹ï¼ç»ä¸ç¨ warning é¢è¦è² |
| | | const getApprovalStatusTagType = status => { |
| | | const getApprovalStatusTagType = (status) => { |
| | | if ( |
| | | status === 1 || |
| | | status === "1" || |
| | |
| | | // è·åæ¥æºç±»åé项 |
| | | const fetchStockRecordTypeOptions = () => { |
| | | if (props.type === "0") { |
| | | findAllQualifiedStockOutRecordTypeOptions().then(res => { |
| | | findAllQualifiedStockOutRecordTypeOptions().then((res) => { |
| | | stockRecordTypeOptions.value = res.data; |
| | | }); |
| | | return; |
| | | } |
| | | findAllUnQualifiedStockOutRecordTypeOptions().then(res => { |
| | | findAllUnQualifiedStockOutRecordTypeOptions().then((res) => { |
| | | stockRecordTypeOptions.value = res.data; |
| | | }); |
| | | }; |
| | | |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = selection => { |
| | | const handleSelectionChange = (selection) => { |
| | | // è¿æ»¤æåæ°æ® |
| | | selectedRows.value = selection.filter(item => item.id); |
| | | selectedRows.value = selection.filter((item) => item.id); |
| | | console.log("selection", selectedRows.value); |
| | | }; |
| | | const expandedRowKeys = ref([]); |
| | |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | const ids = selectedRows.value.map(item => item.id); |
| | | const ids = selectedRows.value.map((item) => item.id); |
| | | ElMessageBox.confirm("è¯·éæ©å®¡æ¹ç»æ", "审æ¹", { |
| | | confirmButtonText: "éè¿", |
| | | cancelButtonText: "驳å", |
| | |
| | | proxy.$modal.msgError("审æ¹éè¿å¤±è´¥"); |
| | | }); |
| | | }) |
| | | .catch(action => { |
| | | .catch((action) => { |
| | | if (action === "cancel") { |
| | | batchApproveStockOutRecords({ ids, approvalStatus: 2 }) |
| | | .then(() => { |
| | |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map(item => item.id); |
| | | ids = selectedRows.value.map((item) => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delPendingStockOut(ids).then(res => { |
| | | delPendingStockOut(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | |
| | | }; |
| | | |
| | | // æ ¼å¼åæ¥æ |
| | | const formatDate = dateString => { |
| | | const formatDate = (dateString) => { |
| | | if (!dateString) return getCurrentDate(); |
| | | const date = new Date(dateString); |
| | | const year = date.getFullYear(); |
| | |
| | | }; |
| | | |
| | | // æ ¼å¼åæ¥ææ¶é´ |
| | | const formatDateTime = date => { |
| | | const formatDateTime = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | |
| | | } |
| | | |
| | | /** ç»è£
å®¡æ¹æäº¤ DTO */ |
| | | export function buildApproveInstanceDto(row, uiResult, comment, warehouse) { |
| | | export function buildApproveInstanceDto(row, uiResult, comment, warehouse, extraData = {}) { |
| | | const opinion = (comment || "").trim(); |
| | | return { |
| | | id: row?.id, |
| | | approveAction: mapApproveActionToApi(uiResult), |
| | | approveComment: opinion || (uiResult === "approved" ? "åæ" : ""), |
| | | warehouse: warehouse || row?.warehouse || "", |
| | | ...extraData, |
| | | }; |
| | | } |
| | | |
| | |
| | | <div class="approve-detail-panel"> |
| | | <div class="detail-block"> |
| | | <div class="detail-block-title">åºæ¬ä¿¡æ¯</div> |
| | | <el-descriptions :column="2" |
| | | border> |
| | | <el-descriptions-item label="ä¸å¡åå·">{{ row.bizId || row.id || "â" }}</el-descriptions-item> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="ä¸å¡åå·">{{ |
| | | row.bizId || row.id || "â" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="审æ¹ç¶æ"> |
| | | <el-tag :type="approvalStatusTagType(row.approvalStatus)" |
| | | <el-tag |
| | | :type="approvalStatusTagType(row.approvalStatus)" |
| | | size="small" |
| | | effect="plain"> |
| | | effect="plain" |
| | | > |
| | | {{ approvalStatusLabel(row.approvalStatus) }} |
| | | </el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="审æ¹ç±»å"> |
| | | <span class="approve-type-cell" |
| | | :style="approvalTypeStyle(row.approvalType)"> |
| | | <span |
| | | class="approve-type-cell" |
| | | :style="approvalTypeStyle(row.approvalType)" |
| | | > |
| | | {{ approvalTypeLabel(row.approvalType) }} |
| | | </span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·äººç¼å·">{{ row.applicantNo || "â" }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·äººåç§°">{{ row.applicantName || "â" }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·æè¦">{{ row.summary || "â" }}</el-descriptions-item> |
| | | <el-descriptions-item v-if="row.rejectReason" |
| | | <el-descriptions-item label="ç³è¯·äººç¼å·">{{ |
| | | row.applicantNo || "â" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·äººåç§°">{{ |
| | | row.applicantName || "â" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç³è¯·æè¦">{{ |
| | | row.summary || "â" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item |
| | | v-if="row.rejectReason" |
| | | label="驳ååå " |
| | | :span="2"> |
| | | :span="2" |
| | | > |
| | | <span class="reject-text">{{ row.rejectReason }}</span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="å建æ¶é´" |
| | | :span="2"> |
| | | <el-descriptions-item label="å建æ¶é´" :span="2"> |
| | | {{ formatDisplayTime(row.createTime) }} |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | |
| | | <div class="detail-block"> |
| | | <div class="detail-block-title">å¡«æ¥å
容</div> |
| | | <!-- é»è®¤è¡¨åå±ç¤º --> |
| | | <FormPayloadFields v-if="!isSpecialApprovalType" |
| | | <FormPayloadFields |
| | | v-if="!isSpecialApprovalType" |
| | | :fields="formResolved.fields" |
| | | :form-payload="formResolved.formPayload" |
| | | readonly /> |
| | | readonly |
| | | /> |
| | | |
| | | <!-- å货审æ¹è¯¦æ
--> |
| | | <template v-else-if="row.businessType === 7"> |
| | | <div v-if="detailData.shippingInfo" class="shipment-detail"> |
| | | <el-divider content-position="left">å货详æ
</el-divider> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="éå®è®¢å">{{ detailData.shippingInfo.salesContractNo || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="å货订åå·">{{ detailData.shippingInfo.shippingNo || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="客æ·åç§°">{{ detailData.shippingInfo.customerName || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="åè´§ç±»å">{{ detailData.shippingInfo.type || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="åè´§æ¥æ">{{ detailData.shippingInfo.shippingDateDate || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="å®¡æ ¸ç¶æ">{{ detailData.shippingInfo.status || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="å货车çå·">{{ detailData.shippingInfo.shippingCarNumber || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="å¿«éå
¬å¸">{{ detailData.shippingInfo.expressCompany || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="å¿«éåå·" :span="2">{{ detailData.shippingInfo.expressNumber || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="éå®è®¢å">{{ |
| | | detailData.shippingInfo.salesContractNo || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="åºåºæ¹å·">{{ |
| | | detailData.shippingInfo.outboundBatches || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="客æ·åç§°">{{ |
| | | detailData.shippingInfo.customerName || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="åè´§ç±»å">{{ |
| | | detailData.shippingInfo.type || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="åè´§æ¥æ">{{ |
| | | detailData.shippingInfo.shippingDateDate || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="å®¡æ ¸ç¶æ">{{ |
| | | detailData.shippingInfo.status || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="å货车çå·">{{ |
| | | detailData.shippingInfo.shippingCarNumber || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="å¿«éå
¬å¸">{{ |
| | | detailData.shippingInfo.expressCompany || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="å¿«éåå·" :span="2">{{ |
| | | detailData.shippingInfo.expressNumber || "--" |
| | | }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | <div v-if="detailData.shippingProductDetailDtoList.length" style="margin-top: 20px;"> |
| | | <div |
| | | v-if="detailData.shippingProductDetailDtoList.length" |
| | | style="margin-top: 20px" |
| | | > |
| | | <h4>产åæç»</h4> |
| | | <el-table :data="detailData.shippingProductDetailDtoList" |
| | | <el-table |
| | | :data="detailData.shippingProductDetailDtoList" |
| | | border |
| | | size="small" |
| | | style="width: 100%"> |
| | | <el-table-column label="æ¹å·" prop="batchNo" min-width="160" show-overflow-tooltip /> |
| | | <el-table-column label="产ååç§°" prop="productName" min-width="160" show-overflow-tooltip /> |
| | | <el-table-column label="è§æ ¼åå·" prop="specificationModel" min-width="160" show-overflow-tooltip /> |
| | | <el-table-column label="åè´§æ°é" prop="deliveryQuantity" min-width="120" align="center" /> |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column |
| | | label="æ¹å·" |
| | | prop="batchNo" |
| | | min-width="160" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="产ååç§°" |
| | | prop="productName" |
| | | min-width="160" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="è§æ ¼åå·" |
| | | prop="specificationModel" |
| | | min-width="160" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="åè´§æ°é" |
| | | prop="deliveryQuantity" |
| | | min-width="120" |
| | | align="center" |
| | | /> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | |
| | | <div v-if="detailData" class="procurement-detail"> |
| | | <el-divider content-position="left">éè´è¯¦æ
</el-divider> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="éè´ååå·">{{ detailData.purchaseContractNumber || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="ä¾åºååç§°">{{ detailData.supplierName || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="项ç®åç§°">{{ detailData.projectName || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="éå®ååå·">{{ detailData.salesContractNo || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç¾è®¢æ¥æ">{{ detailData.executionDate || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="å½å
¥æ¥æ">{{ detailData.entryDate || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="仿¬¾æ¹å¼">{{ detailData.paymentMethod || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="éè´ååå·">{{ |
| | | detailData.purchaseContractNumber || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="ä¾åºååç§°">{{ |
| | | detailData.supplierName || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="项ç®åç§°">{{ |
| | | detailData.projectName || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="éå®ååå·">{{ |
| | | detailData.salesContractNo || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="ç¾è®¢æ¥æ">{{ |
| | | detailData.executionDate || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="å½å
¥æ¥æ">{{ |
| | | detailData.entryDate || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="仿¬¾æ¹å¼">{{ |
| | | detailData.paymentMethod || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="ååéé¢" :span="2"> |
| | | <span style="font-size: 18px; color: #e6a23c; font-weight: bold;"> |
| | | <span style="font-size: 18px; color: #e6a23c; font-weight: bold"> |
| | | ¥{{ Number(detailData.contractAmount ?? 0).toFixed(2) }} |
| | | </span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <div v-if="detailData.productData.length" style="margin-top: 20px;"> |
| | | <div v-if="detailData.productData.length" style="margin-top: 20px"> |
| | | <h4>产åæç»</h4> |
| | | <el-table :data="detailData.productData" |
| | | border |
| | | style="width: 100%"> |
| | | <el-table :data="detailData.productData" border style="width: 100%"> |
| | | <el-table-column prop="productCategory" label="产ååç§°" /> |
| | | <el-table-column prop="specificationModel" label="è§æ ¼åå·" /> |
| | | <el-table-column prop="unit" label="åä½" /> |
| | | <el-table-column prop="quantity" label="æ°é" /> |
| | | <el-table-column prop="taxInclusiveUnitPrice" label="å«ç¨åä»·"> |
| | | <template #default="scope">Â¥{{ Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(2) }}</template> |
| | | <template #default="scope" |
| | | >Â¥{{ |
| | | Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(2) |
| | | }}</template |
| | | > |
| | | </el-table-column> |
| | | <el-table-column prop="taxInclusiveTotalPrice" label="å«ç¨æ»ä»·"> |
| | | <template #default="scope">Â¥{{ Number(scope.row.taxInclusiveTotalPrice ?? 0).toFixed(2) }}</template> |
| | | <template #default="scope" |
| | | >Â¥{{ |
| | | Number(scope.row.taxInclusiveTotalPrice ?? 0).toFixed(2) |
| | | }}</template |
| | | > |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | |
| | | <div v-if="detailData" class="quotation-detail"> |
| | | <el-divider content-position="left">æ¥ä»·è¯¦æ
</el-divider> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="æ¥ä»·åå·">{{ detailData.quotationNo || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="客æ·åç§°">{{ detailData.customer || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="ä¸å¡å">{{ detailData.salesperson || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="æ¥ä»·æ¥æ">{{ detailData.quotationDate || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="æææè³">{{ detailData.validDate || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="仿¬¾æ¹å¼">{{ detailData.paymentMethod || "--" }}</el-descriptions-item> |
| | | <el-descriptions-item label="æ¥ä»·åå·">{{ |
| | | detailData.quotationNo || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="客æ·åç§°">{{ |
| | | detailData.customer || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="ä¸å¡å">{{ |
| | | detailData.salesperson || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="æ¥ä»·æ¥æ">{{ |
| | | detailData.quotationDate || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="æææè³">{{ |
| | | detailData.validDate || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="仿¬¾æ¹å¼">{{ |
| | | detailData.paymentMethod || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="æ¥ä»·æ»é¢" :span="2"> |
| | | <span style="font-size: 18px; color: #e6a23c; font-weight: bold;"> |
| | | <span style="font-size: 18px; color: #e6a23c; font-weight: bold"> |
| | | ¥{{ Number(detailData.totalAmount ?? 0).toFixed(2) }} |
| | | </span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <div v-if="detailData.products?.length" style="margin-top: 20px;"> |
| | | <div v-if="detailData.products?.length" style="margin-top: 20px"> |
| | | <h4>产åæç»</h4> |
| | | <el-table :data="detailData.products" |
| | | border |
| | | style="width: 100%"> |
| | | <el-table :data="detailData.products" border style="width: 100%"> |
| | | <el-table-column prop="product" label="产ååç§°" /> |
| | | <el-table-column prop="specification" label="è§æ ¼åå·" /> |
| | | <el-table-column prop="unit" label="åä½" /> |
| | | <el-table-column prop="unitPrice" label="åä»·"> |
| | | <template #default="scope">Â¥{{ Number(scope.row.unitPrice ?? 0).toFixed(2) }}</template> |
| | | <template #default="scope" |
| | | >Â¥{{ Number(scope.row.unitPrice ?? 0).toFixed(2) }}</template |
| | | > |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div v-if="detailData.remark" style="margin-top: 20px;"> |
| | | <div v-if="detailData.remark" style="margin-top: 20px"> |
| | | <h4>夿³¨</h4> |
| | | <p>{{ detailData.remark }}</p> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </div> |
| | | <div v-if="attachmentList.length" |
| | | class="detail-block"> |
| | | <div v-if="attachmentList.length" class="detail-block"> |
| | | <div class="detail-block-title">éä»¶å表</div> |
| | | <div class="attachment-list"> |
| | | <div v-for="file in attachmentList" |
| | | <div |
| | | v-for="file in attachmentList" |
| | | :key="file.id" |
| | | class="attachment-item"> |
| | | class="attachment-item" |
| | | > |
| | | <el-icon class="file-icon"> |
| | | <Paperclip /> |
| | | </el-icon> |
| | | <span class="file-name" |
| | | :title="file.name || file.originalFilename"> |
| | | <span class="file-name" :title="file.name || file.originalFilename"> |
| | | {{ file.name || file.originalFilename }} |
| | | </span> |
| | | <div class="file-actions"> |
| | | <el-link v-if="file.previewURL || file.url" |
| | | <el-link |
| | | v-if="file.previewURL || file.url" |
| | | type="primary" |
| | | :underline="false" |
| | | @click="openFile(file.previewURL || file.url)">é¢è§</el-link> |
| | | <el-divider v-if="(file.previewURL || file.url) && file.downloadURL" |
| | | direction="vertical" /> |
| | | <el-link v-if="file.downloadURL" |
| | | @click="openFile(file.previewURL || file.url)" |
| | | >é¢è§</el-link |
| | | > |
| | | <el-divider |
| | | v-if="(file.previewURL || file.url) && file.downloadURL" |
| | | direction="vertical" |
| | | /> |
| | | <el-link |
| | | v-if="file.downloadURL" |
| | | type="primary" |
| | | :underline="false" |
| | | @click="openFile(file.downloadURL)">ä¸è½½</el-link> |
| | | @click="openFile(file.downloadURL)" |
| | | >ä¸è½½</el-link |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | }); |
| | | |
| | | const formResolved = computed(() => resolveInstanceFormFields(props.row)); |
| | | |
| | | |
| | | // æ¯å¦ä¸ºç¹æ®å®¡æ¹ç±»åï¼éè´ãåè´§ãæ¥ä»·ï¼ |
| | | const isSpecialApprovalType = computed(() => { |
| | |
| | | if (approveSubmitting.value) return { ok: false }; |
| | | approveSubmitting.value = true; |
| | | try { |
| | | // åè´§å®¡æ¹æ¶ä¼ éåºåºæ¹å· |
| | | const extraData = {}; |
| | | if (Number(row.businessType) === 7 && detailData.value?.shippingInfo?.outboundBatches) { |
| | | extraData.outboundBatches = detailData.value.shippingInfo.outboundBatches; |
| | | } |
| | | await approveApprovalInstance( |
| | | buildApproveInstanceDto(row, result, approveOpinion.value, approveDialog.warehouse) |
| | | buildApproveInstanceDto(row, result, approveOpinion.value, approveDialog.warehouse, extraData) |
| | | ); |
| | | approveDialog.visible = false; |
| | | await fetchApprovalList(); |
| | |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js"; |
| | | import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js"; |
| | | import {ledgerListNoPage} from "@/api/salesManagement/salesLedger.js"; |
| | | import {ledgerListNoPage, productList} from "@/api/salesManagement/salesLedger.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | |
| | |
| | | salesContractNo: "", |
| | | }, |
| | | rules: { |
| | | checkTime: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | process: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkTime: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | process: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkName: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | productId: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | productModelId: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | testStandardId: [{ required: false, message: "è¯·éæ©ææ ", trigger: "change" }], |
| | | unit: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | quantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | qualifiedQuantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | unqualifiedQuantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | quantity: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | qualifiedQuantity: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | unqualifiedQuantity: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkCompany: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkResult: [{ required: true, message: "请è¾å
¥", trigger: "change" }], |
| | | checkResult: [{ required: false, message: "请è¾å
¥", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { form, rules } = toRefs(data); |
| | |
| | | form.value = {} |
| | | testStandardOptions.value = []; |
| | | tableData.value = []; |
| | | |
| | | // æ°å¢æ¨¡å¼ä¸ï¼é»è®¤è®¾ç½®äº§åå称为"马éè¯éªè±ç²"(id=320) |
| | | if (operationType.value === 'add') { |
| | | const defaultProductId = 320; |
| | | form.value.productId = defaultProductId; |
| | | currentProductId.value = defaultProductId; |
| | | form.value.productName = '马éè¯éªè±ç²'; |
| | | // å è½½è§æ ¼åå·å表 |
| | | try { |
| | | const modelRes = await modelList({ id: defaultProductId }); |
| | | modelOptions.value = modelRes || []; |
| | | // é»è®¤éä¸ç¬¬ä¸ä¸ªè§æ ¼åå· |
| | | if (modelOptions.value.length > 0) { |
| | | const firstModel = modelOptions.value[0]; |
| | | form.value.productModelId = firstModel.id; |
| | | form.value.model = firstModel.model || ''; |
| | | form.value.unit = firstModel.unit || ''; |
| | | } |
| | | // å è½½ææ é项 |
| | | getList(); |
| | | } catch (e) { |
| | | console.error('å è½½é»è®¤äº§åè§æ ¼åå·å¤±è´¥', e); |
| | | } |
| | | } |
| | | |
| | | if (operationType.value === 'edit' || operationType.value === 'view') { |
| | | // å
ä¿å testStandardIdï¼é¿å
被æ¸
空 |
| | |
| | | } |
| | | |
| | | // éå®è®¢åéæ©ååå¤ç |
| | | const handleSalesLedgerChange = (value) => { |
| | | const handleSalesLedgerChange = async (value) => { |
| | | const selectedItem = salesLedgerOptions.value.find(item => item.id == value); |
| | | if (selectedItem) { |
| | | form.value.salesContractNo = selectedItem.salesContractNo || ''; |
| | | // æ ¹æ®éå®è®¢åIDæ¥è¯¢äº§åä¿¡æ¯ï¼åªèµå¼æ°é |
| | | try { |
| | | const res = await productList({ salesLedgerId: value, type: 1 }); |
| | | const productData = res.data && res.data.length > 0 ? res.data[0] : null; |
| | | if (productData) { |
| | | // åªèªå¨å¸¦å
¥æ°é |
| | | form.value.quantity = productData.quantity || 0; |
| | | } |
| | | } catch (e) { |
| | | console.error('æ¥è¯¢éå®è®¢å产åä¿¡æ¯å¤±è´¥', e); |
| | | proxy.$modal.msgError('æ¥è¯¢éå®è®¢å产åä¿¡æ¯å¤±è´¥'); |
| | | } |
| | | } else { |
| | | form.value.salesContractNo = ''; |
| | | form.value.quantity = undefined; |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | title="å¿«éæ£éª" |
| | | width="70%" |
| | | @close="closeDialog" |
| | | > |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£æµç»æï¼" prop="checkResult"> |
| | | <el-select v-model="form.checkResult" placeholder="è¯·éæ©æ£æµç»æ" style="width: 100%" @change="handleCheckResultChange"> |
| | | <el-option label="åæ ¼" value="åæ ¼" /> |
| | | <el-option label="ä¸åæ ¼" value="ä¸åæ ¼" /> |
| | | <el-option label="é¨ååæ ¼" value="é¨ååæ ¼" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ææ éæ©ï¼" prop="testStandardId"> |
| | | <el-select v-model="form.testStandardId" placeholder="è¯·éæ©ææ " style="width: 100%" @change="handleTestStandardChange"> |
| | | <el-option |
| | | v-for="item in testStandardOptions" |
| | | :key="item.id" |
| | | :label="item.standardName || item.standardNo" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <template v-if="form.checkResult"> |
| | | <el-row :gutter="30"> |
| | | <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" @change="handleQuantityChange"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£æµåä½ï¼" prop="checkCompany"> |
| | | <el-input v-model="form.checkCompany" placeholder="请è¾å
¥æ£æµåä½" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åæ ¼æ°éï¼" prop="qualifiedQuantity"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.qualifiedQuantity" placeholder="请è¾å
¥åæ ¼æ°é" clearable :precision="2" @change="handleQualifiedQuantityChange"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸åæ ¼æ°éï¼" prop="unqualifiedQuantity"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.unqualifiedQuantity" placeholder="请è¾å
¥ä¸åæ ¼æ°é" clearable :precision="2" @change="handleUnqualifiedQuantityChange"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©æ£éªå" clearable style="width: 100%"> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£æµæ¥æï¼" prop="checkTime"> |
| | | <el-date-picker |
| | | v-model="form.checkTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ£æµæ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | </el-form> |
| | | <PIMTable |
| | | rowKey="id" |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :tableLoading="tableLoading" |
| | | height="400" |
| | | > |
| | | <template #slot="{ row }"> |
| | | <el-input v-model="row.testValue" clearable/> |
| | | </template> |
| | | </PIMTable> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDialog">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { batchQuickInspect } from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import { qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId } from "@/api/qualityManagement/metricMaintenance.js"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const emit = defineEmits(['close', 'success']); |
| | | |
| | | const dialogVisible = ref(false); |
| | | const userList = ref([]); |
| | | const selectedIds = ref([]); |
| | | const selectedRows = ref([]); |
| | | const testStandardOptions = ref([]); |
| | | const inspectType = ref(2); // åºåæ£éªç±»å |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | | checkResult: '', |
| | | testStandardId: '', |
| | | quantity: undefined, |
| | | qualifiedQuantity: undefined, |
| | | unqualifiedQuantity: undefined, |
| | | checkCompany: '', |
| | | checkName: '', |
| | | checkTime: '', |
| | | }, |
| | | rules: { |
| | | checkResult: [{ required: true, message: "è¯·éæ©æ£æµç»æ", trigger: "change" }], |
| | | testStandardId: [{ required: true, message: "è¯·éæ©ææ ", trigger: "change" }], |
| | | quantity: [{ required: true, message: "请è¾å
¥æ°é", trigger: "blur" }], |
| | | qualifiedQuantity: [{ required: true, message: "请è¾å
¥åæ ¼æ°é", trigger: "blur" }], |
| | | unqualifiedQuantity: [{ required: true, message: "请è¾å
¥ä¸åæ ¼æ°é", trigger: "blur" }], |
| | | checkCompany: [{ required: true, message: "请è¾å
¥æ£æµåä½", trigger: "blur" }], |
| | | checkName: [{ required: true, message: "è¯·éæ©æ£éªå", trigger: "change" }], |
| | | checkTime: [{ required: true, message: "è¯·éæ©æ£æµæ¥æ", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { form, rules } = toRefs(data); |
| | | |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "ææ ", |
| | | prop: "parameterItem", |
| | | }, |
| | | { |
| | | label: "åä½", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "æ åå¼", |
| | | prop: "standardValue", |
| | | }, |
| | | { |
| | | label: "å
æ§å¼", |
| | | prop: "controlValue", |
| | | }, |
| | | { |
| | | label: "æ£éªå¼", |
| | | prop: "testValue", |
| | | dataType: 'slot', |
| | | slot: 'slot', |
| | | }, |
| | | ]); |
| | | const tableData = ref([]); |
| | | const tableLoading = ref(false); |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openDialog = async (ids, rows) => { |
| | | selectedIds.value = ids; |
| | | selectedRows.value = rows; |
| | | dialogVisible.value = true; |
| | | |
| | | // å è½½ç¨æ·å表 |
| | | const userListsRes = await userListNoPage(); |
| | | userList.value = userListsRes.data; |
| | | |
| | | // å è½½ææ éé¡¹ï¼æ ¹æ®ç¬¬ä¸ä¸ªéä¸è¡ç产åIDï¼ |
| | | if (rows && rows.length > 0 && rows[0].productId) { |
| | | const params = { |
| | | productId: rows[0].productId, |
| | | inspectType: 2 |
| | | }; |
| | | const res = await qualityInspectDetailByProductId(params); |
| | | testStandardOptions.value = res.data || []; |
| | | } else { |
| | | testStandardOptions.value = []; |
| | | } |
| | | |
| | | // é置表å |
| | | form.value = { |
| | | checkResult: '', |
| | | testStandardId: '', |
| | | quantity: undefined, |
| | | qualifiedQuantity: undefined, |
| | | unqualifiedQuantity: undefined, |
| | | checkCompany: '', |
| | | checkName: '', |
| | | checkTime: '', |
| | | }; |
| | | tableData.value = []; |
| | | |
| | | await nextTick(); |
| | | proxy.$refs.formRef?.clearValidate(); |
| | | }; |
| | | |
| | | // ææ éæ©ååå¤ç |
| | | const handleTestStandardChange = async (testStandardId) => { |
| | | if (!testStandardId) { |
| | | tableData.value = []; |
| | | return; |
| | | } |
| | | tableLoading.value = true; |
| | | try { |
| | | const res = await getQualityTestStandardParamByTestStandardId(testStandardId); |
| | | tableData.value = (res.data || []).map(item => ({ |
| | | ...item, |
| | | id: null, |
| | | testValue: '' |
| | | })); |
| | | } catch (error) { |
| | | console.error('è·åæ ååæ°å¤±è´¥:', error); |
| | | tableData.value = []; |
| | | } finally { |
| | | tableLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | // æ£æµç»æååå¤ç |
| | | const handleCheckResultChange = (value) => { |
| | | if (value === 'åæ ¼') { |
| | | // åæ ¼æ¶ï¼åæ ¼æ°éçäºæ°éï¼ä¸åæ ¼æ°é为0 |
| | | form.value.qualifiedQuantity = form.value.quantity || 0; |
| | | form.value.unqualifiedQuantity = 0; |
| | | } else if (value === 'ä¸åæ ¼') { |
| | | // ä¸åæ ¼æ¶ï¼åæ ¼æ°é为0ï¼ä¸åæ ¼æ°éçäºæ°é |
| | | form.value.qualifiedQuantity = 0; |
| | | form.value.unqualifiedQuantity = form.value.quantity || 0; |
| | | } |
| | | }; |
| | | |
| | | // æ°éååå¤ç |
| | | const handleQuantityChange = (value) => { |
| | | if (form.value.checkResult === 'åæ ¼') { |
| | | form.value.qualifiedQuantity = value || 0; |
| | | form.value.unqualifiedQuantity = 0; |
| | | } else if (form.value.checkResult === 'ä¸åæ ¼') { |
| | | form.value.qualifiedQuantity = 0; |
| | | form.value.unqualifiedQuantity = value || 0; |
| | | } |
| | | }; |
| | | |
| | | // åæ ¼æ°éååå¤ç |
| | | const handleQualifiedQuantityChange = (value) => { |
| | | const quantity = form.value.quantity || 0; |
| | | if (value > quantity) { |
| | | proxy.$modal.msgWarning("åæ ¼æ°éä¸è½å¤§äºæ»æ°é"); |
| | | form.value.qualifiedQuantity = quantity; |
| | | form.value.unqualifiedQuantity = 0; |
| | | } else { |
| | | form.value.unqualifiedQuantity = Number((quantity - value).toFixed(2)); |
| | | } |
| | | updateCheckResult(); |
| | | }; |
| | | |
| | | // ä¸åæ ¼æ°éååå¤ç |
| | | const handleUnqualifiedQuantityChange = (value) => { |
| | | const quantity = form.value.quantity || 0; |
| | | if (value > quantity) { |
| | | proxy.$modal.msgWarning("ä¸åæ ¼æ°éä¸è½å¤§äºæ»æ°é"); |
| | | form.value.unqualifiedQuantity = quantity; |
| | | form.value.qualifiedQuantity = 0; |
| | | } else { |
| | | form.value.qualifiedQuantity = Number((quantity - value).toFixed(2)); |
| | | } |
| | | updateCheckResult(); |
| | | }; |
| | | |
| | | // æ ¹æ®åæ ¼/ä¸åæ ¼æ°éæ´æ°æ£æµç»æ |
| | | const updateCheckResult = () => { |
| | | const qualified = form.value.qualifiedQuantity || 0; |
| | | const unqualified = form.value.unqualifiedQuantity || 0; |
| | | const quantity = form.value.quantity || 0; |
| | | |
| | | if (qualified === quantity && unqualified === 0) { |
| | | form.value.checkResult = 'åæ ¼'; |
| | | } else if (unqualified === quantity && qualified === 0) { |
| | | form.value.checkResult = 'ä¸åæ ¼'; |
| | | } else if (qualified > 0 && unqualified > 0) { |
| | | form.value.checkResult = 'é¨ååæ ¼'; |
| | | } |
| | | }; |
| | | |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs.formRef.validate((valid) => { |
| | | if (valid) { |
| | | const data = { |
| | | ids: selectedIds.value, |
| | | inspectType: inspectType.value, |
| | | ...form.value, |
| | | paramList: tableData.value |
| | | }; |
| | | batchQuickInspect(data).then(res => { |
| | | proxy.$modal.msgSuccess(res.msg || "å¿«éæ£éªå®æ"); |
| | | emit('success'); |
| | | closeDialog(); |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // å
³éå¼¹æ¡ |
| | | const closeDialog = () => { |
| | | dialogVisible.value = false; |
| | | emit('close'); |
| | | }; |
| | | |
| | | defineExpose({ |
| | | openDialog, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | </style> |
| | |
| | | @close="handleQuery"></FormDia> |
| | | <files-dia ref="filesDia" |
| | | @close="handleQuery"></files-dia> |
| | | <QuickCheckDia ref="quickCheckDia" |
| | | @close="handleQuery" |
| | | @success="getList"></QuickCheckDia> |
| | | <el-dialog v-model="dialogFormVisible" |
| | | title="ç¼è¾æ£éªå" |
| | | width="30%" |
| | |
| | | } from "vue"; |
| | | import InspectionFormDia from "@/views/qualityManagement/finalInspection/components/inspectionFormDia.vue"; |
| | | import FormDia from "@/views/qualityManagement/finalInspection/components/formDia.vue"; |
| | | import QuickCheckDia from "@/views/qualityManagement/finalInspection/components/quickCheckDia.vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { |
| | | downloadQualityInspect, |
| | |
| | | qualityInspectListPage, |
| | | qualityInspectUpdate, |
| | | submitQualityInspect, |
| | | batchQuickInspect, |
| | | } from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import FilesDia from "@/views/qualityManagement/finalInspection/components/filesDia.vue"; |
| | | import dayjs from "dayjs"; |
| | |
| | | const formDia = ref(); |
| | | const filesDia = ref(); |
| | | const inspectionFormDia = ref(); |
| | | const quickCheckDia = ref(); |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore(); |
| | | const userList = ref([]); |
| | |
| | | return; |
| | | } |
| | | |
| | | const totalCount = selectedRows.value.length; |
| | | const submittedCount = totalCount - unSubmittedRows.length; |
| | | |
| | | let confirmMessage = `已鿩 ${totalCount} æ¡æ£éªå`; |
| | | if (submittedCount > 0) { |
| | | confirmMessage += `ï¼å
¶ä¸ ${submittedCount} æ¡å·²æäº¤ï¼å°èªå¨è·³è¿ï¼`; |
| | | } |
| | | confirmMessage += `\n\n确认åå°èªå¨ï¼\n· æ£éªç»æè®¾ä¸º"åæ ¼"\n· åæ ¼æ°éè®¾ä¸ºæ»æ°\n· ä¸åæ ¼æ°é设为 0\n· æäº¤å¹¶å
¥åº`; |
| | | |
| | | ElMessageBox.confirm(confirmMessage, "å¿«éæ£éª", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | dangerouslyUseHTMLString: false, |
| | | }) |
| | | .then(() => { |
| | | // è°ç¨æ¹éå¿«éæ£éªæ¥å£ |
| | | const ids = unSubmittedRows.map(item => item.id); |
| | | batchQuickInspect(ids).then(res => { |
| | | proxy.$modal.msgSuccess(res.msg || "å¿«éæ£éªå®æ"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | quickCheckDia.value?.openDialog(ids, unSubmittedRows); |
| | | }; |
| | | |
| | | // æå¼æ°å¢æ£éªå¼¹æ¡ |
| | |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="closeBindingDialog">åæ¶</el-button> |
| | | <el-button type="primary" @click="submitBinding">ç¡®å®</el-button> |
| | | <el-button @click="closeBindingDialog">åæ¶</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | formatData: (val) => { |
| | | const map = { 0: 'åæææ£éª', 1: 'è¿ç¨æ£éª', 2: 'åºåæ£éª' } |
| | | return map[val] || val |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åº', |
| | | prop: 'processId', |
| | | align: 'center', |
| | | dataType: 'tag', |
| | | formatData: (val) => { |
| | | const target = processOptions.value.find( |
| | | (item) => String(item.value) === String(val) |
| | | ) |
| | | return target?.label || val |
| | | } |
| | | }, |
| | | { |
| | |
| | | <el-option label="åºåæ£éª" value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥åº" prop="processId"> |
| | | <el-select v-model="form.processId" placeholder="è¯·éæ©å·¥åº" style="width: 100%"> |
| | | <el-option |
| | | v-for="item in processOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="state"> |
| | | <el-select v-model="form.state" placeholder="è¯·éæ©ç¶æ" style="width: 100%"> |
| | | <el-option label="è稿" value="0" /> |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åº', |
| | | prop: 'processId', |
| | | align: 'center', |
| | | dataType: 'tag', |
| | | formatData: (val) => { |
| | | const target = processOptions.value.find( |
| | | (item) => String(item.value) === String(val) |
| | | ) |
| | | return target?.label || val |
| | | } |
| | | }, |
| | | { |
| | | label: 'ç¶æ', |
| | | prop: 'state', |
| | | headerSlot: 'stateHeader', |
| | |
| | | ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å·¥åºï¼" |
| | | prop="process"> |
| | | <el-select v-model="form.process" |
| | | placeholder="è¯·éæ©å·¥åº" |
| | | <el-form-item label="éè´ååå·ï¼" |
| | | prop="purchaseContractNo"> |
| | | <el-select v-model="form.purchaseContractNo" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | :disabled="isViewMode || processQuantityDisabled" |
| | | filterable |
| | | :disabled="isViewMode" |
| | | style="width: 100%"> |
| | | <el-option v-for="item in processList" |
| | | :key="item.name" |
| | | :label="item.name" |
| | | :value="item.name" /> |
| | | <el-option v-for="item in purchaseContractList" |
| | | :key="item.id" |
| | | :label="item.purchaseContractNumber + ' - ' + item.supplierName" |
| | | :value="item.purchaseContractNumber" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | getCurrentInstance, |
| | | nextTick, |
| | | } from "vue"; |
| | | import { getOptions } from "@/api/procurementManagement/procurementLedger.js"; |
| | | import { getOptions, purchaseListPage } from "@/api/procurementManagement/procurementLedger.js"; |
| | | import { modelList, productTreeList } from "@/api/basicData/product.js"; |
| | | import { |
| | | qualityInspectAdd, |
| | |
| | | } from "@/api/qualityManagement/metricMaintenance.js"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { qualityInspectParamInfo } from "@/api/qualityManagement/qualityInspectParam.js"; |
| | | import { list } from "@/api/productionManagement/productionProcess"; |
| | | |
| | | import qualified from "@/views/inventoryManagement/stockManagement/Qualified.vue"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const emit = defineEmits(["close"]); |
| | |
| | | const data = reactive({ |
| | | form: { |
| | | checkTime: "", |
| | | process: "", |
| | | checkName: "", |
| | | productName: "", |
| | | productId: "", |
| | |
| | | unqualifiedQuantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | purchaseContractNo: "", |
| | | }, |
| | | rules: { |
| | | checkTime: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | process: [{ required: true, message: "è¯·éæ©å·¥åº", trigger: "change" }], |
| | | checkTime: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkName: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | productId: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | productModelId: [{ required: true, message: "è¯·éæ©", trigger: "change" }], |
| | | testStandardId: [{ required: false, message: "è¯·éæ©ææ ", trigger: "change" }], |
| | | unit: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | quantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | qualifiedQuantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | unqualifiedQuantity: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | quantity: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | qualifiedQuantity: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | unqualifiedQuantity: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkCompany: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkResult: [{ required: true, message: "请è¾å
¥", trigger: "change" }], |
| | | purchaseContractNo: [{ required: false, message: "è¯·éæ©", trigger: "change" }], |
| | | checkResult: [{ required: false, message: "请è¾å
¥", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const userList = ref([]); |
| | |
| | | const v = form.value || {}; |
| | | return !!(v.productMainId != null || v.purchaseLedgerId != null); |
| | | }); |
| | | const processList = ref([]); // å·¥åºä¸æå表ï¼å·¥åºåç§° nameï¼ |
| | | |
| | | const supplierList = ref([]); |
| | | const productOptions = ref([]); |
| | | const purchaseContractList = ref([]); // éè´ååå·å表 |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "ææ ", |
| | |
| | | getOptions().then(res => { |
| | | supplierList.value = res.data; |
| | | }); |
| | | // å 载工åºä¸æå表 |
| | | try { |
| | | const res = await list({ size: -1, current: -1 }); |
| | | processList.value = res.data.records || []; |
| | | } catch (e) { |
| | | console.error("å 载工åºå表失败", e); |
| | | processList.value = []; |
| | | } |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data; |
| | | // å
éç½®è¡¨åæ°æ®ï¼ä¿æåæ®µå®æ´ï¼é¿å
å¼¹çªé¦æ¬¡æ¸²ææ¶è§¦åå¿
填红æ¡âéªä¸ä¸âï¼ |
| | | // å è½½éè´ååå·å表 |
| | | try { |
| | | const contractRes = await purchaseListPage({ pageNum: -1, pageSize: -1 }); |
| | | purchaseContractList.value = contractRes.data?.records || []; |
| | | } catch (e) { |
| | | console.error("å è½½éè´ååå·å¤±è´¥", e); |
| | | purchaseContractList.value = []; |
| | | } |
| | | // å
éç½®è¡¨åæ°æ®ï¼ä¿æåæ®µå®æ´ï¼é¿å
å¼¹çªé¦æ¬¡æ¸²ææ¶è§¦åå¿
填红æ¡"éªä¸ä¸"ï¼ |
| | | form.value = { |
| | | checkTime: "", |
| | | process: "", |
| | | checkName: "", |
| | | productName: "", |
| | | productId: "", |
| | |
| | | quantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | purchaseContractNo: "", |
| | | }; |
| | | testStandardOptions.value = []; |
| | | tableData.value = []; |
| | |
| | | let params = { |
| | | productId: currentProductId.value, |
| | | inspectType: 1, |
| | | process: form.value.process || "", |
| | | }; |
| | | qualityInspectDetailByProductId(params).then(res => { |
| | | testStandardOptions.value = res.data || []; |
| | |
| | | return; |
| | | } |
| | | |
| | | // æ ¹æ®éè´ååå·æ¥æ¾å¯¹åºç purchaseLedgerId |
| | | const selectedContract = purchaseContractList.value.find( |
| | | item => item.purchaseContractNumber === form.value.purchaseContractNo |
| | | ); |
| | | const purchaseLedgerId = selectedContract ? selectedContract.id : null; |
| | | |
| | | const data = { |
| | | ...form.value, |
| | | process: processName, // ä¿ç process åæ®µä»¥å
¼å®¹å端 |
| | | purchaseLedgerId: purchaseLedgerId, // æäº¤ purchaseLedgerId |
| | | qualityInspectParams: tableData.value, |
| | | }; |
| | | if (operationType.value === "add") { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | title="å¿«éæ£éª" |
| | | width="70%" |
| | | @close="closeDialog" |
| | | > |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£æµç»æï¼" prop="checkResult"> |
| | | <el-select v-model="form.checkResult" placeholder="è¯·éæ©æ£æµç»æ" style="width: 100%" @change="handleCheckResultChange"> |
| | | <el-option label="åæ ¼" value="åæ ¼" /> |
| | | <el-option label="ä¸åæ ¼" value="ä¸åæ ¼" /> |
| | | <el-option label="é¨ååæ ¼" value="é¨ååæ ¼" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ææ éæ©ï¼" prop="testStandardId"> |
| | | <el-select v-model="form.testStandardId" placeholder="è¯·éæ©ææ " style="width: 100%" @change="handleTestStandardChange"> |
| | | <el-option |
| | | v-for="item in testStandardOptions" |
| | | :key="item.id" |
| | | :label="item.standardName || item.standardNo" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <template v-if="form.checkResult"> |
| | | <el-row :gutter="30"> |
| | | <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" @change="handleQuantityChange"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£æµåä½ï¼" prop="checkCompany"> |
| | | <el-input v-model="form.checkCompany" placeholder="请è¾å
¥æ£æµåä½" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åæ ¼æ°éï¼" prop="qualifiedQuantity"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.qualifiedQuantity" placeholder="请è¾å
¥åæ ¼æ°é" clearable :precision="2" @change="handleQualifiedQuantityChange"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸åæ ¼æ°éï¼" prop="unqualifiedQuantity"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.unqualifiedQuantity" placeholder="请è¾å
¥ä¸åæ ¼æ°é" clearable :precision="2" @change="handleUnqualifiedQuantityChange"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©æ£éªå" clearable style="width: 100%"> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£æµæ¥æï¼" prop="checkTime"> |
| | | <el-date-picker |
| | | v-model="form.checkTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ£æµæ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | </el-form> |
| | | <PIMTable |
| | | rowKey="id" |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :tableLoading="tableLoading" |
| | | height="400" |
| | | > |
| | | <template #slot="{ row }"> |
| | | <el-input v-model="row.testValue" clearable/> |
| | | </template> |
| | | </PIMTable> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDialog">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { batchQuickInspect } from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import { qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId } from "@/api/qualityManagement/metricMaintenance.js"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const emit = defineEmits(['close', 'success']); |
| | | |
| | | const dialogVisible = ref(false); |
| | | const userList = ref([]); |
| | | const selectedIds = ref([]); |
| | | const selectedRows = ref([]); |
| | | const testStandardOptions = ref([]); |
| | | const inspectType = ref(1); // è¿ç¨æ£éªç±»å |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | | checkResult: '', |
| | | testStandardId: '', |
| | | quantity: undefined, |
| | | qualifiedQuantity: undefined, |
| | | unqualifiedQuantity: undefined, |
| | | checkCompany: '', |
| | | checkName: '', |
| | | checkTime: '', |
| | | }, |
| | | rules: { |
| | | checkResult: [{ required: true, message: "è¯·éæ©æ£æµç»æ", trigger: "change" }], |
| | | testStandardId: [{ required: true, message: "è¯·éæ©ææ ", trigger: "change" }], |
| | | quantity: [{ required: true, message: "请è¾å
¥æ°é", trigger: "blur" }], |
| | | qualifiedQuantity: [{ required: true, message: "请è¾å
¥åæ ¼æ°é", trigger: "blur" }], |
| | | unqualifiedQuantity: [{ required: true, message: "请è¾å
¥ä¸åæ ¼æ°é", trigger: "blur" }], |
| | | checkCompany: [{ required: true, message: "请è¾å
¥æ£æµåä½", trigger: "blur" }], |
| | | checkName: [{ required: true, message: "è¯·éæ©æ£éªå", trigger: "change" }], |
| | | checkTime: [{ required: true, message: "è¯·éæ©æ£æµæ¥æ", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { form, rules } = toRefs(data); |
| | | |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "ææ ", |
| | | prop: "parameterItem", |
| | | }, |
| | | { |
| | | label: "åä½", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "æ åå¼", |
| | | prop: "standardValue", |
| | | }, |
| | | { |
| | | label: "å
æ§å¼", |
| | | prop: "controlValue", |
| | | }, |
| | | { |
| | | label: "æ£éªå¼", |
| | | prop: "testValue", |
| | | dataType: 'slot', |
| | | slot: 'slot', |
| | | }, |
| | | ]); |
| | | const tableData = ref([]); |
| | | const tableLoading = ref(false); |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openDialog = async (ids, rows) => { |
| | | selectedIds.value = ids; |
| | | selectedRows.value = rows; |
| | | dialogVisible.value = true; |
| | | |
| | | // å è½½ç¨æ·å表 |
| | | const userListsRes = await userListNoPage(); |
| | | userList.value = userListsRes.data; |
| | | |
| | | // å è½½ææ éé¡¹ï¼æ ¹æ®ç¬¬ä¸ä¸ªéä¸è¡ç产åIDï¼ |
| | | if (rows && rows.length > 0 && rows[0].productId) { |
| | | const params = { |
| | | productId: rows[0].productId, |
| | | inspectType: 1 |
| | | }; |
| | | const res = await qualityInspectDetailByProductId(params); |
| | | testStandardOptions.value = res.data || []; |
| | | } else { |
| | | testStandardOptions.value = []; |
| | | } |
| | | |
| | | // é置表å |
| | | form.value = { |
| | | checkResult: '', |
| | | testStandardId: '', |
| | | quantity: undefined, |
| | | qualifiedQuantity: undefined, |
| | | unqualifiedQuantity: undefined, |
| | | checkCompany: '', |
| | | checkName: '', |
| | | checkTime: '', |
| | | }; |
| | | tableData.value = []; |
| | | |
| | | await nextTick(); |
| | | proxy.$refs.formRef?.clearValidate(); |
| | | }; |
| | | |
| | | // ææ éæ©ååå¤ç |
| | | const handleTestStandardChange = async (testStandardId) => { |
| | | if (!testStandardId) { |
| | | tableData.value = []; |
| | | return; |
| | | } |
| | | tableLoading.value = true; |
| | | try { |
| | | const res = await getQualityTestStandardParamByTestStandardId(testStandardId); |
| | | tableData.value = (res.data || []).map(item => ({ |
| | | ...item, |
| | | id: null, |
| | | testValue: '' |
| | | })); |
| | | } catch (error) { |
| | | console.error('è·åæ ååæ°å¤±è´¥:', error); |
| | | tableData.value = []; |
| | | } finally { |
| | | tableLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | // æ£æµç»æååå¤ç |
| | | const handleCheckResultChange = (value) => { |
| | | if (value === 'åæ ¼') { |
| | | // åæ ¼æ¶ï¼åæ ¼æ°éçäºæ°éï¼ä¸åæ ¼æ°é为0 |
| | | form.value.qualifiedQuantity = form.value.quantity || 0; |
| | | form.value.unqualifiedQuantity = 0; |
| | | } else if (value === 'ä¸åæ ¼') { |
| | | // ä¸åæ ¼æ¶ï¼åæ ¼æ°é为0ï¼ä¸åæ ¼æ°éçäºæ°é |
| | | form.value.qualifiedQuantity = 0; |
| | | form.value.unqualifiedQuantity = form.value.quantity || 0; |
| | | } |
| | | }; |
| | | |
| | | // æ°éååå¤ç |
| | | const handleQuantityChange = (value) => { |
| | | if (form.value.checkResult === 'åæ ¼') { |
| | | form.value.qualifiedQuantity = value || 0; |
| | | form.value.unqualifiedQuantity = 0; |
| | | } else if (form.value.checkResult === 'ä¸åæ ¼') { |
| | | form.value.qualifiedQuantity = 0; |
| | | form.value.unqualifiedQuantity = value || 0; |
| | | } |
| | | }; |
| | | |
| | | // åæ ¼æ°éååå¤ç |
| | | const handleQualifiedQuantityChange = (value) => { |
| | | const quantity = form.value.quantity || 0; |
| | | if (value > quantity) { |
| | | proxy.$modal.msgWarning("åæ ¼æ°éä¸è½å¤§äºæ»æ°é"); |
| | | form.value.qualifiedQuantity = quantity; |
| | | form.value.unqualifiedQuantity = 0; |
| | | } else { |
| | | form.value.unqualifiedQuantity = Number((quantity - value).toFixed(2)); |
| | | } |
| | | updateCheckResult(); |
| | | }; |
| | | |
| | | // ä¸åæ ¼æ°éååå¤ç |
| | | const handleUnqualifiedQuantityChange = (value) => { |
| | | const quantity = form.value.quantity || 0; |
| | | if (value > quantity) { |
| | | proxy.$modal.msgWarning("ä¸åæ ¼æ°éä¸è½å¤§äºæ»æ°é"); |
| | | form.value.unqualifiedQuantity = quantity; |
| | | form.value.qualifiedQuantity = 0; |
| | | } else { |
| | | form.value.qualifiedQuantity = Number((quantity - value).toFixed(2)); |
| | | } |
| | | updateCheckResult(); |
| | | }; |
| | | |
| | | // æ ¹æ®åæ ¼/ä¸åæ ¼æ°éæ´æ°æ£æµç»æ |
| | | const updateCheckResult = () => { |
| | | const qualified = form.value.qualifiedQuantity || 0; |
| | | const unqualified = form.value.unqualifiedQuantity || 0; |
| | | const quantity = form.value.quantity || 0; |
| | | |
| | | if (qualified === quantity && unqualified === 0) { |
| | | form.value.checkResult = 'åæ ¼'; |
| | | } else if (unqualified === quantity && qualified === 0) { |
| | | form.value.checkResult = 'ä¸åæ ¼'; |
| | | } else if (qualified > 0 && unqualified > 0) { |
| | | form.value.checkResult = 'é¨ååæ ¼'; |
| | | } |
| | | }; |
| | | |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs.formRef.validate((valid) => { |
| | | if (valid) { |
| | | const data = { |
| | | ids: selectedIds.value, |
| | | inspectType: inspectType.value, |
| | | ...form.value, |
| | | paramList: tableData.value |
| | | }; |
| | | batchQuickInspect(data).then(res => { |
| | | proxy.$modal.msgSuccess(res.msg || "å¿«éæ£éªå®æ"); |
| | | emit('success'); |
| | | closeDialog(); |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // å
³éå¼¹æ¡ |
| | | const closeDialog = () => { |
| | | dialogVisible.value = false; |
| | | emit('close'); |
| | | }; |
| | | |
| | | defineExpose({ |
| | | openDialog, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | </style> |
| | |
| | | <div class="app-container"> |
| | | <div class="search_form mb20"> |
| | | <div> |
| | | <span class="search_title">å·¥åºï¼</span> |
| | | <el-input v-model="searchForm.process" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥å·¥åºæç´¢" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" /> |
| | | <span style="margin-left: 10px" |
| | | class="search_title">æ£æµæ¥æï¼</span> |
| | | <el-date-picker v-model="searchForm.entryDate" |
| | |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | @change="changeDaterange" /> |
| | | <span style="margin-left: 10px" |
| | | class="search_title">ç产工åå·ï¼</span> |
| | | <el-input v-model="searchForm.workOrderNo" |
| | | style="width: 240px" |
| | | placeholder="请è¾å
¥ç产工åå·æç´¢" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" /> |
| | | <el-button type="primary" |
| | | @click="handleQuery" |
| | | style="margin-left: 10px">æç´¢</el-button> |
| | |
| | | @close="handleQuery"></FormDia> |
| | | <files-dia ref="filesDia" |
| | | @close="handleQuery"></files-dia> |
| | | <QuickCheckDia ref="quickCheckDia" |
| | | @close="handleQuery" |
| | | @success="getList"></QuickCheckDia> |
| | | <el-dialog v-model="dialogFormVisible" |
| | | title="ç¼è¾æ£éªå" |
| | | width="30%" |
| | |
| | | } from "vue"; |
| | | import InspectionFormDia from "@/views/qualityManagement/processInspection/components/inspectionFormDia.vue"; |
| | | import FormDia from "@/views/qualityManagement/processInspection/components/formDia.vue"; |
| | | import QuickCheckDia from "@/views/qualityManagement/processInspection/components/quickCheckDia.vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { |
| | | downloadQualityInspect, |
| | |
| | | qualityInspectListPage, |
| | | qualityInspectUpdate, |
| | | submitQualityInspect, |
| | | batchQuickInspect, |
| | | } from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import FilesDia from "@/views/qualityManagement/processInspection/components/filesDia.vue"; |
| | | import dayjs from "dayjs"; |
| | |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | process: "", |
| | | entryDate: undefined, // å½å
¥æ¥æ |
| | | workOrderNo: "", |
| | | entryDateStart: undefined, |
| | |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "å·¥åº", |
| | | prop: "process", |
| | | width: 230, |
| | | }, |
| | | { |
| | | label: "æ£éªå", |
| | | prop: "checkName", |
| | | }, |
| | | { |
| | | label: "éè´ååå·", |
| | | prop: "purchaseContractNo", |
| | | width: 150, |
| | | }, |
| | | { |
| | | label: "产ååç§°", |
| | |
| | | const formDia = ref(); |
| | | const filesDia = ref(); |
| | | const inspectionFormDia = ref(); |
| | | const quickCheckDia = ref(); |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore(); |
| | | const changeDaterange = value => { |
| | |
| | | return; |
| | | } |
| | | |
| | | const totalCount = selectedRows.value.length; |
| | | const submittedCount = totalCount - unSubmittedRows.length; |
| | | |
| | | let confirmMessage = `已鿩 ${totalCount} æ¡æ£éªå`; |
| | | if (submittedCount > 0) { |
| | | confirmMessage += `ï¼å
¶ä¸ ${submittedCount} æ¡å·²æäº¤ï¼å°èªå¨è·³è¿ï¼`; |
| | | } |
| | | confirmMessage += `\n\n确认åå°èªå¨ï¼\n· æ£éªç»æè®¾ä¸º"åæ ¼"\n· åæ ¼æ°éè®¾ä¸ºæ»æ°\n· ä¸åæ ¼æ°é设为 0\n· æäº¤å¹¶å
¥åº`; |
| | | |
| | | ElMessageBox.confirm(confirmMessage, "å¿«éæ£éª", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | dangerouslyUseHTMLString: false, |
| | | }) |
| | | .then(() => { |
| | | // è°ç¨æ¹éå¿«éæ£éªæ¥å£ |
| | | const ids = unSubmittedRows.map(item => item.id); |
| | | batchQuickInspect(ids).then(res => { |
| | | proxy.$modal.msgSuccess(res.msg || "å¿«éæ£éªå®æ"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | quickCheckDia.value?.openDialog(ids, unSubmittedRows); |
| | | }; |
| | | |
| | | // æå¼æ°å¢æ£éªå¼¹æ¡ |
| | |
| | | checkResult: "", |
| | | }, |
| | | rules: { |
| | | checkTime: [{required: true, message: "请è¾å
¥", trigger: "blur"},], |
| | | checkTime: [{required: false, message: "请è¾å
¥", trigger: "blur"},], |
| | | supplier: [{required: true, message: "请è¾å
¥", trigger: "blur"}], |
| | | checkName: [{required: false, message: "请è¾å
¥", trigger: "blur"}], |
| | | productId: [{required: true, message: "请è¾å
¥", trigger: "blur"}], |
| | | productModelId: [{required: true, message: "è¯·éæ©äº§ååå·", trigger: "change"}], |
| | | testStandardId: [{required: false, message: "è¯·éæ©ææ ", trigger: "change"}], |
| | | unit: [{required: false, message: "请è¾å
¥", trigger: "blur"}], |
| | | quantity: [{required: true, message: "请è¾å
¥", trigger: "blur"}], |
| | | qualifiedQuantity: [{required: true, message: "请è¾å
¥", trigger: "blur"}], |
| | | unqualifiedQuantity: [{required: true, message: "请è¾å
¥", trigger: "blur"}], |
| | | quantity: [{required: false, message: "请è¾å
¥", trigger: "blur"}], |
| | | qualifiedQuantity: [{required: false, message: "请è¾å
¥", trigger: "blur"}], |
| | | unqualifiedQuantity: [{required: false, message: "请è¾å
¥", trigger: "blur"}], |
| | | checkCompany: [{required: false, message: "请è¾å
¥", trigger: "blur"}], |
| | | checkResult: [{required: true, message: "è¯·éæ©æ£æµç»æ", trigger: "change"}], |
| | | checkResult: [{required: false, message: "è¯·éæ©æ£æµç»æ", trigger: "change"}], |
| | | }, |
| | | }); |
| | | const tableColumn = ref([ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | title="å¿«éæ£éª" |
| | | width="70%" |
| | | @close="closeDialog" |
| | | > |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£æµç»æï¼" prop="checkResult"> |
| | | <el-select v-model="form.checkResult" placeholder="è¯·éæ©æ£æµç»æ" style="width: 100%" @change="handleCheckResultChange"> |
| | | <el-option label="åæ ¼" value="åæ ¼" /> |
| | | <el-option label="ä¸åæ ¼" value="ä¸åæ ¼" /> |
| | | <el-option label="é¨ååæ ¼" value="é¨ååæ ¼" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ææ éæ©ï¼" prop="testStandardId"> |
| | | <el-select v-model="form.testStandardId" placeholder="è¯·éæ©ææ " style="width: 100%" @change="handleTestStandardChange"> |
| | | <el-option |
| | | v-for="item in testStandardOptions" |
| | | :key="item.id" |
| | | :label="item.standardName || item.standardNo" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <template v-if="form.checkResult"> |
| | | <el-row :gutter="30"> |
| | | <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" @change="handleQuantityChange"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£æµåä½ï¼" prop="checkCompany"> |
| | | <el-input v-model="form.checkCompany" placeholder="请è¾å
¥æ£æµåä½" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åæ ¼æ°éï¼" prop="qualifiedQuantity"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.qualifiedQuantity" placeholder="请è¾å
¥åæ ¼æ°é" clearable :precision="2" @change="handleQualifiedQuantityChange"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸åæ ¼æ°éï¼" prop="unqualifiedQuantity"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.unqualifiedQuantity" placeholder="请è¾å
¥ä¸åæ ¼æ°é" clearable :precision="2" @change="handleUnqualifiedQuantityChange"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©æ£éªå" clearable style="width: 100%"> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£æµæ¥æï¼" prop="checkTime"> |
| | | <el-date-picker |
| | | v-model="form.checkTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ£æµæ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | </el-form> |
| | | <PIMTable |
| | | rowKey="id" |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :tableLoading="tableLoading" |
| | | height="400" |
| | | > |
| | | <template #slot="{ row }"> |
| | | <el-input v-model="row.testValue" clearable/> |
| | | </template> |
| | | </PIMTable> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDialog">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import { batchQuickInspect } from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import { qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId } from "@/api/qualityManagement/metricMaintenance.js"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const emit = defineEmits(['close', 'success']); |
| | | |
| | | const dialogVisible = ref(false); |
| | | const userList = ref([]); |
| | | const selectedIds = ref([]); |
| | | const selectedRows = ref([]); |
| | | const testStandardOptions = ref([]); |
| | | const inspectType = ref(0); // åæææ£éªç±»å |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | | checkResult: '', |
| | | testStandardId: '', |
| | | quantity: undefined, |
| | | qualifiedQuantity: undefined, |
| | | unqualifiedQuantity: undefined, |
| | | checkCompany: '', |
| | | checkName: '', |
| | | checkTime: '', |
| | | }, |
| | | rules: { |
| | | checkResult: [{ required: true, message: "è¯·éæ©æ£æµç»æ", trigger: "change" }], |
| | | testStandardId: [{ required: true, message: "è¯·éæ©ææ ", trigger: "change" }], |
| | | quantity: [{ required: true, message: "请è¾å
¥æ°é", trigger: "blur" }], |
| | | qualifiedQuantity: [{ required: true, message: "请è¾å
¥åæ ¼æ°é", trigger: "blur" }], |
| | | unqualifiedQuantity: [{ required: true, message: "请è¾å
¥ä¸åæ ¼æ°é", trigger: "blur" }], |
| | | checkCompany: [{ required: true, message: "请è¾å
¥æ£æµåä½", trigger: "blur" }], |
| | | checkName: [{ required: true, message: "è¯·éæ©æ£éªå", trigger: "change" }], |
| | | checkTime: [{ required: true, message: "è¯·éæ©æ£æµæ¥æ", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { form, rules } = toRefs(data); |
| | | |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "ææ ", |
| | | prop: "parameterItem", |
| | | }, |
| | | { |
| | | label: "åä½", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "æ åå¼", |
| | | prop: "standardValue", |
| | | }, |
| | | { |
| | | label: "å
æ§å¼", |
| | | prop: "controlValue", |
| | | }, |
| | | { |
| | | label: "æ£éªå¼", |
| | | prop: "testValue", |
| | | dataType: 'slot', |
| | | slot: 'slot', |
| | | }, |
| | | ]); |
| | | const tableData = ref([]); |
| | | const tableLoading = ref(false); |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openDialog = async (ids, rows) => { |
| | | selectedIds.value = ids; |
| | | selectedRows.value = rows; |
| | | dialogVisible.value = true; |
| | | |
| | | // å è½½ç¨æ·å表 |
| | | const userListsRes = await userListNoPage(); |
| | | userList.value = userListsRes.data; |
| | | |
| | | // å è½½ææ éé¡¹ï¼æ ¹æ®ç¬¬ä¸ä¸ªéä¸è¡ç产åIDï¼ |
| | | if (rows && rows.length > 0 && rows[0].productId) { |
| | | const params = { |
| | | productId: rows[0].productId, |
| | | inspectType: 0 |
| | | }; |
| | | const res = await qualityInspectDetailByProductId(params); |
| | | testStandardOptions.value = res.data || []; |
| | | } else { |
| | | testStandardOptions.value = []; |
| | | } |
| | | |
| | | // é置表å |
| | | form.value = { |
| | | checkResult: '', |
| | | testStandardId: '', |
| | | quantity: undefined, |
| | | qualifiedQuantity: undefined, |
| | | unqualifiedQuantity: undefined, |
| | | checkCompany: '', |
| | | checkName: '', |
| | | checkTime: '', |
| | | }; |
| | | tableData.value = []; |
| | | |
| | | await nextTick(); |
| | | proxy.$refs.formRef?.clearValidate(); |
| | | }; |
| | | |
| | | // ææ éæ©ååå¤ç |
| | | const handleTestStandardChange = async (testStandardId) => { |
| | | if (!testStandardId) { |
| | | tableData.value = []; |
| | | return; |
| | | } |
| | | tableLoading.value = true; |
| | | try { |
| | | const res = await getQualityTestStandardParamByTestStandardId(testStandardId); |
| | | tableData.value = (res.data || []).map(item => ({ |
| | | ...item, |
| | | id: null, |
| | | testValue: '' |
| | | })); |
| | | } catch (error) { |
| | | console.error('è·åæ ååæ°å¤±è´¥:', error); |
| | | tableData.value = []; |
| | | } finally { |
| | | tableLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | // æ£æµç»æååå¤ç |
| | | const handleCheckResultChange = (value) => { |
| | | if (value === 'åæ ¼') { |
| | | // åæ ¼æ¶ï¼åæ ¼æ°éçäºæ°éï¼ä¸åæ ¼æ°é为0 |
| | | form.value.qualifiedQuantity = form.value.quantity || 0; |
| | | form.value.unqualifiedQuantity = 0; |
| | | } else if (value === 'ä¸åæ ¼') { |
| | | // ä¸åæ ¼æ¶ï¼åæ ¼æ°é为0ï¼ä¸åæ ¼æ°éçäºæ°é |
| | | form.value.qualifiedQuantity = 0; |
| | | form.value.unqualifiedQuantity = form.value.quantity || 0; |
| | | } |
| | | }; |
| | | |
| | | // æ°éååå¤ç |
| | | const handleQuantityChange = (value) => { |
| | | if (form.value.checkResult === 'åæ ¼') { |
| | | form.value.qualifiedQuantity = value || 0; |
| | | form.value.unqualifiedQuantity = 0; |
| | | } else if (form.value.checkResult === 'ä¸åæ ¼') { |
| | | form.value.qualifiedQuantity = 0; |
| | | form.value.unqualifiedQuantity = value || 0; |
| | | } |
| | | }; |
| | | |
| | | // åæ ¼æ°éååå¤ç |
| | | const handleQualifiedQuantityChange = (value) => { |
| | | const quantity = form.value.quantity || 0; |
| | | if (value > quantity) { |
| | | proxy.$modal.msgWarning("åæ ¼æ°éä¸è½å¤§äºæ»æ°é"); |
| | | form.value.qualifiedQuantity = quantity; |
| | | form.value.unqualifiedQuantity = 0; |
| | | } else { |
| | | form.value.unqualifiedQuantity = Number((quantity - value).toFixed(2)); |
| | | } |
| | | updateCheckResult(); |
| | | }; |
| | | |
| | | // ä¸åæ ¼æ°éååå¤ç |
| | | const handleUnqualifiedQuantityChange = (value) => { |
| | | const quantity = form.value.quantity || 0; |
| | | if (value > quantity) { |
| | | proxy.$modal.msgWarning("ä¸åæ ¼æ°éä¸è½å¤§äºæ»æ°é"); |
| | | form.value.unqualifiedQuantity = quantity; |
| | | form.value.qualifiedQuantity = 0; |
| | | } else { |
| | | form.value.qualifiedQuantity = Number((quantity - value).toFixed(2)); |
| | | } |
| | | updateCheckResult(); |
| | | }; |
| | | |
| | | // æ ¹æ®åæ ¼/ä¸åæ ¼æ°éæ´æ°æ£æµç»æ |
| | | const updateCheckResult = () => { |
| | | const qualified = form.value.qualifiedQuantity || 0; |
| | | const unqualified = form.value.unqualifiedQuantity || 0; |
| | | const quantity = form.value.quantity || 0; |
| | | |
| | | if (qualified === quantity && unqualified === 0) { |
| | | form.value.checkResult = 'åæ ¼'; |
| | | } else if (unqualified === quantity && qualified === 0) { |
| | | form.value.checkResult = 'ä¸åæ ¼'; |
| | | } else if (qualified > 0 && unqualified > 0) { |
| | | form.value.checkResult = 'é¨ååæ ¼'; |
| | | } |
| | | }; |
| | | |
| | | // æäº¤è¡¨å |
| | | const submitForm = () => { |
| | | proxy.$refs.formRef.validate((valid) => { |
| | | if (valid) { |
| | | const data = { |
| | | ids: selectedIds.value, |
| | | inspectType: inspectType.value, |
| | | ...form.value, |
| | | paramList: tableData.value |
| | | }; |
| | | batchQuickInspect(data).then(res => { |
| | | proxy.$modal.msgSuccess(res.msg || "å¿«éæ£éªå®æ"); |
| | | emit('success'); |
| | | closeDialog(); |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // å
³éå¼¹æ¡ |
| | | const closeDialog = () => { |
| | | dialogVisible.value = false; |
| | | emit('close'); |
| | | }; |
| | | |
| | | defineExpose({ |
| | | openDialog, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | </style> |
| | |
| | | @close="handleQuery"></FormDia> |
| | | <files-dia ref="filesDia" |
| | | @close="handleQuery"></files-dia> |
| | | <QuickCheckDia ref="quickCheckDia" |
| | | @close="handleQuery" |
| | | @success="getList"></QuickCheckDia> |
| | | <el-dialog v-model="dialogFormVisible" |
| | | title="ç¼è¾æ£éªå" |
| | | width="30%" |
| | |
| | | } from "vue"; |
| | | import InspectionFormDia from "@/views/qualityManagement/rawMaterialInspection/components/inspectionFormDia.vue"; |
| | | import FormDia from "@/views/qualityManagement/rawMaterialInspection/components/formDia.vue"; |
| | | import QuickCheckDia from "@/views/qualityManagement/rawMaterialInspection/components/quickCheckDia.vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { |
| | | downloadQualityInspect, |
| | |
| | | qualityInspectListPage, |
| | | qualityInspectUpdate, |
| | | submitQualityInspect, |
| | | batchQuickInspect, |
| | | } from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import FilesDia from "@/views/qualityManagement/rawMaterialInspection/components/filesDia.vue"; |
| | | import dayjs from "dayjs"; |
| | |
| | | const formDia = ref(); |
| | | const filesDia = ref(); |
| | | const inspectionFormDia = ref(); |
| | | const quickCheckDia = ref(); |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore(); |
| | | const changeDaterange = value => { |
| | |
| | | return; |
| | | } |
| | | |
| | | const totalCount = selectedRows.value.length; |
| | | const unSubmittedCount = unSubmittedRows.length; |
| | | const submittedCount = totalCount - unSubmittedCount; |
| | | |
| | | let confirmMessage = `已鿩 ${totalCount} æ¡æ£éªå`; |
| | | if (submittedCount > 0) { |
| | | confirmMessage += `ï¼å
¶ä¸ ${submittedCount} æ¡å·²æäº¤ï¼å°èªå¨è·³è¿ï¼`; |
| | | } |
| | | confirmMessage += `\n\n确认åå°èªå¨ï¼\n· æ£éªç»æè®¾ä¸º"åæ ¼"\n· åæ ¼æ°éè®¾ä¸ºæ»æ°\n· ä¸åæ ¼æ°é设为 0\n· æäº¤å¹¶å
¥åº`; |
| | | |
| | | ElMessageBox.confirm(confirmMessage, "å¿«éæ£éª", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | dangerouslyUseHTMLString: false, |
| | | }) |
| | | .then(() => { |
| | | // è°ç¨æ¹éå¿«éæ£éªæ¥å£ |
| | | const ids = unSubmittedRows.map(item => item.id); |
| | | batchQuickInspect(ids).then(res => { |
| | | proxy.$modal.msgSuccess(res.msg || "å¿«éæ£éªå®æ"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | quickCheckDia.value?.openDialog(ids, unSubmittedRows); |
| | | }; |
| | | // æå¼éä»¶å¼¹æ¡ |
| | | const openFilesFormDia = (type, row) => { |
| | |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" v-if="deliveryForm.type === '货车'"> |
| | | <el-form-item label="åºåºæ¹å·ï¼" prop="outboundBatches"> |
| | | <el-input |
| | | v-model="deliveryForm.outboundBatches" |
| | | placeholder="请è¾å
¥åºåºæ¹å·" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" v-else> |
| | | <el-form-item label="å¿«éå
¬å¸ï¼" prop="expressCompany"> |
| | | <el-input |
| | |
| | | expressCompany: "", |
| | | expressNumber: "", |
| | | type: "货车", // 货车, å¿«é |
| | | outboundBatches: "", |
| | | }, |
| | | deliveryRules: { |
| | | shippingCarNumber: [ |
| | |
| | | type: "货车", |
| | | batchNo: [], |
| | | batchNoList, |
| | | outboundBatches: "", |
| | | }; |
| | | deliveryFileList.value = []; |
| | | deliveryFormVisible.value = true; |
| | |
| | | deliveryForm.value.type === "货车" |
| | | ? deliveryForm.value.shippingCarNumber |
| | | : "", |
| | | outboundBatches: |
| | | deliveryForm.value.type === "货车" |
| | | ? deliveryForm.value.outboundBatches |
| | | : "", |
| | | expressCompany: |
| | | deliveryForm.value.type === "å¿«é" |
| | | ? deliveryForm.value.expressCompany |
| | |
| | | </div> |
| | | </section> |
| | | |
| | | <!-- ç产模åå·²éè |
| | | <section class="section-card section-card--bottom"> |
| | | <article class="module-title module-title--produce"> |
| | | <div class="module-title__icon"> |
| | |
| | | </template> |
| | | </div> |
| | | </section> |
| | | --> |
| | | |
| | | <section class="section-card section-card--bottom"> |
| | | <article class="module-title module-title--store"> |