君歌
1.不需要bom、生产核算
2.新增销售台账后自动生成一个生产订单,然后对订单进行排产
3.生产排产要求可以选择计划时间,时间格式为年月日+时分秒;也要可以多选报工人
4.web和app生产报工中要细分报工开始和报工结束两个操作,根据操作的提交时间记录实际报工时长展示报工台账中
5.报工人选择的谁,只有在相关账号才能看到可报工的数据
6.不合格管理字段按照单据进行修改。
7.生产工时、质量问题汇总、客户档案、销售及回款都能从各模块中导出数据
| | |
| | | }); |
| | | } |
| | | |
| | | // å¼å§æ¥å·¥ |
| | | export function startWork(data) { |
| | | return request({ |
| | | url: "/productionProductMain/startWork", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | export function addProductMain(data) { |
| | | return request({ |
| | | url: "/productionProductMain/addProductMain", |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // ==================== ä¸åæ ¼ç®¡çï¼æ§æ¨¡åï¼ ==================== |
| | | |
| | | // æ¥è¯¢ä¸åæ ¼ç®¡çå表 |
| | | export function qualityUnqualifiedListPage(query) { |
| | | return request({ |
| | |
| | | params: query, |
| | | }); |
| | | } |
| | | // æ°å¢ä¸åæ ¼ç®¡çå表 |
| | | // æ°å¢ä¸åæ ¼ç®¡ç |
| | | export function qualityUnqualifiedAdd(query) { |
| | | return request({ |
| | | url: "/quality/qualityUnqualified/add", |
| | |
| | | data: query, |
| | | }); |
| | | } |
| | | // ä¿®æ¹ä¸åæ ¼ç®¡çå表 |
| | | // ä¿®æ¹ä¸åæ ¼ç®¡ç |
| | | export function qualityUnqualifiedUpdate(query) { |
| | | return request({ |
| | | url: "/quality/qualityUnqualified/update", |
| | |
| | | data: query, |
| | | }); |
| | | } |
| | | // å é¤ä¸åæ ¼ç®¡çå表 |
| | | // å é¤ä¸åæ ¼ç®¡ç |
| | | export function qualityUnqualifiedDel(query) { |
| | | return request({ |
| | | url: "/quality/qualityUnqualified/del", |
| | |
| | | data: query, |
| | | }); |
| | | } |
| | | // æ¥è¯¢ä¸åæ ¼ç®¡çä¿¡æ¯ |
| | | // æ¥è¯¢ä¸åæ ¼ç®¡ç详æ
|
| | | export function getQualityUnqualifiedInfo(query) { |
| | | return request({ |
| | | url: "/quality/qualityUnqualified/" + query, |
| | |
| | | data: query, |
| | | }); |
| | | } |
| | | |
| | | // ==================== ä¸åæ ¼åå¤çåï¼æ°æ¨¡åï¼ ==================== |
| | | |
| | | // å页æ¥è¯¢ä¸åæ ¼åå¤çå |
| | | export function qualityUnqualifiedOrderListPage(query) { |
| | | return request({ |
| | | url: "/qualityUnqualifiedOrder/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // æ¥çå¤çå详æ
|
| | | export function getQualityUnqualifiedOrderDetail(id) { |
| | | return request({ |
| | | url: `/qualityUnqualifiedOrder/${id}`, |
| | | method: "get", |
| | | }); |
| | | } |
| | | // æ°å¢å¤çå |
| | | export function saveQualityUnqualifiedOrder(data) { |
| | | return request({ |
| | | url: "/qualityUnqualifiedOrder/save", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | } |
| | | // ä¿®æ¹å¤çå |
| | | export function updateQualityUnqualifiedOrder(data) { |
| | | return request({ |
| | | url: "/qualityUnqualifiedOrder/update", |
| | | method: "put", |
| | | data, |
| | | }); |
| | | } |
| | | // å é¤å¤çå |
| | | export function deleteQualityUnqualifiedOrder(ids) { |
| | | return request({ |
| | | url: "/qualityUnqualifiedOrder/delete", |
| | | method: "delete", |
| | | data: ids, |
| | | }); |
| | | } |
| | | // å¤çï¼å¤ç½®ï¼å¤çå |
| | | export function dealQualityUnqualifiedOrder(data) { |
| | | return request({ |
| | | url: "/qualityUnqualifiedOrder/deal", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | } |
| | | // 导åºå¤çå |
| | | export function exportQualityUnqualifiedOrder(id) { |
| | | return request({ |
| | | url: `/qualityUnqualifiedOrder/export/${id}`, |
| | | method: "get", |
| | | responseType: "blob", |
| | | }); |
| | | } |
| | |
| | | </el-button> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | label="BOM" |
| | | prop="bomId" |
| | | :rules="[ |
| | | { |
| | | required: true, |
| | | message: 'è¯·éæ©BOM', |
| | | trigger: 'change', |
| | | } |
| | | ]" |
| | | > |
| | | <el-select |
| | | v-model="formState.bomId" |
| | | placeholder="è¯·éæ©BOM" |
| | | clearable |
| | | :disabled="!formState.productModelId || bomOptions.length === 0" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in bomOptions" |
| | | :key="item.id" |
| | | :label="item.bomNo || `BOM-${item.id}`" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="夿³¨" prop="description"> |
| | | <el-input v-model="formState.description" type="textarea" /> |
| | | </el-form-item> |
| | |
| | | <script setup> |
| | | import {ref, computed, getCurrentInstance, onMounted, nextTick, watch} from "vue"; |
| | | import {update} from "@/api/productionManagement/processRoute.js"; |
| | | import {getByModel} from "@/api/productionManagement/productBom.js"; |
| | | import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue"; |
| | | |
| | | const props = defineProps({ |
| | |
| | | productModelId: undefined, |
| | | productName: "", |
| | | productModelName: "", |
| | | bomId: undefined, |
| | | description: '', |
| | | }); |
| | | |
| | |
| | | }); |
| | | |
| | | const showProductSelectDialog = ref(false); |
| | | const bomOptions = ref([]); |
| | | |
| | | let { proxy } = getCurrentInstance() |
| | | |
| | |
| | | productId: props.record.productId, |
| | | productModelId: props.record.productModelId, |
| | | productName: props.record.productName || "", |
| | | // 注æï¼recordä¸çåæ®µæ¯modelï¼éè¦æ å°å°productModelName |
| | | productModelName: props.record.model || props.record.productModelName || "", |
| | | bomId: props.record.bomId, |
| | | description: props.record.description || '', |
| | | }; |
| | | // 妿æäº§ååå·IDï¼å è½½BOMå表 |
| | | if (props.record.productModelId) { |
| | | loadBomList(props.record.productModelId); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // å è½½BOMå表 |
| | | const loadBomList = async (productModelId) => { |
| | | if (!productModelId) { |
| | | bomOptions.value = []; |
| | | return; |
| | | } |
| | | try { |
| | | const res = await getByModel(productModelId); |
| | | // å¤çè¿åçBOMæ°æ®ï¼å¯è½æ¯æ°ç»ã对象æå
å«dataåæ®µ |
| | | let bomList = []; |
| | | if (Array.isArray(res)) { |
| | | bomList = res; |
| | | } else if (res && res.data) { |
| | | bomList = Array.isArray(res.data) ? res.data : [res.data]; |
| | | } else if (res && typeof res === 'object') { |
| | | bomList = [res]; |
| | | } |
| | | bomOptions.value = bomList; |
| | | } catch (error) { |
| | | console.error("å è½½BOMå表失败ï¼", error); |
| | | bomOptions.value = []; |
| | | } |
| | | }; |
| | | |
| | | // 产åéæ©å¤ç |
| | | const handleProductSelect = async (products) => { |
| | | const handleProductSelect = (products) => { |
| | | if (products && products.length > 0) { |
| | | const product = products[0]; |
| | | // å
æ¥è¯¢BOMå表ï¼å¿
éï¼ |
| | | try { |
| | | const res = await getByModel(product.id); |
| | | // å¤çè¿åçBOMæ°æ®ï¼å¯è½æ¯æ°ç»ã对象æå
å«dataåæ®µ |
| | | let bomList = []; |
| | | if (Array.isArray(res)) { |
| | | bomList = res; |
| | | } else if (res && res.data) { |
| | | bomList = Array.isArray(res.data) ? res.data : [res.data]; |
| | | } else if (res && typeof res === 'object') { |
| | | bomList = [res]; |
| | | } |
| | | |
| | | if (bomList.length > 0) { |
| | | formState.value.productModelId = product.id; |
| | | formState.value.productName = product.productName; |
| | | formState.value.productModelName = product.model; |
| | | // 妿å½åéæ©çBOMä¸å¨æ°å表ä¸ï¼åéç½®BOMéæ© |
| | | const currentBomExists = bomList.some(bom => bom.id === formState.value.bomId); |
| | | if (!currentBomExists) { |
| | | formState.value.bomId = undefined; |
| | | } |
| | | bomOptions.value = bomList; |
| | | showProductSelectDialog.value = false; |
| | | // 触å表åéªè¯æ´æ° |
| | | proxy.$refs["formRef"]?.validateField('productModelId'); |
| | | } else { |
| | | proxy.$modal.msgError("è¯¥äº§åæ²¡æBOMï¼è¯·å
å建BOM"); |
| | | } |
| | | } catch (error) { |
| | | // 妿æ¥å£è¿å404æå
¶ä»é误ï¼è¯´ææ²¡æBOM |
| | | proxy.$modal.msgError("è¯¥äº§åæ²¡æBOMï¼è¯·å
å建BOM"); |
| | | } |
| | | formState.value.productModelId = product.id; |
| | | formState.value.productName = product.productName; |
| | | formState.value.productModelName = product.model; |
| | | showProductSelectDialog.value = false; |
| | | proxy.$refs["formRef"]?.validateField('productModelId'); |
| | | } |
| | | }; |
| | | |
| | | const handleSubmit = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | // éªè¯æ¯å¦éæ©äºäº§ååBOM |
| | | if (!formState.value.productModelId) { |
| | | proxy.$modal.msgError("è¯·éæ©äº§å"); |
| | | return; |
| | | } |
| | | if (!formState.value.bomId) { |
| | | proxy.$modal.msgError("è¯·éæ©BOM"); |
| | | return; |
| | | } |
| | | update(formState.value).then(res => { |
| | |
| | | : 'éæ©äº§å' }} |
| | | </el-button> |
| | | </el-form-item> |
| | | <el-form-item label="BOM" |
| | | prop="bomId" |
| | | :rules="[ |
| | | { |
| | | required: true, |
| | | message: 'è¯·éæ©BOM', |
| | | trigger: 'change', |
| | | } |
| | | ]"> |
| | | <el-select v-model="formState.bomId" |
| | | placeholder="è¯·éæ©BOM" |
| | | clearable |
| | | :disabled="!formState.productModelId || bomOptions.length === 0" |
| | | style="width: 100%"> |
| | | <el-option v-for="item in bomOptions" |
| | | :key="item.id" |
| | | :label="item.bomNo || `BOM-${item.id}`" |
| | | :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" |
| | | prop="description"> |
| | | <el-input v-model="formState.description" |
| | |
| | | <script setup> |
| | | import { ref, computed, getCurrentInstance } from "vue"; |
| | | import { add } from "@/api/productionManagement/processRoute.js"; |
| | | import { getByModel } from "@/api/productionManagement/productBom.js"; |
| | | import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue"; |
| | | |
| | | const props = defineProps({ |
| | |
| | | productModelId: undefined, |
| | | productName: "", |
| | | productModelName: "", |
| | | bomId: undefined, |
| | | description: "", |
| | | }); |
| | | |
| | |
| | | }); |
| | | |
| | | const showProductSelectDialog = ref(false); |
| | | const bomOptions = ref([]); |
| | | |
| | | let { proxy } = getCurrentInstance(); |
| | | |
| | |
| | | productModelId: undefined, |
| | | productName: "", |
| | | productModelName: "", |
| | | bomId: undefined, |
| | | description: "", |
| | | }; |
| | | bomOptions.value = []; |
| | | isShow.value = false; |
| | | }; |
| | | |
| | | // 产åéæ©å¤ç |
| | | const handleProductSelect = async products => { |
| | | const handleProductSelect = products => { |
| | | if (products && products.length > 0) { |
| | | const product = products[0]; |
| | | // å
æ¥è¯¢BOMå表ï¼å¿
éï¼ |
| | | try { |
| | | const res = await getByModel(product.id); |
| | | // å¤çè¿åçBOMæ°æ®ï¼å¯è½æ¯æ°ç»ã对象æå
å«dataåæ®µ |
| | | let bomList = []; |
| | | if (Array.isArray(res)) { |
| | | bomList = res; |
| | | } else if (res && res.data) { |
| | | bomList = Array.isArray(res.data) ? res.data : [res.data]; |
| | | } else if (res && typeof res === "object") { |
| | | bomList = [res]; |
| | | } |
| | | |
| | | if (bomList.length > 0) { |
| | | formState.value.productModelId = product.id; |
| | | formState.value.productName = product.productName; |
| | | formState.value.productModelName = product.model; |
| | | formState.value.bomId = undefined; // éç½®BOMéæ© |
| | | bomOptions.value = bomList; |
| | | showProductSelectDialog.value = false; |
| | | // 触å表åéªè¯æ´æ° |
| | | proxy.$refs["formRef"]?.validateField("productModelId"); |
| | | } else { |
| | | proxy.$modal.msgError("è¯¥äº§åæ²¡æBOMï¼è¯·å
å建BOM"); |
| | | } |
| | | } catch (error) { |
| | | // 妿æ¥å£è¿å404æå
¶ä»é误ï¼è¯´ææ²¡æBOM |
| | | proxy.$modal.msgError("è¯¥äº§åæ²¡æBOMï¼è¯·å
å建BOM"); |
| | | } |
| | | formState.value.productModelId = product.id; |
| | | formState.value.productName = product.productName; |
| | | formState.value.productModelName = product.model; |
| | | showProductSelectDialog.value = false; |
| | | proxy.$refs["formRef"]?.validateField("productModelId"); |
| | | } |
| | | }; |
| | | |
| | | const handleSubmit = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | // éªè¯æ¯å¦éæ©äºäº§ååBOM |
| | | if (!formState.value.productModelId) { |
| | | proxy.$modal.msgError("è¯·éæ©äº§å"); |
| | | return; |
| | | } |
| | | if (!formState.value.bomId) { |
| | | proxy.$modal.msgError("è¯·éæ©BOM"); |
| | | return; |
| | | } |
| | | console.log(formState.value, "formState.value===="); |
| | |
| | | prop: "model", |
| | | }, |
| | | { |
| | | label: "BOMç¼å·", |
| | | prop: "bomNo", |
| | | }, |
| | | { |
| | | label: "æè¿°", |
| | | prop: "description", |
| | | }, |
| | |
| | | processRouteCode: row.processRouteCode || "", |
| | | productName: row.productName || "", |
| | | model: row.model || "", |
| | | bomNo: row.bomNo || "", |
| | | bomId: row.bomId || "", |
| | | description: row.description || "", |
| | | type: "route", |
| | | }, |
| | |
| | | <span class="info-value">{{ routeInfo.model || '-' }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="info-item"> |
| | | <div class="info-label-wrapper"> |
| | | <span class="info-label">BOMç¼å·</span> |
| | | </div> |
| | | <div class="info-value-wrapper"> |
| | | <span class="info-value">{{ routeInfo.bomNo || '-' }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="info-item" |
| | | v-if="routeInfo.quantity && routeInfo.quantity !== 0"> |
| | | <div class="info-label-wrapper"> |
| | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <!-- bom模å --> |
| | | <div class="section-header" |
| | | style="margin-top: 20px;"> |
| | | <div class="section-title">BOM ç»æ</div> |
| | | <div class="section-actions" |
| | | v-if="pageType === 'order' && editable"> |
| | | <el-button v-if="!bomDataValue.isEdit" |
| | | type="primary" |
| | | @click="bomDataValue.isEdit = true"> |
| | | ç¼è¾ |
| | | </el-button> |
| | | <el-button v-if="bomDataValue.isEdit" |
| | | @click="cancelEditBom"> |
| | | åæ¶ |
| | | </el-button> |
| | | <el-button v-if="bomDataValue.isEdit" |
| | | type="primary" |
| | | @click="handleSaveBom" |
| | | :loading="bomDataValue.loading"> |
| | | ä¿åBOM |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <el-table :data="bomTableData" |
| | | border |
| | | :preserve-expanded-content="false" |
| | | :default-expand-all="true" |
| | | style="width: 100%"> |
| | | <el-table-column type="expand"> |
| | | <template #default> |
| | | <el-form ref="bomFormRef" |
| | | :model="bomDataValue"> |
| | | <el-table :data="bomDataValue.dataList" |
| | | row-key="tempId" |
| | | default-expand-all |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | style="width: 100%"> |
| | | <el-table-column prop="productName" |
| | | label="产å" /> |
| | | <el-table-column prop="model" |
| | | label="è§æ ¼"> |
| | | <template #default="{ row }"> |
| | | <el-form-item v-if="pageType === 'order' && bomDataValue.isEdit" |
| | | :rules="[{ required: true, message: 'è¯·éæ©è§æ ¼', trigger: ['blur','change'] }]" |
| | | style="margin: 0"> |
| | | <el-select v-model="row.model" |
| | | placeholder="è¯·éæ©è§æ ¼" |
| | | clearable |
| | | :disabled="!bomDataValue.isEdit || bomDataValue.dataList.some(item => (item).tempId === row.tempId)" |
| | | style="width: 100%" |
| | | @visible-change="(v) => { if (v) openBomDialog(row.tempId) }"> |
| | | <el-option v-if="row.model" |
| | | :label="row.model" |
| | | :value="row.model" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="processName" |
| | | label="æ¶èå·¥åº"> |
| | | <template #default="{ row }"> |
| | | <el-form-item v-if="pageType === 'order' && bomDataValue.isEdit" |
| | | :rules="bomDataValue.dataList.some(item => (item).tempId === row.tempId) ? [] : [{ required: true, message: 'è¯·éæ©æ¶èå·¥åº', trigger: 'change' }]" |
| | | style="margin: 0"> |
| | | <el-select v-model="row.processId" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | clearable |
| | | style="width: 100%" |
| | | @change="value => handleBomProcessChange(row, value)" |
| | | :disabled="!bomDataValue.isEdit || bomDataValue.dataList.some(item => (item).tempId === row.tempId)"> |
| | | <el-option v-for="item in bomDataValue.processOptions" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unitQuantity" |
| | | label="åä½äº§åºæéæ°é"> |
| | | <template #default="{ row }"> |
| | | <el-form-item v-if="pageType === 'order' && bomDataValue.isEdit" |
| | | :rules="[{ required: true, message: '请è¾å
¥åä½äº§åºæéæ°é', trigger: ['blur','change'] }]" |
| | | style="margin: 0"> |
| | | <el-input-number v-model="row.unitQuantity" |
| | | :min="0" |
| | | :precision="2" |
| | | :step="1" |
| | | controls-position="right" |
| | | style="width: 100%" |
| | | @change="handleUnitQuantityChange" |
| | | :disabled="!bomDataValue.isEdit || bomDataValue.dataList.some(item => (item).tempId === row.tempId)" /> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="pageType === 'order'" |
| | | prop="demandedQuantity" |
| | | label="éæ±æ»é"> |
| | | <template #default="{ row }"> |
| | | <el-form-item v-if="pageType === 'order' && bomDataValue.isEdit" |
| | | :rules="[{ required: true, message: '请è¾å
¥éæ±æ»é', trigger: ['blur','change'] }]" |
| | | style="margin: 0"> |
| | | <el-input-number v-model="row.demandedQuantity" |
| | | :min="0" |
| | | :precision="2" |
| | | :step="1" |
| | | controls-position="right" |
| | | style="width: 100%" |
| | | :disabled="true" /> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unit" |
| | | label="åä½"> |
| | | <template #default="{ row }"> |
| | | <el-form-item v-if="pageType === 'order' && bomDataValue.isEdit" |
| | | :rules="[{ required: true, message: '请è¾å
¥åä½', trigger: ['blur','change'] }]" |
| | | style="margin: 0"> |
| | | <el-input v-model="row.unit" |
| | | placeholder="请è¾å
¥åä½" |
| | | clearable |
| | | :disabled="!bomDataValue.isEdit || bomDataValue.dataList.some(item => (item).tempId === row.tempId)" /> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" |
| | | fixed="right" |
| | | width="200" |
| | | v-if="pageType === 'order' && bomDataValue.isEdit"> |
| | | <template #default="{ row }"> |
| | | <el-button v-if="bomDataValue.isEdit && !bomDataValue.dataList.some(item => (item).tempId === row.tempId)" |
| | | type="danger" |
| | | text |
| | | @click="removeBomItem(row.tempId)">å é¤ |
| | | </el-button> |
| | | <el-button v-if="bomDataValue.isEdit" |
| | | type="primary" |
| | | text |
| | | @click="addBomItem(row.tempId)">æ·»å |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-form> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="BOMç¼å·" |
| | | prop="bomNo" /> |
| | | <el-table-column label="产ååç§°" |
| | | prop="productName" /> |
| | | <el-table-column label="è§æ ¼åå·" |
| | | prop="model" /> |
| | | </el-table> |
| | | <ProductSelectDialog v-if="bomDataValue.showProductDialog" |
| | | v-model="bomDataValue.showProductDialog" |
| | | :single="true" |
| | | @confirm="handleBomProduct" /> |
| | | <!-- ä¸ä¼ ç»ä»¶å¼¹çª --> |
| | | <el-dialog v-model="uploadDialogVisible" |
| | | title="ä¸ä¼ éä»¶" |
| | |
| | | sortRouteItem, |
| | | } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import { processList } from "@/api/productionManagement/productionProcess.js"; |
| | | import { listProcessBom } from "@/api/productionManagement/productionOrder.js"; |
| | | import { |
| | | queryList, |
| | | queryList2, |
| | | add2, |
| | | } from "@/api/productionManagement/productStructure.js"; |
| | | import AttachmentUpload from "@/components/AttachmentUpload/file/index.vue"; |
| | | import { |
| | | attachmentList, |
| | |
| | | const dialogVisible = ref(false); |
| | | const operationType = ref("add"); // add | edit |
| | | const formRef = ref(null); |
| | | const bomFormRef = ref(null); |
| | | const submitLoading = ref(false); |
| | | const cardsContainer = ref(null); |
| | | const tableRef = ref(null); |
| | |
| | | processRouteCode: "", |
| | | productName: "", |
| | | model: "", |
| | | bomNo: "", |
| | | description: "", |
| | | quantity: 0, |
| | | technologyRoutingId: "", |
| | |
| | | processList({ size: -1, current: -1 }) |
| | | .then(res => { |
| | | processOptions.value = res.data.records || []; |
| | | bomDataValue.value.processOptions = processOptions.value; |
| | | }) |
| | | .catch(err => { |
| | | console.error("è·åå·¥åºå¤±è´¥ï¼", err); |
| | |
| | | processRouteCode: route.query.processRouteCode || "", |
| | | productName: route.query.productName || "", |
| | | model: route.query.model || "", |
| | | bomNo: route.query.bomNo || "", |
| | | bomId: route.query.bomId || "", |
| | | description: route.query.description || "", |
| | | quantity: route.query.quantity || 0, |
| | | technologyRoutingId: route.query.technologyRoutingId || "", |
| | | status: !(route.query.status == 1 || route.query.status === "false"), |
| | | }; |
| | | bomTableData.value[0].productName = routeInfo.value.productName; |
| | | bomTableData.value[0].model = routeInfo.value.model; |
| | | bomTableData.value[0].bomNo = routeInfo.value.bomNo; |
| | | }; |
| | | |
| | | // æ°å¢ |
| | |
| | | } |
| | | }; |
| | | |
| | | // BOMç¸å
³ç¶æåæ¹æ³ |
| | | const bomTableData = ref([ |
| | | { |
| | | productName: "", |
| | | model: "", |
| | | bomNo: "", |
| | | }, |
| | | ]); |
| | | |
| | | const bomDataValue = ref({ |
| | | dataList: [], |
| | | processOptions: [], |
| | | showProductDialog: false, |
| | | currentRowName: null, |
| | | loading: false, |
| | | isEdit: false, |
| | | }); |
| | | |
| | | const syncProcessOperationFields = item => { |
| | | const processId = |
| | | item.processId ?? item.operationId ?? item.technologyOperationId ?? ""; |
| | | if (!processId) { |
| | | item.processId = ""; |
| | | return; |
| | | } |
| | | const option = bomDataValue.value.processOptions.find( |
| | | p => p.id === processId |
| | | ); |
| | | const processName = |
| | | option?.name || item.processName || item.operationName || ""; |
| | | |
| | | item.processId = processId; |
| | | if (pageType.value === "order") { |
| | | item.technologyOperationId = processId; |
| | | } else { |
| | | item.operationId = processId; |
| | | } |
| | | item.processName = processName; |
| | | item.operationName = processName; |
| | | }; |
| | | |
| | | const normalizeTreeData = items => { |
| | | items.forEach(item => { |
| | | item.tempId = item.tempId || item.id || `${Date.now()}_${Math.random()}`; |
| | | syncProcessOperationFields(item); |
| | | if (Array.isArray(item.children) && item.children.length > 0) { |
| | | normalizeTreeData(item.children); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const toQuantityNumber = value => { |
| | | const numberValue = Number(value); |
| | | if (!Number.isFinite(numberValue)) { |
| | | return 0; |
| | | } |
| | | return Number(numberValue.toFixed(2)); |
| | | }; |
| | | |
| | | const syncDemandedQuantityTree = (items, parentDemandedQuantity = null) => { |
| | | items.forEach(item => { |
| | | if (parentDemandedQuantity !== null) { |
| | | item.demandedQuantity = toQuantityNumber( |
| | | parentDemandedQuantity * toQuantityNumber(item.unitQuantity) |
| | | ); |
| | | } |
| | | |
| | | if (Array.isArray(item.children) && item.children.length > 0) { |
| | | syncDemandedQuantityTree( |
| | | item.children, |
| | | toQuantityNumber(item.demandedQuantity) |
| | | ); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const recalculateDemandedQuantities = () => { |
| | | if (pageType.value !== "order") { |
| | | return; |
| | | } |
| | | |
| | | const rootDemandedQuantity = routeInfo.value.quantity; |
| | | if ( |
| | | rootDemandedQuantity === undefined || |
| | | rootDemandedQuantity === null || |
| | | rootDemandedQuantity === "" |
| | | ) { |
| | | syncDemandedQuantityTree(bomDataValue.value.dataList); |
| | | return; |
| | | } |
| | | |
| | | syncDemandedQuantityTree( |
| | | bomDataValue.value.dataList, |
| | | toQuantityNumber(rootDemandedQuantity) |
| | | ); |
| | | }; |
| | | |
| | | const processChange = value => { |
| | | processOptions.value.forEach(item => { |
| | | if (item.id == value) { |
| | |
| | | }); |
| | | }; |
| | | |
| | | const findSiblings = (items, tempId) => { |
| | | if (!items || items.length === 0) return null; |
| | | // æ£æ¥å½åå±çº§ |
| | | if (items.some(item => item.tempId === tempId)) { |
| | | return items; |
| | | } |
| | | // é彿¥æ¾å级 |
| | | for (const item of items) { |
| | | if (item.children && item.children.length > 0) { |
| | | const result = findSiblings(item.children, tempId); |
| | | if (result) return result; |
| | | } |
| | | } |
| | | return null; |
| | | }; |
| | | |
| | | const handleBomProcessChange = (row, value) => { |
| | | row.processId = value || ""; |
| | | syncProcessOperationFields(row); |
| | | |
| | | // æ£æ¥åä¸å±çº§æ¯å¦å·²ç»æå
¶ä»ä¸åçå·¥åºè¢«éä¸ |
| | | const siblings = findSiblings(bomDataValue.value.dataList, row.tempId); |
| | | if (siblings && value) { |
| | | const hasDifferentProcess = siblings.some(sibling => { |
| | | return ( |
| | | sibling.tempId !== row.tempId && |
| | | sibling.processId && |
| | | sibling.processId !== value |
| | | ); |
| | | }); |
| | | if (hasDifferentProcess) { |
| | | ElMessage.warning("åä¸å±çº§å·²åå¨ä¸åçå·¥åºï¼è¯·å
ç»ä¸å·¥åºååè¿è¡ä¿®æ¹"); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | const openBomDialog = tempId => { |
| | | bomDataValue.value.currentRowName = tempId; |
| | | bomDataValue.value.showProductDialog = true; |
| | | }; |
| | | |
| | | const fetchBomData = async () => { |
| | | try { |
| | | const isOrderPage = pageType.value === "order"; |
| | | const { data } = await (isOrderPage ? queryList2 : queryList)( |
| | | routeInfo.value.bomId |
| | | ); |
| | | bomDataValue.value.dataList = data || []; |
| | | normalizeTreeData(bomDataValue.value.dataList); |
| | | recalculateDemandedQuantities(); |
| | | } catch (err) { |
| | | console.error("è·åBOMæ°æ®å¤±è´¥ï¼", err); |
| | | } |
| | | }; |
| | | |
| | | const childItem = (item, tempId, productData) => { |
| | | if (item.tempId === tempId) { |
| | | item.productName = productData.productName; |
| | | item.model = productData.model; |
| | | item.productModelId = productData.id; |
| | | item.unit = productData.unit || ""; |
| | | return true; |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | for (let child of item.children) { |
| | | if (childItem(child, tempId, productData)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | }; |
| | | |
| | | const handleBomProduct = row => { |
| | | if (!Array.isArray(row) || row.length === 0) { |
| | | ElMessage.warning("è¯·éæ©ä¸ä¸ªäº§å"); |
| | | return; |
| | | } |
| | | const productData = row[row.length - 1]; |
| | | |
| | | const isTopLevel = bomDataValue.value.dataList.some( |
| | | item => item.tempId === bomDataValue.value.currentRowName |
| | | ); |
| | | if (isTopLevel) { |
| | | if ( |
| | | productData.productName === bomTableData.value[0].productName && |
| | | productData.model === bomTableData.value[0].model |
| | | ) { |
| | | const hasOther = bomDataValue.value.dataList.some( |
| | | item => |
| | | item.tempId !== bomDataValue.value.currentRowName && |
| | | item.productName === bomTableData.value[0].productName && |
| | | item.model === bomTableData.value[0].model |
| | | ); |
| | | if (hasOther) { |
| | | ElMessage.warning("æå¤å±åå½å产å䏿 ·çä¸çº§åªè½æä¸ä¸ª"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | bomDataValue.value.dataList.forEach(item => { |
| | | if (item.tempId === bomDataValue.value.currentRowName) { |
| | | item.productName = productData.productName; |
| | | item.model = productData.model; |
| | | item.productModelId = productData.id; |
| | | item.unit = productData.unit || ""; |
| | | return; |
| | | } |
| | | childItem(item, bomDataValue.value.currentRowName, productData); |
| | | }); |
| | | bomDataValue.value.showProductDialog = false; |
| | | }; |
| | | |
| | | const removeBomItem = tempId => { |
| | | const topIndex = bomDataValue.value.dataList.findIndex( |
| | | item => item.tempId === tempId |
| | | ); |
| | | if (topIndex !== -1) { |
| | | bomDataValue.value.dataList.splice(topIndex, 1); |
| | | return; |
| | | } |
| | | |
| | | const delchildItem = (items, tempId) => { |
| | | for (let i = 0; i < items.length; i++) { |
| | | const item = items[i]; |
| | | if (item.tempId === tempId) { |
| | | items.splice(i, 1); |
| | | return true; |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | if (delchildItem(item.children, tempId)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | }; |
| | | |
| | | bomDataValue.value.dataList.forEach(item => { |
| | | if (item.children && item.children.length > 0) { |
| | | delchildItem(item.children, tempId); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const handleUnitQuantityChange = () => { |
| | | recalculateDemandedQuantities(); |
| | | }; |
| | | |
| | | const addchildItem = (item, tempId) => { |
| | | if (item.tempId === tempId) { |
| | | if (!item.children) { |
| | | item.children = []; |
| | | } |
| | | item.children.push({ |
| | | parentId: item.id || "", |
| | | parentTempId: item.tempId || "", |
| | | productName: "", |
| | | productId: "", |
| | | model: undefined, |
| | | productModelId: undefined, |
| | | processId: "", |
| | | processName: "", |
| | | [pageType.value === "order" ? "technologyOperationId" : "operationId"]: |
| | | "", |
| | | operationName: "", |
| | | unitQuantity: 1, |
| | | demandedQuantity: 0, |
| | | children: [], |
| | | unit: "", |
| | | tempId: new Date().getTime(), |
| | | }); |
| | | recalculateDemandedQuantities(); |
| | | return true; |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | for (let child of item.children) { |
| | | if (addchildItem(child, tempId)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | }; |
| | | |
| | | const addBomItem = tempId => { |
| | | bomDataValue.value.dataList.forEach(item => { |
| | | if (item.tempId === tempId) { |
| | | if (!item.children) { |
| | | item.children = []; |
| | | } |
| | | item.children.push({ |
| | | parentId: item.id || "", |
| | | parentTempId: item.tempId || "", |
| | | productName: "", |
| | | productId: "", |
| | | model: undefined, |
| | | productModelId: undefined, |
| | | processId: "", |
| | | processName: "", |
| | | [pageType.value === "order" ? "technologyOperationId" : "operationId"]: |
| | | "", |
| | | operationName: "", |
| | | unitQuantity: 1, |
| | | demandedQuantity: 0, |
| | | unit: "", |
| | | children: [], |
| | | tempId: new Date().getTime(), |
| | | }); |
| | | recalculateDemandedQuantities(); |
| | | return; |
| | | } |
| | | addchildItem(item, tempId); |
| | | }); |
| | | }; |
| | | |
| | | const validateAllBom = () => { |
| | | let isValid = true; |
| | | const isOrderPage = pageType.value === "order"; |
| | | |
| | | const validateItem = (item, isTopLevel = false) => { |
| | | if (!item.model) { |
| | | ElMessage.error("è¯·éæ©è§æ ¼"); |
| | | isValid = false; |
| | | return; |
| | | } |
| | | if (!isTopLevel && !item.processId) { |
| | | ElMessage.error("è¯·éæ©æ¶èå·¥åº"); |
| | | isValid = false; |
| | | return; |
| | | } |
| | | if (!item.unitQuantity) { |
| | | ElMessage.error("请è¾å
¥åä½äº§åºæéæ°é"); |
| | | isValid = false; |
| | | return; |
| | | } |
| | | if (isOrderPage && !item.demandedQuantity) { |
| | | ElMessage.error("请è¾å
¥éæ±æ»é"); |
| | | isValid = false; |
| | | return; |
| | | } |
| | | |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(child => { |
| | | validateItem(child, false); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // æ ¡éªåä¸å±çº§çå·¥åºæ¯å¦ä¸è´ |
| | | const validateProcessConsistency = items => { |
| | | if (!items || items.length === 0) return; |
| | | |
| | | // æ£æ¥å½åå±çº§ |
| | | const processes = items |
| | | .filter(item => item.processId) |
| | | .map(item => item.processId); |
| | | if (processes.length > 1) { |
| | | const uniqueProcesses = [...new Set(processes)]; |
| | | if (uniqueProcesses.length > 1) { |
| | | ElMessage.error("åä¸å±çº§çå·¥åºå¿
é¡»ä¸è´"); |
| | | isValid = false; |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // é彿£æ¥å级 |
| | | items.forEach(item => { |
| | | if (item.children && item.children.length > 0) { |
| | | validateProcessConsistency(item.children); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | bomDataValue.value.dataList.forEach(item => { |
| | | validateItem(item, true); |
| | | }); |
| | | |
| | | validateProcessConsistency(bomDataValue.value.dataList); |
| | | |
| | | return isValid; |
| | | }; |
| | | |
| | | const buildSubmitTree = items => { |
| | | return items.map(item => { |
| | | const current = { ...item }; |
| | | syncProcessOperationFields(current); |
| | | current.children = Array.isArray(current.children) |
| | | ? buildSubmitTree(current.children) |
| | | : []; |
| | | return current; |
| | | }); |
| | | }; |
| | | |
| | | const cancelEditBom = () => { |
| | | bomDataValue.value.isEdit = false; |
| | | fetchBomData(); |
| | | }; |
| | | |
| | | const handleSaveBom = () => { |
| | | bomDataValue.value.loading = true; |
| | | console.log(bomDataValue.value.dataList, "bomDataValue.value.dataList"); |
| | | |
| | | normalizeTreeData(bomDataValue.value.dataList); |
| | | recalculateDemandedQuantities(); |
| | | |
| | | const valid = validateAllBom(); |
| | | if (valid) { |
| | | add2({ |
| | | // bomId: Number(routeInfo.value.bomId), |
| | | productionOrderBomId: Number(routeInfo.value.bomId) || null, |
| | | children: buildSubmitTree(bomDataValue.value.dataList || []), |
| | | }) |
| | | .then(() => { |
| | | ElMessage.success("BOMä¿åæå"); |
| | | bomDataValue.value.isEdit = false; |
| | | refreshCurrentPage(); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("BOMä¿å失败"); |
| | | }) |
| | | .finally(() => { |
| | | bomDataValue.value.loading = false; |
| | | }); |
| | | } else { |
| | | bomDataValue.value.loading = false; |
| | | } |
| | | }; |
| | | |
| | | const refreshCurrentPage = () => { |
| | | getRouteInfo(); |
| | | getList(); |
| | | getProcessList(); |
| | | fetchBomData(); |
| | | if (pageType.value === "order") { |
| | | getAttachmentList(); |
| | | } |
| | |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <MaterialLedgerDialog v-model="materialDialogVisible" |
| | | <!-- 颿/è¡¥æ/é¢æè¯¦æ
åè½å·²éè --> |
| | | <!-- <MaterialLedgerDialog v-model="materialDialogVisible" |
| | | :order-row="currentMaterialOrder" |
| | | @saved="getList" /> |
| | | <MaterialDetailDialog v-model="materialDetailDialogVisible" |
| | |
| | | @confirmed="getList" /> |
| | | <MaterialSupplementDialog v-model="materialSupplementDialogVisible" |
| | | :order-row="currentMaterialSupplementOrder" |
| | | @saved="getList" /> |
| | | @saved="getList" /> --> |
| | | <new-product-order v-if="isShowNewModal" |
| | | v-model:visible="isShowNewModal" |
| | | @completed="handleQuery" /> |
| | | <!-- æå°é¢æåç»ä»¶ --> |
| | | <div class="print-requisition-wrapper"> |
| | | <!-- æå°é¢æååè½å·²éè --> |
| | | <!-- <div class="print-requisition-wrapper"> |
| | | <PrintMaterialRequisition ref="printRef" |
| | | :order-row="printOrderRow" |
| | | :material-list="printMaterialList" /> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | } from "@/api/productionManagement/productionOrder.js"; |
| | | import { productWorkOrderPage } from "@/api/productionManagement/workOrder.js"; |
| | | import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue"; |
| | | import MaterialDetailDialog from "@/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue"; |
| | | import MaterialSupplementDialog from "@/views/productionManagement/productionOrder/components/MaterialSupplementDialog.vue"; |
| | | import PrintMaterialRequisition from "@/views/productionManagement/productionOrder/components/PrintMaterialRequisition.vue"; |
| | | // 颿/è¡¥æ/é¢æè¯¦æ
/æå°é¢æååè½å·²éè |
| | | // import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue"; |
| | | // import MaterialDetailDialog from "@/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue"; |
| | | // import MaterialSupplementDialog from "@/views/productionManagement/productionOrder/components/MaterialSupplementDialog.vue"; |
| | | // import PrintMaterialRequisition from "@/views/productionManagement/productionOrder/components/PrintMaterialRequisition.vue"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import { listPage } from "@/api/productionManagement/processRoute.js"; |
| | | import { |
| | | listMaterialPickingDetail, |
| | | listMaterialPickingBom, |
| | | } from "@/api/productionManagement/productionOrder.js"; |
| | | // 颿åè½å·²éè |
| | | // import { |
| | | // listMaterialPickingDetail, |
| | | // listMaterialPickingBom, |
| | | // } from "@/api/productionManagement/productionOrder.js"; |
| | | const NewProductOrder = defineAsyncComponent(() => |
| | | import("@/views/productionManagement/productionOrder/New.vue") |
| | | ); |
| | |
| | | showSourceData(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "颿", |
| | | type: "text", |
| | | color: "#5EC7AB", |
| | | showHide: row => !row.endOrder && !row.returned, |
| | | clickFun: row => { |
| | | openMaterialDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "è¡¥æ", |
| | | type: "text", |
| | | color: "#5EC7AB", |
| | | showHide: row => !row.endOrder && !row.returned, |
| | | clickFun: row => { |
| | | openMaterialSupplementDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "é¢æè¯¦æ
", |
| | | type: "text", |
| | | color: "#5EC7AB", |
| | | clickFun: row => { |
| | | openMaterialDetailDialog(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "æå°é¢æå", |
| | | type: "text", |
| | | color: "#5EC7AB", |
| | | showHide: row => !row.endOrder, |
| | | clickFun: row => { |
| | | handlePrint(row); |
| | | }, |
| | | }, |
| | | // 颿/è¡¥æ/é¢æè¯¦æ
/æå°é¢æååè½å·²éè |
| | | // { |
| | | // name: "颿", |
| | | // type: "text", |
| | | // color: "#5EC7AB", |
| | | // showHide: row => !row.endOrder && !row.returned, |
| | | // clickFun: row => { |
| | | // openMaterialDialog(row); |
| | | // }, |
| | | // }, |
| | | // { |
| | | // name: "è¡¥æ", |
| | | // type: "text", |
| | | // color: "#5EC7AB", |
| | | // showHide: row => !row.endOrder && !row.returned, |
| | | // clickFun: row => { |
| | | // openMaterialSupplementDialog(row); |
| | | // }, |
| | | // }, |
| | | // { |
| | | // name: "é¢æè¯¦æ
", |
| | | // type: "text", |
| | | // color: "#5EC7AB", |
| | | // clickFun: row => { |
| | | // openMaterialDetailDialog(row); |
| | | // }, |
| | | // }, |
| | | // { |
| | | // name: "æå°é¢æå", |
| | | // type: "text", |
| | | // color: "#5EC7AB", |
| | | // showHide: row => !row.endOrder, |
| | | // clickFun: row => { |
| | | // handlePrint(row); |
| | | // }, |
| | | // }, |
| | | { |
| | | name: "ç产追溯", |
| | | type: "text", |
| | |
| | | orderId: null, |
| | | routeId: null, |
| | | }); |
| | | const materialDialogVisible = ref(false); |
| | | const currentMaterialOrder = ref(null); |
| | | const materialDetailDialogVisible = ref(false); |
| | | const currentMaterialDetailOrder = ref(null); |
| | | const materialSupplementDialogVisible = ref(false); |
| | | const currentMaterialSupplementOrder = ref(null); |
| | | // 颿/è¡¥æ/é¢æè¯¦æ
åè½å·²éè |
| | | // const materialDialogVisible = ref(false); |
| | | // const currentMaterialOrder = ref(null); |
| | | // const materialDetailDialogVisible = ref(false); |
| | | // const currentMaterialDetailOrder = ref(null); |
| | | // const materialSupplementDialogVisible = ref(false); |
| | | // const currentMaterialSupplementOrder = ref(null); |
| | | |
| | | // æå°ç¸å
³ |
| | | const printOrderRow = ref(null); |
| | | const printMaterialList = ref([]); |
| | | const handlePrint = async row => { |
| | | printOrderRow.value = row; |
| | | proxy.$modal.loading("æ£å¨è·åé¢ææ°æ®..."); |
| | | try { |
| | | printMaterialList.value = []; |
| | | const detailRes = await listMaterialPickingDetail(row.id); |
| | | const detailList = Array.isArray(detailRes?.data) |
| | | ? detailRes.data |
| | | : detailRes?.data?.records || []; |
| | | |
| | | if (detailList.length > 0) { |
| | | printMaterialList.value = detailList; |
| | | } |
| | | |
| | | if (printMaterialList.value.length === 0) { |
| | | proxy.$modal.msgWarning("ææ é¢ææ°æ®"); |
| | | return; |
| | | } |
| | | |
| | | // çå¾
DOM æ´æ°åæ§è¡æå° |
| | | proxy.$nextTick(() => { |
| | | setTimeout(() => { |
| | | window.print(); |
| | | }, 800); |
| | | }); |
| | | } catch (e) { |
| | | console.error("è·åé¢ææ°æ®å¤±è´¥ï¼", e); |
| | | proxy.$modal.msgError("è·åé¢ææ°æ®å¤±è´¥"); |
| | | } finally { |
| | | proxy.$modal.closeLoading(); |
| | | } |
| | | }; |
| | | // æå°é¢æååè½å·²éè |
| | | // const printOrderRow = ref(null); |
| | | // const printMaterialList = ref([]); |
| | | // const handlePrint = async row => { |
| | | // printOrderRow.value = row; |
| | | // proxy.$modal.loading("æ£å¨è·åé¢ææ°æ®..."); |
| | | // try { |
| | | // printMaterialList.value = []; |
| | | // const detailRes = await listMaterialPickingDetail(row.id); |
| | | // const detailList = Array.isArray(detailRes?.data) |
| | | // ? detailRes.data |
| | | // : detailRes?.data?.records || []; |
| | | // |
| | | // if (detailList.length > 0) { |
| | | // printMaterialList.value = detailList; |
| | | // } |
| | | // |
| | | // if (printMaterialList.value.length === 0) { |
| | | // proxy.$modal.msgWarning("ææ é¢ææ°æ®"); |
| | | // return; |
| | | // } |
| | | // |
| | | // proxy.$nextTick(() => { |
| | | // setTimeout(() => { |
| | | // window.print(); |
| | | // }, 800); |
| | | // }); |
| | | // } catch (e) { |
| | | // console.error("è·åé¢ææ°æ®å¤±è´¥ï¼", e); |
| | | // proxy.$modal.msgError("è·åé¢ææ°æ®å¤±è´¥"); |
| | | // } finally { |
| | | // proxy.$modal.closeLoading(); |
| | | // } |
| | | // }; |
| | | |
| | | const openBindRouteDialog = async (row, type) => { |
| | | bindForm.orderId = row.id; |
| | |
| | | } |
| | | }; |
| | | |
| | | const openMaterialDialog = row => { |
| | | currentMaterialOrder.value = row; |
| | | materialDialogVisible.value = true; |
| | | }; |
| | | // 颿/è¡¥æ/é¢æè¯¦æ
åè½å·²éè |
| | | // const openMaterialDialog = row => { |
| | | // currentMaterialOrder.value = row; |
| | | // materialDialogVisible.value = true; |
| | | // }; |
| | | |
| | | const openMaterialDetailDialog = async row => { |
| | | currentMaterialDetailOrder.value = row; |
| | | materialDetailDialogVisible.value = true; |
| | | }; |
| | | // const openMaterialDetailDialog = async row => { |
| | | // currentMaterialDetailOrder.value = row; |
| | | // materialDetailDialogVisible.value = true; |
| | | // }; |
| | | |
| | | const openMaterialSupplementDialog = row => { |
| | | currentMaterialSupplementOrder.value = row; |
| | | materialSupplementDialogVisible.value = true; |
| | | }; |
| | | // const openMaterialSupplementDialog = row => { |
| | | // currentMaterialSupplementOrder.value = row; |
| | | // materialSupplementDialogVisible.value = true; |
| | | // }; |
| | | |
| | | const handleReset = () => { |
| | | searchForm.value = { |
| | |
| | | fixed: "right", |
| | | width: 250, |
| | | operation: [ |
| | | { |
| | | name: "æ¥çæå
¥", |
| | | type: "text", |
| | | clickFun: row => { |
| | | showInput(row); |
| | | }, |
| | | }, |
| | | // { |
| | | // name: "æ¥çæå
¥", |
| | | // type: "text", |
| | | // clickFun: row => { |
| | | // showInput(row); |
| | | // }, |
| | | // }, |
| | | { |
| | | name: "åæ°è¯¦æ
", |
| | | type: "text", |
| | |
| | | align="center" |
| | | width="200"> |
| | | <template #default="{ row }"> |
| | | <el-button type="primary" |
| | | link |
| | | @click="showInput(row.id)">æ¥çæå
¥</el-button> |
| | | <!-- <el-button type="primary"--> |
| | | <!-- link--> |
| | | <!-- @click="showInput(row.id)">æ¥çæå
¥</el-button>--> |
| | | <el-button type="primary" |
| | | link |
| | | @click="showParamDetail(row.productionOperationParamList)">åæ°è¯¦æ
</el-button> |
| | |
| | | label-width="120px"> |
| | | <el-form-item label="计åå¼å§æ¶é´"> |
| | | <el-date-picker v-model="editrow.planStartTime" |
| | | type="date" |
| | | type="datetime" |
| | | placeholder="è¯·éæ©" |
| | | value-format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | style="width: 300px" /> |
| | | </el-form-item> |
| | | <el-form-item label="计åç»ææ¶é´"> |
| | | <el-date-picker v-model="editrow.planEndTime" |
| | | type="date" |
| | | type="datetime" |
| | | placeholder="è¯·éæ©" |
| | | value-format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | style="width: 300px" /> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | <el-button type="primary" |
| | | @click="handleQuery">æç´¢</el-button> |
| | | </div> |
| | | <div class="search-item"> |
| | | <el-switch v-model="filterMine" |
| | | active-text="ä»
çæç" |
| | | @change="handleQuery" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | |
| | | @click="printTransferCard">æå°æµè½¬å¡</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- æ¥å·¥å¼¹çª --> |
| | | <!-- æ¥å·¥å¼¹çªï¼ç»ææ¥å·¥ç¨ï¼ --> |
| | | <el-dialog v-model="reportDialogVisible" |
| | | title="æ¥å·¥" |
| | | title="ç»ææ¥å·¥" |
| | | width="500px"> |
| | | <el-form ref="reportFormRef" |
| | | :model="reportForm" |
| | |
| | | :value="user.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- å·¥æ¶ --> |
| | | <el-form-item label="å·¥æ¶" |
| | | v-if="currentReportRowData?.type == 0" |
| | | prop="workHour"> |
| | |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" |
| | | @click="handleReport">ç¡®å®</el-button> |
| | | @click="handleFinishWork">ç¡®å®</el-button> |
| | | <el-button @click="reportDialogVisible = false">åæ¶</el-button> |
| | | </span> |
| | | </template> |
| | |
| | | import { |
| | | productWorkOrderPage, |
| | | addProductMain, |
| | | startWork, |
| | | downProductWorkOrder, |
| | | } from "@/api/productionManagement/workOrder.js"; |
| | | import { listMaterialPickingDetail } from "@/api/productionManagement/productionOrder.js"; |
| | | import { findProcessParamListOrder } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import { getUserProfile, userListNoPageByTenantId } from "@/api/system/user.js"; |
| | | import { getDicts } from "@/api/system/dict/data"; |
| | |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore(); |
| | | |
| | | const isCompleted = row => { |
| | | const status = Number(row?.completionStatus); |
| | | return Number.isFinite(status) && status >= 100; |
| | | }; |
| | | |
| | | const canOperate = row => !row.endOrder && !isCompleted(row); |
| | | |
| | | const tableColumn = ref([ |
| | | { label: "å·¥åç±»å", prop: "workOrderType", width: "80" }, |
| | | { label: "å·¥åç¼å·", prop: "workOrderNo", width: "140" }, |
| | | { label: "ç产订åå·", prop: "npsNo", width: "140" }, |
| | | { label: "产ååç§°", prop: "productName", width: "140" }, |
| | | { label: "è§æ ¼", prop: "model" }, |
| | | { label: "åä½", prop: "unit" }, |
| | | { label: "å·¥åºåç§°", prop: "operationName", width: "100" }, |
| | | { label: "éæ±æ°é", prop: "planQuantity", width: "140" }, |
| | | { label: "宿æ°é", prop: "completeQuantity", width: "140" }, |
| | | { label: "宿è¿åº¦", prop: "completionStatus", dataType: "slot", slot: "completionStatus", width: "140" }, |
| | | { label: "计åå¼å§æ¶é´", prop: "planStartTime", width: "140" }, |
| | | { label: "计åç»ææ¶é´", prop: "planEndTime", width: "140" }, |
| | | { label: "å®é
å¼å§æ¶é´", prop: "actualStartTime", width: "140" }, |
| | | { label: "å®é
ç»ææ¶é´", prop: "actualEndTime", width: "140" }, |
| | | { |
| | | label: "å·¥åç±»å", |
| | | prop: "workOrderType", |
| | | width: "80", |
| | | }, |
| | | { |
| | | label: "å·¥åç¼å·", |
| | | prop: "workOrderNo", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "ç产订åå·", |
| | | prop: "npsNo", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "产ååç§°", |
| | | prop: "productName", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "è§æ ¼", |
| | | prop: "model", |
| | | }, |
| | | { |
| | | label: "åä½", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "å·¥åºåç§°", |
| | | prop: "operationName", |
| | | width: "100", |
| | | }, |
| | | { |
| | | label: "éæ±æ°é", |
| | | prop: "planQuantity", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "宿æ°é", |
| | | prop: "completeQuantity", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "宿è¿åº¦", |
| | | prop: "completionStatus", |
| | | dataType: "slot", |
| | | slot: "completionStatus", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "计åå¼å§æ¶é´", |
| | | prop: "planStartTime", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "计åç»ææ¶é´", |
| | | prop: "planEndTime", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "å®é
å¼å§æ¶é´", |
| | | prop: "actualStartTime", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "å®é
ç»ææ¶é´", |
| | | prop: "actualEndTime", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "æä½", |
| | | width: "260", |
| | | align: "center", |
| | | dataType: "action", |
| | | fixed: "right", |
| | | label: "æä½", width: "260", align: "center", dataType: "action", fixed: "right", |
| | | operation: [ |
| | | { |
| | | name: "æµè½¬å¡", |
| | | clickFun: row => { |
| | | downloadAndPrintWorkOrder(row); |
| | | }, |
| | | clickFun: row => { downloadAndPrintWorkOrder(row); }, |
| | | }, |
| | | { |
| | | name: "éä»¶", |
| | | clickFun: row => { |
| | | openWorkOrderFiles(row); |
| | | }, |
| | | clickFun: row => { openWorkOrderFiles(row); }, |
| | | }, |
| | | // { |
| | | // name: "ç©æ", |
| | | // clickFun: row => { |
| | | // openMaterialDialog(row); |
| | | // }, |
| | | // }, |
| | | { |
| | | name: "æ¥å·¥", |
| | | clickFun: row => { |
| | | showReportDialog(row); |
| | | }, |
| | | showHide: row => !row.endOrder, |
| | | name: "å¼å§æ¥å·¥", |
| | | showHide: row => canOperate(row) && !row.actualStartTime, |
| | | disabled: row => { |
| | | if (row.planQuantity <= 0) return true; |
| | | if (!row.userIds) return false; |
| | | try { |
| | | const userIds = |
| | | typeof row.userIds === "string" |
| | | ? JSON.parse(row.userIds) |
| | | : row.userIds; |
| | | const userIds = typeof row.userIds === "string" ? JSON.parse(row.userIds) : row.userIds; |
| | | if (Array.isArray(userIds)) { |
| | | return !userIds.some(id => String(id) === String(userStore.id)); |
| | | } |
| | | return true; |
| | | } catch (e) { |
| | | return true; |
| | | } |
| | | } catch (e) { return true; } |
| | | }, |
| | | clickFun: row => { handleStartWork(row); }, |
| | | }, |
| | | { |
| | | name: "ç»ææ¥å·¥", |
| | | showHide: row => canOperate(row) && !!row.actualStartTime, |
| | | clickFun: row => { showReportDialog(row); }, |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | const tableData = ref([]); |
| | | const tableLoading = ref(false); |
| | | const transferCardVisible = ref(false); |
| | | const transferCardData = ref([]); |
| | | const transferCardQrUrl = ref(""); |
| | | const transferCardRowData = ref(null); |
| | | const reportDialogVisible = ref(false); |
| | | const fileDialogVisible = ref(false); |
| | |
| | | const dictOptions = ref({}); |
| | | const paramLoading = ref(false); |
| | | |
| | | // çäº§åæ ¼æ°ééªè¯è§å |
| | | const validateQuantity = (rule, value, callback) => { |
| | | if (value === null || value === undefined || value === "") { |
| | | callback(new Error("请è¾å
¥çäº§åæ ¼æ°é")); |
| | | return; |
| | | } |
| | | const num = Number(value); |
| | | // æ´æ°ä¸å¤§äºçäº1 |
| | | if (isNaN(num) || !Number.isInteger(num) || num < 0) { |
| | | callback(new Error("çäº§åæ ¼æ°éå¿
须大äºçäº0")); |
| | | return; |
| | | } |
| | | callback(); |
| | | }; |
| | | |
| | | // æ¥åºæ°ééªè¯è§å |
| | | const validateScrapQty = (rule, value, callback) => { |
| | | if (value === null || value === undefined || value === "") { |
| | | callback(); |
| | | return; |
| | | } |
| | | const num = Number(value); |
| | | // æ´æ°ä¸å¤§äºçäº0 |
| | | if (isNaN(num) || !Number.isInteger(num) || num < 0) { |
| | | callback(new Error("æ¥åºæ°éå¿
须大äºçäº0")); |
| | | return; |
| | | } |
| | | callback(); |
| | | }; |
| | | |
| | | // éªè¯è§å |
| | | const reportFormRules = { |
| | | quantity: [{ required: true, validator: validateQuantity, trigger: "blur" }], |
| | | scrapQty: [{ validator: validateScrapQty, trigger: "blur" }], |
| | | }; |
| | | |
| | | // å¤ççäº§åæ ¼æ°éè¾å
¥ï¼éå¶å¿
须大äºçäº0 |
| | | const handleQuantityInput = value => { |
| | | if (value === "" || value === null || value === undefined) { |
| | | reportForm.quantity = null; |
| | | return; |
| | | } |
| | | if (value === "" || value === null || value === undefined) { reportForm.quantity = null; return; } |
| | | const num = Number(value); |
| | | if (isNaN(num)) { |
| | | return; |
| | | } |
| | | // 妿å°äº1ï¼æ¸
é¤ |
| | | if (num < 0) { |
| | | reportForm.quantity = null; |
| | | return; |
| | | } |
| | | // 妿æ¯å°æ°åæ´æ°é¨å |
| | | if (isNaN(num)) return; |
| | | if (num < 0) { reportForm.quantity = null; return; } |
| | | if (!Number.isInteger(num)) { |
| | | const intValue = Math.floor(num); |
| | | // 妿忴åå°äº1ï¼æ¸
é¤ |
| | | if (intValue < 0) { |
| | | reportForm.quantity = null; |
| | | return; |
| | | } |
| | | if (intValue < 0) { reportForm.quantity = null; return; } |
| | | reportForm.quantity = intValue; |
| | | return; |
| | | } |
| | | reportForm.quantity = num; |
| | | }; |
| | | |
| | | // å¤çæ¥åºæ°é |
| | | const handleScrapQtyInput = value => { |
| | | if (value === "" || value === null || value === undefined) { |
| | | reportForm.scrapQty = null; |
| | | return; |
| | | } |
| | | if (value === "" || value === null || value === undefined) { reportForm.scrapQty = null; return; } |
| | | const num = Number(value); |
| | | // 妿æ¯NaNï¼ä¿æåå¼ |
| | | if (isNaN(num)) { |
| | | return; |
| | | } |
| | | // 妿æ¯è´æ°ï¼æ¸
é¤è¾å
¥ |
| | | if (num < 0) { |
| | | reportForm.scrapQty = null; |
| | | return; |
| | | } |
| | | // 妿æ¯å°æ°ï¼åæ´æ°é¨å |
| | | if (!Number.isInteger(num)) { |
| | | reportForm.scrapQty = Math.floor(num); |
| | | return; |
| | | } |
| | | // ææçéè´æ´æ°ï¼å
æ¬0ï¼ |
| | | if (isNaN(num)) return; |
| | | if (num < 0) { reportForm.scrapQty = null; return; } |
| | | if (!Number.isInteger(num)) { reportForm.scrapQty = Math.floor(num); return; } |
| | | reportForm.scrapQty = num; |
| | | }; |
| | | |
| | | const filterMine = ref(false); |
| | | const currentReportRowData = ref(null); |
| | | const materialDialogVisible = ref(false); |
| | | const currentMaterialOrderRow = ref(null); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | total: 0, |
| | | }); |
| | | const page = reactive({ current: 1, size: 100, total: 0 }); |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | workOrderNo: "", |
| | | npsNo: "", |
| | | }, |
| | | searchForm: { workOrderNo: "", npsNo: "" }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | |
| | | const toProgressPercentage = val => { |
| | | const n = Number(val); |
| | | if (!Number.isFinite(n)) return 0; |
| | |
| | | return "#67c23a"; |
| | | }; |
| | | |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | const pagination = obj => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | | }; |
| | | const handleQuery = () => { page.current = 1; getList(); }; |
| | | const pagination = obj => { page.current = obj.page; page.size = obj.limit; getList(); }; |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const params = { ...searchForm.value, ...page }; |
| | | if (filterMine.value) { params.filterMine = true; } |
| | | productWorkOrderPage(params) |
| | | .then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | page.total = res.data.total; |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | .catch(() => { tableLoading.value = false; }); |
| | | }; |
| | | |
| | | // ä¸è½½å¹¶æå°å·¥åæµè½¬å¡ï¼æä»¶æµï¼ |
| | | const downloadAndPrintWorkOrder = async row => { |
| | | if (!row || !row.id) { |
| | | proxy.$modal.msgError("缺å°å·¥åIDï¼æ æ³ä¸è½½æµè½¬å¡"); |
| | | return; |
| | | } |
| | | const fileName = row.workOrderNo |
| | | ? `å·¥åæµè½¬å¡_${row.workOrderNo}.xlsx` |
| | | : "å·¥åæµè½¬å¡.xlsx"; |
| | | try { |
| | | // è°ç¨æ¥å£ï¼ä»¥ responseType: 'blob' è·åæä»¶æµ |
| | | const blob = await downProductWorkOrder(row.id); |
| | | |
| | | if (!blob) { |
| | | proxy.$modal.msgError("æªè·åå°æµè½¬å¡æä»¶"); |
| | | return; |
| | | } |
| | | |
| | | // å建 Blob URL |
| | | const fileBlob = |
| | | blob instanceof Blob |
| | | ? blob |
| | | : new Blob([blob], { type: blob.type || "application/octet-stream" }); |
| | | if (!blob) { proxy.$modal.msgError("æªè·åå°æµè½¬å¡æä»¶"); return; } |
| | | const fileBlob = blob instanceof Blob ? blob : new Blob([blob], { type: blob.type || "application/octet-stream" }); |
| | | const url = window.URL.createObjectURL(fileBlob); |
| | | |
| | | // å建éè iframeï¼ç¨äºè§¦åæµè§å¨æå° |
| | | const iframe = document.createElement("iframe"); |
| | | iframe.style.position = "fixed"; |
| | | iframe.style.right = "0"; |
| | | iframe.style.bottom = "0"; |
| | | iframe.style.width = "0"; |
| | | iframe.style.height = "0"; |
| | | iframe.style.border = "0"; |
| | | iframe.style.right = "0"; iframe.style.bottom = "0"; |
| | | iframe.style.width = "0"; iframe.style.height = "0"; iframe.style.border = "0"; |
| | | iframe.src = url; |
| | | document.body.appendChild(iframe); |
| | | |
| | | iframe.onload = () => { |
| | | try { |
| | | iframe.contentWindow?.focus(); |
| | | iframe.contentWindow?.print(); |
| | | } catch (e) { |
| | | console.error("èªå¨è°ç¨æå°å¤±è´¥", e); |
| | | // éèæ±å
¶æ¬¡ï¼æå¼æ°çªå£ç±ç¨æ·æå¨æå° |
| | | window.open(url); |
| | | } |
| | | try { iframe.contentWindow?.focus(); iframe.contentWindow?.print(); } |
| | | catch (e) { window.open(url); } |
| | | }; |
| | | } catch (e) { |
| | | console.error("ä¸è½½å·¥åæµè½¬å¡å¤±è´¥", e); |
| | |
| | | } |
| | | }; |
| | | |
| | | const showTransferCard = async row => { |
| | | transferCardRowData.value = row; |
| | | const qrContent = String(row.id); |
| | | |
| | | transferCardQrUrl.value = await QRCode.toDataURL(qrContent); |
| | | transferCardVisible.value = true; |
| | | }; |
| | | |
| | | const printTransferCard = () => { |
| | | window.print(); |
| | | }; |
| | | const printTransferCard = () => { window.print(); }; |
| | | const currentWorkOrderRow = ref(null); |
| | | |
| | | const openWorkOrderFiles = row => { |
| | |
| | | fileDialogVisible.value = true; |
| | | }; |
| | | |
| | | const showReportDialog = async row => { |
| | | if (row.productionOrderId) { |
| | | try { |
| | | const res = await listMaterialPickingDetail(row.productionOrderId); |
| | | const records = Array.isArray(res.data) |
| | | ? res.data |
| | | : res.data?.records || []; |
| | | if (res.code === 200 && records.length === 0) { |
| | | proxy.$modal.msgError("æªé¢ææ æ³æ¥å·¥"); |
| | | return; |
| | | const handleStartWork = row => { |
| | | proxy.$modal |
| | | .confirm("确认å¼å§æ¥å·¥ï¼", "æç¤º", { type: "info" }) |
| | | .then(async () => { |
| | | try { |
| | | await startWork({ |
| | | productionOperationTaskId: row.id, |
| | | userId: userStore.id, |
| | | }); |
| | | proxy.$modal.msgSuccess("å¼å§æ¥å·¥æå"); |
| | | getList(); |
| | | } catch (e) { |
| | | proxy.$modal.msgError("å¼å§æ¥å·¥å¤±è´¥"); |
| | | } |
| | | } catch (error) { |
| | | console.error("æ¥è¯¢é¢æè¯¦æ
失败:", error); |
| | | } |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | const showReportDialog = async row => { |
| | | currentReportRowData.value = row; |
| | | const planQuantity = Number(row.planQuantity || 0); |
| | | const completeQuantity = Number(row.completeQuantity || 0); |
| | | const remainingQuantity = Math.max(0, planQuantity - completeQuantity); |
| | | reportForm.planQuantity = remainingQuantity; |
| | | reportForm.quantity = |
| | | row.quantity !== undefined && row.quantity !== null ? row.quantity : null; |
| | | reportForm.quantity = row.quantity !== undefined && row.quantity !== null ? row.quantity : null; |
| | | reportForm.productProcessRouteItemId = row.productProcessRouteItemId; |
| | | reportForm.workOrderId = row.id; |
| | | reportForm.reportWork = row.reportWork; |
| | | reportForm.productMainId = row.productMainId; |
| | | reportForm.scrapQty = |
| | | row.scrapQty !== undefined && row.scrapQty !== null ? row.scrapQty : null; |
| | | reportForm.productionOrderRoutingOperationId = |
| | | row.productionOrderRoutingOperationId; |
| | | reportForm.scrapQty = row.scrapQty !== undefined && row.scrapQty !== null ? row.scrapQty : null; |
| | | reportForm.productionOrderRoutingOperationId = row.productionOrderRoutingOperationId; |
| | | reportForm.productionOrderId = row.productionOrderId; |
| | | if (row.type == 0) { |
| | | reportForm.workHour = row.workHour || 0; |
| | | } else { |
| | | reportForm.workHour = 0; |
| | | } |
| | | reportForm.workHour = row.type == 0 ? (row.workHour || 0) : 0; |
| | | nextTick(() => { |
| | | reportFormRef.value?.clearValidate(); |
| | | if (row.productionOrderRoutingOperationId && row.productionOrderId) { |
| | | loadParams(row.productionOrderRoutingOperationId, row.productionOrderId); |
| | | } |
| | | }); |
| | | if (userStore.id) { |
| | | reportForm.userId = userStore.id; |
| | | reportForm.userName = userStore.name || userStore.nickName || ""; |
| | | } |
| | | getUserProfile() |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | if (res.code === 200 && res.data) { |
| | | reportForm.userId = res.data.userId; |
| | | reportForm.userName = res.data.nickName; |
| | | reportForm.userName = res.data.nickName || res.data.userName || ""; |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.error("è·åç¨æ·ä¿¡æ¯å¤±è´¥", err); |
| | | }); |
| | | .catch(err => { console.error("è·åç¨æ·ä¿¡æ¯å¤±è´¥", err); }); |
| | | |
| | | reportDialogVisible.value = true; |
| | | }; |
| | |
| | | materialDialogVisible.value = true; |
| | | }; |
| | | |
| | | const handleReport = () => { |
| | | const handleFinishWork = () => { |
| | | reportFormRef.value?.validate(valid => { |
| | | if (!valid) { |
| | | return false; |
| | | } |
| | | if (!valid) return; |
| | | |
| | | if (reportForm.planQuantity <= 0) { |
| | | ElMessageBox.alert("å¾
ç产æ°é为0ï¼æ æ³æ¥å·¥", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | }); |
| | | ElMessageBox.alert("å¾
ç产æ°é为0ï¼æ æ³æ¥å·¥", "æç¤º", { confirmButtonText: "ç¡®å®" }); |
| | | return; |
| | | } |
| | | |
| | | // éªè¯çäº§åæ ¼æ°é |
| | | if ( |
| | | reportForm.quantity === null || |
| | | reportForm.quantity === undefined || |
| | | reportForm.quantity === "" |
| | | ) { |
| | | ElMessageBox.alert("请è¾å
¥çäº§åæ ¼æ°é", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | }); |
| | | if (reportForm.quantity === null || reportForm.quantity === undefined || reportForm.quantity === "") { |
| | | ElMessageBox.alert("请è¾å
¥çäº§åæ ¼æ°é", "æç¤º", { confirmButtonText: "ç¡®å®" }); |
| | | return; |
| | | } |
| | | |
| | | const quantity = Number(reportForm.quantity); |
| | | |
| | | if (isNaN(quantity) || quantity < 0) { |
| | | ElMessageBox.alert("çäº§åæ ¼æ°éå¿
须大äºçäº0", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | }); |
| | | ElMessageBox.alert("çäº§åæ ¼æ°éå¿
须大äºçäº0", "æç¤º", { confirmButtonText: "ç¡®å®" }); |
| | | return; |
| | | } |
| | | |
| | | // if (quantity > reportForm.planQuantity) { |
| | | // ElMessageBox.alert("æ¬æ¬¡ç产æ°éä¸è½è¶
è¿å¾
ç产æ°é", "æç¤º", { |
| | | // confirmButtonText: "ç¡®å®", |
| | | // }); |
| | | // return; |
| | | // } |
| | | |
| | | // éªè¯æ¥åºæ°é |
| | | const scrapQty = Number(reportForm.scrapQty); |
| | | if (!isNaN(scrapQty) && scrapQty < 0) { |
| | | ElMessageBox.alert("æ¥åºæ°éä¸è½å°äº0", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | }); |
| | | ElMessageBox.alert("æ¥åºæ°éä¸è½å°äº0", "æç¤º", { confirmButtonText: "ç¡®å®" }); |
| | | return; |
| | | } |
| | | |
| | | // if (!isNaN(scrapQty) && scrapQty > quantity) { |
| | | // ElMessageBox.alert("æ¥åºæ°éä¸è½å¤§äºæ¬æ¬¡ç产æ°é", "æç¤º", { |
| | | // confirmButtonText: "ç¡®å®", |
| | | // }); |
| | | // return; |
| | | // } |
| | | |
| | | const productionOperationParamList = params.value.map(param => ({ |
| | | ...param, |
| | | inputValue: reportForm.paramGroups[param.id] ?? "", |
| | | })); |
| | | |
| | | const submitParams = { |
| | | quantity: quantity, |
| | | addProductMain({ |
| | | quantity, |
| | | scrapQty: isNaN(scrapQty) ? 0 : scrapQty, |
| | | userId: reportForm.userId, |
| | | userName: reportForm.userName, |
| | |
| | | productProcessRouteItemId: reportForm.productProcessRouteItemId, |
| | | reportWork: reportForm.reportWork, |
| | | productMainId: reportForm.productMainId, |
| | | productionOrderRoutingOperationId: |
| | | reportForm.productionOrderRoutingOperationId, |
| | | productionOrderRoutingOperationId: reportForm.productionOrderRoutingOperationId, |
| | | productionOrderId: reportForm.productionOrderId, |
| | | workHour: reportForm.workHour, |
| | | productionOperationParamList: productionOperationParamList, |
| | | }; |
| | | |
| | | addProductMain(submitParams) |
| | | .then(res => { |
| | | proxy.$modal.msgSuccess("æ¥å·¥æå"); |
| | | }) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("ç»ææ¥å·¥æå"); |
| | | reportDialogVisible.value = false; |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | ElMessageBox.alert("æ¥å·¥å¤±è´¥", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | }); |
| | | ElMessageBox.alert("ç»ææ¥å·¥å¤±è´¥", "æç¤º", { confirmButtonText: "ç¡®å®" }); |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | if (dictOptions.value[dictType]) return dictOptions.value[dictType]; |
| | | try { |
| | | const res = await getDicts(dictType); |
| | | if (res.code === 200) { |
| | | dictOptions.value[dictType] = res.data; |
| | | return res.data; |
| | | } |
| | | if (res.code === 200) { dictOptions.value[dictType] = res.data; return res.data; } |
| | | return []; |
| | | } catch (error) { |
| | | console.error("è·ååå
¸æ°æ®å¤±è´¥:", error); |
| | | return []; |
| | | } |
| | | } catch (error) { console.error("è·ååå
¸æ°æ®å¤±è´¥:", error); return []; } |
| | | }; |
| | | |
| | | const loadParams = (productionOrderRoutingOperationId, productionOrderId) => { |
| | | paramLoading.value = true; |
| | | findProcessParamListOrder({ |
| | | productionOrderRoutingOperationId, |
| | | productionOrderId, |
| | | }) |
| | | findProcessParamListOrder({ productionOrderRoutingOperationId, productionOrderId }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | const paramList = res.data || []; |
| | | params.value = paramList; |
| | | reportForm.paramGroups = {}; |
| | | paramList.forEach(param => { |
| | | if (!reportForm.paramGroups[param.id]) { |
| | | reportForm.paramGroups[param.id] = ""; |
| | | } |
| | | if (param.paramType == "3" && param.paramFormat) { |
| | | getDictOptions(param.paramFormat); |
| | | } |
| | | if (!reportForm.paramGroups[param.id]) { reportForm.paramGroups[param.id] = ""; } |
| | | if (param.paramType == "3" && param.paramFormat) { getDictOptions(param.paramFormat); } |
| | | }); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.error("è·åå·¥åºåæ°å¤±è´¥:", err); |
| | | }) |
| | | .finally(() => { |
| | | paramLoading.value = false; |
| | | }); |
| | | .catch(err => { console.error("è·åå·¥åºåæ°å¤±è´¥:", err); }) |
| | | .finally(() => { paramLoading.value = false; }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | userStore.getInfo(); |
| | | getList(); |
| | | // è·åç¨æ·å表 |
| | | userListNoPageByTenantId().then(res => { |
| | | if (res.code === 200) { |
| | | userOptions.value = res.data; |
| | | } |
| | | if (res.code === 200) { userOptions.value = res.data; } |
| | | }); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .search-row { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 12px; |
| | | } |
| | | .search-item { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | .search_title { |
| | | margin-right: 8px; |
| | | font-size: 14px; |
| | | color: #606266; |
| | | } |
| | | .transfer-card-title { |
| | | text-align: center; |
| | | font-size: 24px; |
| | | font-weight: bold; |
| | | margin-bottom: 20px; |
| | | color: #303133; |
| | | } |
| | | .transfer-card-container { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | padding: 20px; |
| | | } |
| | | .transfer-card-info { |
| | | flex: 1; |
| | | margin-right: 20px; |
| | | } |
| | | .info-group { |
| | | margin-bottom: 20px; |
| | | } |
| | | .info-item { |
| | | display: flex; |
| | | margin-bottom: 10px; |
| | | } |
| | | .info-label { |
| | | width: 100px; |
| | | font-weight: bold; |
| | | color: #606266; |
| | | } |
| | | .info-value { |
| | | flex: 1; |
| | | color: #303133; |
| | | } |
| | | .transfer-card-qr { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | } |
| | | .qr-container { |
| | | text-align: center; |
| | | } |
| | | .print-button-container { |
| | | text-align: center; |
| | | margin-top: 20px; |
| | | } |
| | | .param-grid { |
| | | margin-top: 10px; |
| | | border-top: 1px solid #ebe9f3; |
| | | padding-top: 10px; |
| | | } |
| | | .param-item { |
| | | margin-bottom: 12px; |
| | | } |
| | | .param-input-group { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 8px; |
| | | } |
| | | .param-input { |
| | | flex: 1; |
| | | } |
| | | .param-select { |
| | | flex: 1; |
| | | } |
| | | .param-unit { |
| | | color: #909399; |
| | | font-size: 12px; |
| | | min-width: 30px; |
| | | } |
| | | .search-row { display: flex; align-items: center; gap: 12px; } |
| | | .search-item { display: flex; align-items: center; } |
| | | .search_title { margin-right: 8px; font-size: 14px; color: #606266; } |
| | | .transfer-card-title { text-align: center; font-size: 24px; font-weight: bold; margin-bottom: 20px; color: #303133; } |
| | | .transfer-card-container { display: flex; justify-content: space-between; padding: 20px; } |
| | | .transfer-card-info { flex: 1; margin-right: 20px; } |
| | | .info-group { margin-bottom: 20px; } |
| | | .info-item { display: flex; margin-bottom: 10px; } |
| | | .info-label { width: 100px; font-weight: bold; color: #606266; } |
| | | .info-value { flex: 1; color: #303133; } |
| | | .transfer-card-qr { display: flex; flex-direction: column; align-items: center; } |
| | | .qr-container { text-align: center; } |
| | | .print-button-container { text-align: center; margin-top: 20px; } |
| | | .param-grid { margin-top: 10px; border-top: 1px solid #ebe9f3; padding-top: 10px; } |
| | | .param-item { margin-bottom: 12px; } |
| | | .param-input-group { display: flex; align-items: center; gap: 8px; } |
| | | .param-input { flex: 1; } |
| | | .param-select { flex: 1; } |
| | | .param-unit { color: #909399; font-size: 12px; min-width: 30px; } |
| | | </style> |
| | | |
| | | <style lang="scss"> |
| | | <style lang="scss"> |
| | | @media print { |
| | | @page { |
| | | size: landscape; |
| | | } |
| | | body * { |
| | | visibility: hidden; |
| | | } |
| | | .el-dialog__wrapper, |
| | | .el-dialog, |
| | | .el-dialog__body, |
| | | .transfer-card-title, |
| | | .transfer-card-container, |
| | | .transfer-card-container *, |
| | | .info-item, |
| | | .info-label, |
| | | .info-value { |
| | | visibility: visible; |
| | | } |
| | | .print-button-container { |
| | | visibility: hidden; |
| | | } |
| | | .el-dialog__wrapper { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | margin: 0; |
| | | } |
| | | .el-dialog { |
| | | width: 100% !important; |
| | | max-width: 800px; |
| | | margin: 0 auto !important; |
| | | } |
| | | .el-dialog__header, |
| | | .el-dialog__footer { |
| | | display: none; |
| | | } |
| | | .el-dialog__body { |
| | | padding: 20px; |
| | | } |
| | | .transfer-card-container { |
| | | height: auto; |
| | | display: flex; |
| | | gap: 20px; |
| | | } |
| | | @page { size: landscape; } |
| | | body * { visibility: hidden; } |
| | | .el-dialog__wrapper, .el-dialog, .el-dialog__body, |
| | | .transfer-card-title, .transfer-card-container, .transfer-card-container *, |
| | | .info-item, .info-label, .info-value { visibility: visible; } |
| | | .print-button-container { visibility: hidden; } |
| | | .el-dialog__wrapper { position: absolute; top: 0; left: 0; right: 0; margin: 0; } |
| | | .el-dialog { width: 100% !important; max-width: 800px; margin: 0 auto !important; } |
| | | .el-dialog__header, .el-dialog__footer { display: none; } |
| | | .el-dialog__body { padding: 20px; } |
| | | .transfer-card-container { height: auto; display: flex; gap: 20px; } |
| | | .transfer-card-info { |
| | | flex: 1; |
| | | .info-group { |
| | | width: 100%; |
| | | float: none; |
| | | margin-bottom: 20px; |
| | | } |
| | | .info-item { |
| | | display: flex; |
| | | margin-bottom: 10px; |
| | | .info-label { |
| | | width: 100px; |
| | | font-weight: bold; |
| | | margin-right: 15px; |
| | | white-space: nowrap; |
| | | } |
| | | .info-value { |
| | | flex: 1; |
| | | word-break: break-word; |
| | | } |
| | | .info-group { width: 100%; float: none; margin-bottom: 20px; } |
| | | .info-item { display: flex; margin-bottom: 10px; |
| | | .info-label { width: 100px; font-weight: bold; margin-right: 15px; white-space: nowrap; } |
| | | .info-value { flex: 1; word-break: break-word; } |
| | | } |
| | | } |
| | | .transfer-card-qr { |
| | | width: 160px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: flex-start; |
| | | } |
| | | .qr-container img { |
| | | width: 140px !important; |
| | | height: 140px !important; |
| | | } |
| | | .transfer-card-qr { width: 160px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; } |
| | | .qr-container img { width: 140px !important; height: 140px !important; } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog |
| | | v-model="dialogFormVisible" |
| | | :title="operationType === 'add' ? 'æ°å¢ä¸åæ ¼å¤ç' : 'å¤çä¸åæ ¼'" |
| | | width="70%" |
| | | @close="closeDia" |
| | | v-model="dialogFormVisible" |
| | | :title="operationType === 'add' ? 'æ°å¢ä¸åæ ¼å¤ç' : 'å¤çä¸åæ ¼'" |
| | | width="75%" |
| | | @close="closeDia" |
| | | > |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-form :model="form" label-width="130px" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç±»å«ï¼" prop="inspectType"> |
| | | <el-select v-model="form.inspectType" disabled> |
| | | <el-form-item label="ç±»å«"> |
| | | <el-select v-model="form.inspectType" disabled style="width: 100%"> |
| | | <el-option label="åæææ£éª" :value="0" /> |
| | | <el-option label="è¿ç¨æ£éª" :value="1" /> |
| | | <el-option label="åºåæ£éª" :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="产ååç§°ï¼" prop="productId"> |
| | | <el-form-item label="产ååç§°"> |
| | | <el-tree-select |
| | | v-model="form.productId" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | disabled |
| | | check-strictly |
| | | @change="getModels" |
| | | :data="productOptions" |
| | | :render-after-expand="false" |
| | | style="width: 100%" |
| | | v-model="form.productId" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | disabled |
| | | check-strictly |
| | | @change="getModels" |
| | | :data="productOptions" |
| | | :render-after-expand="false" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è§æ ¼åå·ï¼" prop="model"> |
| | | <el-input v-model="form.model" placeholder="请è¾å
¥" clearable disabled/> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="è§æ ¼åå·"> |
| | | <el-input v-model="form.model" placeholder="请è¾å
¥" clearable disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="åä½"> |
| | | <el-input v-model="form.unit" placeholder="请è¾å
¥" clearable disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="æ°é"> |
| | | <el-input v-model="form.quantity" placeholder="请è¾å
¥" clearable disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åä½ï¼" prop="unit"> |
| | | <el-input v-model="form.unit" placeholder="请è¾å
¥" clearable disabled/> |
| | | <el-form-item label="æ£éªå"> |
| | | <el-input v-model="form.checkName" placeholder="请è¾å
¥" clearable disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ°éï¼" prop="quantity"> |
| | | <el-input v-model="form.quantity" placeholder="请è¾å
¥" clearable disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-input v-model="form.checkName" placeholder="请è¾å
¥" clearable disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£æµæ¥æï¼" prop="checkTime"> |
| | | <el-form-item label="æ£æµæ¥æ"> |
| | | <el-date-picker |
| | | v-model="form.checkTime" |
| | | type="date" |
| | | disabled |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | style="width: 100%" |
| | | v-model="form.checkTime" |
| | | type="date" |
| | | disabled |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸åæ ¼ç°è±¡ï¼" prop="defectivePhenomena"> |
| | | <el-input v-model="form.defectivePhenomena" placeholder="请è¾å
¥" clearable/> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ä¸åæ ¼ç°è±¡" prop="defectivePhenomena"> |
| | | <el-input v-model="form.defectivePhenomena" type="textarea" :rows="2" placeholder="请è¾å
¥" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å¤çç»æï¼" prop="dealResult"> |
| | | <el-select v-model="form.dealResult" placeholder="è¯·éæ©" clearable> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="å¤çç»æ" prop="dealResult"> |
| | | <el-select v-model="form.dealResult" placeholder="è¯·éæ©" clearable style="width: 100%"> |
| | | <el-option :label="item.label" :value="item.value" v-for="item in filteredRejectionHandling" :key="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å¤ç人ï¼" prop="dealName"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="å¤ç人" prop="dealName"> |
| | | <el-select v-model="form.dealName" placeholder="è¯·éæ©" clearable style="width: 100%"> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | <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="dealTime"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="å¤çæ¥æ" prop="dealTime"> |
| | | <el-date-picker |
| | | v-model="form.dealTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | style="width: 100%" |
| | | v-model="form.dealTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="éä»¶ï¼"> |
| | | <el-form-item label="éä»¶"> |
| | | <FileUpload v-model:file-list="form.storageBlobDTOs" :file-list="form.storageBlobVOs" /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref, reactive, toRefs, computed} from "vue"; |
| | | import {productTreeList} from "@/api/basicData/product.js"; |
| | | import { ref, reactive, toRefs, computed } from "vue"; |
| | | import { productTreeList } from "@/api/basicData/product.js"; |
| | | import { |
| | | getQualityUnqualifiedInfo, |
| | | qualityUnqualifiedDeal |
| | | } from "@/api/qualityManagement/nonconformingManagement.js"; |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import FileUpload from "@/components/AttachmentUpload/file/index.vue"; |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | |
| | | const { rejection_handling } = proxy.useDict("rejection_handling") |
| | | const { proxy } = getCurrentInstance(); |
| | | const emit = defineEmits(["close"]); |
| | | |
| | | const { rejection_handling } = proxy.useDict("rejection_handling"); |
| | | const dialogFormVisible = ref(false); |
| | | const operationType = ref('') |
| | | const operationType = ref(""); |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | | checkTime: "", |
| | |
| | | quantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | inspectType: '', |
| | | defectivePhenomena: '', |
| | | dealResult: '', |
| | | dealName: '', |
| | | dealTime: '', |
| | | inspectType: "", |
| | | defectivePhenomena: "", |
| | | dealResult: "", |
| | | dealName: "", |
| | | dealTime: "", |
| | | method: undefined, |
| | | storageBlobDTOs: [], |
| | | storageBlobVOs: [], |
| | | }, |
| | | rules: { |
| | | checkTime: [{ required: false, message: "请è¾å
¥", trigger: "blur" },], |
| | | process: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkName: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | productId: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | model: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | unit: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | quantity: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkCompany: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | checkResult: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | defectivePhenomena: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | dealResult: [{ required: true, message: "请è¾å
¥", trigger: "blur" }], |
| | | defectivePhenomena: [{ required: true, message: "请è¾å
¥ä¸åæ ¼ç°è±¡", trigger: "blur" }], |
| | | dealResult: [{ required: true, message: "è¯·éæ©å¤çç»æ", trigger: "change" }], |
| | | dealName: [{ required: true, message: "è¯·éæ©å¤ç人", trigger: "change" }], |
| | | dealTime: [{ required: true, message: "请è¾å
¥", trigger: "change" }], |
| | | dealTime: [{ required: true, message: "è¯·éæ©å¤çæ¥æ", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { form, rules } = toRefs(data); |
| | | const productOptions = ref([]); |
| | | const userList = ref([]); // å¤çäººä¸æå表 |
| | | const userList = ref([]); |
| | | |
| | | const filteredRejectionHandling = computed(() => { |
| | | const data = rejection_handling.value; |
| | | if (form.value.method) { |
| | | return data.filter(item => item && item.label && item.label !== 'è¿å·¥' && item.label !== 'è¿ä¿®') |
| | | return data.filter(item => item && item.label && item.label !== "è¿å·¥" && item.label !== "è¿ä¿®"); |
| | | } |
| | | return data |
| | | }) |
| | | return data; |
| | | }); |
| | | |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openDialog = async (type, row) => { |
| | | operationType.value = type; |
| | | // å¤çäººä¸æå表 |
| | | try { |
| | | const userRes = await userListNoPage(); |
| | | userList.value = userRes.data || []; |
| | |
| | | dialogFormVisible.value = true; |
| | | form.value = {}; |
| | | getProductOptions(); |
| | | if (operationType.value === 'edit') { |
| | | if (operationType.value === "edit") { |
| | | getQualityUnqualifiedInfo(row.id).then(res => { |
| | | const { inspectState, ...rest } = (res.data || {}) |
| | | // ææ°æ®å°±æ¾ç¤ºé»è®¤å¼ï¼æ²¡æå°±ä¸æ¾ç¤º |
| | | form.value = { ...rest } |
| | | }) |
| | | const { inspectState, ...rest } = (res.data || {}); |
| | | form.value = { ...rest }; |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | const getProductOptions = () => { |
| | | productTreeList().then((res) => { |
| | | productOptions.value = convertIdToValue(res); |
| | | }); |
| | | }; |
| | | |
| | | const getModels = (value) => { |
| | | form.value.productName = findNodeById(productOptions.value, value); |
| | | }; |
| | | |
| | | const findNodeById = (nodes, productId) => { |
| | | for (let i = 0; i < nodes.length; i++) { |
| | | if (nodes[i].value === productId) { |
| | | return nodes[i].label; // æ¾å°èç¹ï¼è¿å该èç¹ |
| | | return nodes[i].label; |
| | | } |
| | | if (nodes[i].children && nodes[i].children.length > 0) { |
| | | const foundNode = findNodeById(nodes[i].children, productId); |
| | | if (foundNode) { |
| | | return foundNode; // å¨åèç¹ä¸æ¾å°ï¼è¿å该èç¹ |
| | | return foundNode; |
| | | } |
| | | } |
| | | } |
| | | return null; // æ²¡ææ¾å°èç¹ï¼è¿ånull |
| | | return null; |
| | | }; |
| | | |
| | | function convertIdToValue(data) { |
| | | return data.map((item) => { |
| | | const { id, children, ...rest } = item; |
| | | const newItem = { |
| | | ...rest, |
| | | value: id, // å° id æ¹ä¸º value |
| | | value: id, |
| | | }; |
| | | if (children && children.length > 0) { |
| | | newItem.children = convertIdToValue(children); |
| | | } |
| | | |
| | | return newItem; |
| | | }); |
| | | } |
| | | // æäº¤äº§å表å |
| | | |
| | | const submitForm = () => { |
| | | proxy.$refs.formRef.validate(valid => { |
| | | if (valid) { |
| | | // ç¶æåæ®µä¸å¨è¡¨åå¡«åï¼ä¹ä¸ä¼ ç»å端ï¼å¤çç»ä¸èµ° /deal æ¥å£ |
| | | const { inspectState, ...payload } = (form.value || {}) |
| | | const { inspectState, ...payload } = (form.value || {}); |
| | | qualityUnqualifiedDeal(payload).then(() => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | }) |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | // å
³éå¼¹æ¡ |
| | | }); |
| | | }; |
| | | |
| | | const closeDia = () => { |
| | | proxy.resetForm("formRef"); |
| | | dialogFormVisible.value = false; |
| | | emit('close') |
| | | emit("close"); |
| | | }; |
| | | |
| | | defineExpose({ |
| | | openDialog, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | <style scoped></style> |
| | |
| | | <div> |
| | | <el-dialog |
| | | v-model="dialogFormVisible" |
| | | :title="operationType === 'add' ? 'æ°å¢ä¸åæ ¼åå¤çå' : 'ç¼è¾ä¸åæ ¼åå¤çå'" |
| | | width="70%" |
| | | :title="operationType === 'add' ? 'æ°å¢ä¸åæ ¼åå¤çå' : operationType === 'view' ? 'ä¸åæ ¼åå¤çå详æ
' : operationType === 'dispose' ? 'å¤ç½®ä¸åæ ¼åå¤çå' : 'ç¼è¾ä¸åæ ¼åå¤çå'" |
| | | width="75%" |
| | | @close="closeDia" |
| | | > |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-form :model="form" label-width="130px" :rules="rules" ref="formRef"> |
| | | <!-- å
³èä¸åæ ¼åï¼ä»
æ°å¢æ¶ï¼ --> |
| | | <el-row :gutter="20" v-if="operationType === 'add'"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="项ç®åç§°" prop="projectName"> |
| | | <el-input v-model="form.projectName" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="项ç®ç¼å·" prop="projectNo"> |
| | | <el-input v-model="form.projectNo" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤åç§°" prop="equipmentName"> |
| | | <el-input v-model="form.equipmentName" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设å¤å¾å·" prop="equipmentDrawingNo"> |
| | | <el-input v-model="form.equipmentDrawingNo" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç©æ/é¨ä»¶åç§°" prop="materialName"> |
| | | <el-input v-model="form.materialName" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç©æå¾å·" prop="materialDrawingNo"> |
| | | <el-input v-model="form.materialDrawingNo" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åå·è§æ ¼" prop="specificationModel"> |
| | | <el-input v-model="form.specificationModel" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æè´¨" prop="materialQuality"> |
| | | <el-input v-model="form.materialQuality" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ»æ°é" prop="quantity"> |
| | | <el-input-number v-model="form.quantity" :min="0" style="width: 100%" :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸åæ ¼æ°é" prop="unqualifiedQuantity"> |
| | | <el-input-number v-model="form.unqualifiedQuantity" :min="0" style="width: 100%" :disabled="operationType === 'view'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¸åæ ¼å·¥åº" prop="unqualifiedProcess"> |
| | | <el-select v-model="form.unqualifiedProcess" placeholder="è¯·éæ©" clearable :disabled="operationType === 'view'" style="width: 100%"> |
| | | <el-option label="æ¥æ" :value="1" /> |
| | | <el-option label="å¶ç¨" :value="2" /> |
| | | <el-option label="æå" :value="3" /> |
| | | <el-form-item label="å
³èä¸åæ ¼å" prop="unqualifiedId"> |
| | | <el-select v-model="form.unqualifiedId" placeholder="éæ©ä¸åæ ¼åè®°å½" filterable clearable |
| | | @change="handleUnqualifiedSelect" style="width: 100%"> |
| | | <el-option v-for="item in unqualifiedList" :key="item.id" |
| | | :label="item.productName + ' ' + item.model + ' (' + item.quantity + ')'" |
| | | :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ä¾åºååç§°" prop="supplierName"> |
| | | <el-input v-model="form.supplierName" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | <el-form-item label="ä¸åæ ¼å·¥åº"> |
| | | <el-radio-group v-model="form.unqualifiedProcess" :disabled="operationType === 'view' || operationType === 'dispose'"> |
| | | <el-radio :value="1">æ¥æ</el-radio> |
| | | <el-radio :value="2">å¶ç¨</el-radio> |
| | | <el-radio :value="3">æå</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-divider>åºæ¬ä¿¡æ¯</el-divider> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£éªå" prop="inspectorName"> |
| | | <el-input v-model="form.inspectorName" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | <el-form-item label="项ç®åç§°"> |
| | | <el-input v-model="form.projectName" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£éªæ¥æ" prop="inspectDate"> |
| | | <el-date-picker v-model="form.inspectDate" type="date" value-format="YYYY-MM-DD" format="YYYY-MM-DD" placeholder="è¯·éæ©" clearable style="width: 100%" :disabled="operationType === 'view'" /> |
| | | <el-form-item label="项ç®ç¼å·"> |
| | | <el-input v-model="form.projectNo" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="责任人" prop="responsiblePerson"> |
| | | <el-input v-model="form.responsiblePerson" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | <el-form-item label="设å¤åç§°"> |
| | | <el-input v-model="form.equipmentName" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="责任é¨é¨" prop="responsibleDept"> |
| | | <el-input v-model="form.responsibleDept" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" /> |
| | | <el-form-item label="设å¤å¾å·"> |
| | | <el-input v-model="form.equipmentDrawingNo" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç©æ/é¨ä»¶åç§°"> |
| | | <el-input v-model="form.materialName" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="ç©æå¾å·"> |
| | | <el-input v-model="form.materialDrawingNo" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="åå·è§æ ¼"> |
| | | <el-input v-model="form.specificationModel" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="æè´¨"> |
| | | <el-input v-model="form.materialQuality" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="ä¾åºå"> |
| | | <el-input v-model="form.supplierName" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-divider>ä¸åæ ¼ä¿¡æ¯</el-divider> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="æ»æ°é"> |
| | | <el-input-number v-model="form.quantity" :min="0" :precision="2" style="width: 100%" :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="ä¸åæ ¼æ°é"> |
| | | <el-input-number v-model="form.unqualifiedQuantity" :min="0" :precision="2" style="width: 100%" :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="æ£éªæ¥æ"> |
| | | <el-date-picker v-model="form.inspectDate" type="date" value-format="YYYY-MM-DD" placeholder="è¯·éæ©" clearable style="width: 100%" :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="æ£éªå"> |
| | | <el-input v-model="form.inspectorName" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="责任人"> |
| | | <el-input v-model="form.responsiblePerson" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="责任é¨é¨"> |
| | | <el-input v-model="form.responsibleDept" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="é®é¢æè¿°" prop="problemDescription"> |
| | | <el-input type="textarea" v-model="form.problemDescription" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" :rows="3" /> |
| | | <el-form-item label="é®é¢æè¿°"> |
| | | <el-input type="textarea" v-model="form.problemDescription" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view' || operationType === 'dispose'" :rows="3" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-divider>å¤ç½®å³ç</el-divider> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="åå åæå建议" prop="reasonAnalysis"> |
| | | <el-form-item label="å¤ç½®æ¹å¼" prop="disposalMethod"> |
| | | <el-radio-group v-model="form.disposalMethod" :disabled="operationType === 'view'"> |
| | | <el-radio :value="1">è®©æ¥æ¥æ¶</el-radio> |
| | | <el-radio :value="2">åå
ç»´ä¿®</el-radio> |
| | | <el-radio :value="3">è¿åç»´ä¿®</el-radio> |
| | | <el-radio :value="4">æ¢è´§</el-radio> |
| | | <el-radio :value="5">éè´§</el-radio> |
| | | <el-radio :value="6">æ¥åº</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20" v-if="form.disposalMethod === 2 || form.disposalMethod === 3"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="åå
/è¿åç»´ä¿®è¯ä¼°"> |
| | | <el-input type="textarea" v-model="form.repairEvaluation" placeholder="è¯ä¼°ç»´ä¿®å¯è¡æ§ãæéå·¥æ¶ãç©æç" clearable :disabled="operationType === 'view'" :rows="3" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="åå åæå建议"> |
| | | <el-input type="textarea" v-model="form.reasonAnalysis" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" :rows="3" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="çº æ£æªæ½" prop="correctionAction"> |
| | | <el-input type="textarea" v-model="form.correctionAction" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" :rows="3" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å¤ç½®æ¹å¼" prop="disposalMethod"> |
| | | <el-select v-model="form.disposalMethod" placeholder="è¯·éæ©" clearable :disabled="operationType === 'view'" style="width: 100%"> |
| | | <el-option label="è®©æ¥æ¥æ¶" :value="1" /> |
| | | <el-option label="åå
ç»´ä¿®" :value="2" /> |
| | | <el-option label="è¿åç»´ä¿®" :value="3" /> |
| | | <el-option label="æ¢è´§" :value="4" /> |
| | | <el-option label="éè´§" :value="5" /> |
| | | <el-option label="æ¥åº" :value="6" /> |
| | | </el-select> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="çº æ£æªæ½"> |
| | | <el-input type="textarea" v-model="form.correctionAction" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" :rows="2" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç»´ä¿®è¯ä¼°" prop="repairEvaluation"> |
| | | <el-input type="textarea" v-model="form.repairEvaluation" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" :rows="3" /> |
| | | <el-form-item label="é¢é²æªæ½"> |
| | | <el-input type="textarea" v-model="form.preventiveAction" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" :rows="2" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-divider>å®¡æ¹æè§</el-divider> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="é¢é²æªæ½" prop="preventiveAction"> |
| | | <el-input type="textarea" v-model="form.preventiveAction" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" :rows="3" /> |
| | | <el-form-item label="责任é¨é¨ä¸»ç®¡æè§"> |
| | | <el-input type="textarea" v-model="form.deptOpinion" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" :rows="2" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-form-item label="å
¬å¸å¤çå³å®"> |
| | | <el-input type="textarea" v-model="form.companyDecision" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" :rows="2" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ»ç»çæè§"> |
| | | <el-input type="textarea" v-model="form.generalManagerOpinion" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" :rows="2" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨"> |
| | | <el-input type="textarea" v-model="form.remark" placeholder="请è¾å
¥" clearable :disabled="operationType === 'view'" :rows="2" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-divider>éä»¶</el-divider> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="éä»¶"> |
| | | <FileUpload v-model:file-list="form.storageBlobDTOs" :file-list="form.storageBlobVOs" :disabled="operationType === 'view'" /> |
| | |
| | | |
| | | <script setup> |
| | | import { ref, reactive, toRefs, getCurrentInstance } from "vue"; |
| | | import { save, update, getDetail } from "@/api/qualityManagement/qualityUnqualifiedOrder.js"; |
| | | import { |
| | | saveQualityUnqualifiedOrder, |
| | | updateQualityUnqualifiedOrder, |
| | | getQualityUnqualifiedOrderDetail, |
| | | qualityUnqualifiedListPage, |
| | | dealQualityUnqualifiedOrder, |
| | | } from "@/api/qualityManagement/nonconformingManagement.js"; |
| | | import FileUpload from "@/components/AttachmentUpload/file/index.vue"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | |
| | | const dialogFormVisible = ref(false); |
| | | const operationType = ref(""); |
| | | const unqualifiedList = ref([]); |
| | | |
| | | const emptyForm = { |
| | | unqualifiedId: undefined, |
| | | projectName: "", |
| | | projectNo: "", |
| | | equipmentId: undefined, |
| | | equipmentName: "", |
| | | equipmentDrawingNo: "", |
| | | materialName: "", |
| | | productModelId: undefined, |
| | | materialDrawingNo: "", |
| | | specificationModel: "", |
| | | materialQuality: "", |
| | | quantity: undefined, |
| | | unqualifiedQuantity: undefined, |
| | | unqualifiedProcess: undefined, |
| | | supplierName: "", |
| | | inspectorName: "", |
| | | inspectDate: "", |
| | | responsiblePerson: "", |
| | | responsibleDept: "", |
| | | problemDescription: "", |
| | | reasonAnalysis: "", |
| | | correctionAction: "", |
| | | disposalMethod: undefined, |
| | | repairEvaluation: "", |
| | | preventiveAction: "", |
| | | deptOpinion: "", |
| | | companyDecision: "", |
| | | generalManagerOpinion: "", |
| | | remark: "", |
| | | storageBlobDTOs: [], |
| | | storageBlobVOs: [], |
| | | }; |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | | projectName: "", |
| | | projectNo: "", |
| | | equipmentName: "", |
| | | equipmentDrawingNo: "", |
| | | materialName: "", |
| | | materialDrawingNo: "", |
| | | specificationModel: "", |
| | | materialQuality: "", |
| | | quantity: undefined, |
| | | unqualifiedQuantity: undefined, |
| | | unqualifiedProcess: undefined, |
| | | supplierName: "", |
| | | inspectorName: "", |
| | | inspectDate: "", |
| | | responsiblePerson: "", |
| | | responsibleDept: "", |
| | | problemDescription: "", |
| | | reasonAnalysis: "", |
| | | correctionAction: "", |
| | | disposalMethod: undefined, |
| | | repairEvaluation: "", |
| | | preventiveAction: "", |
| | | remark: "", |
| | | storageBlobDTOs: [], |
| | | storageBlobVOs: [], |
| | | }, |
| | | form: { ...emptyForm }, |
| | | rules: { |
| | | projectName: [{ required: false, message: "请è¾å
¥", trigger: "blur" }], |
| | | unqualifiedId: [{ required: true, message: "è¯·éæ©å
³èä¸åæ ¼å", trigger: "change" }], |
| | | disposalMethod: [{ required: true, message: "è¯·éæ©å¤ç½®æ¹å¼", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const { form, rules } = toRefs(data); |
| | | |
| | | const loadUnqualifiedList = () => { |
| | | qualityUnqualifiedListPage({ inspectState: 0, page: 1, size: 999 }).then(res => { |
| | | unqualifiedList.value = res.data?.records || []; |
| | | }); |
| | | }; |
| | | |
| | | const handleUnqualifiedSelect = (id) => { |
| | | const record = unqualifiedList.value.find(item => item.id === id); |
| | | if (!record) return; |
| | | form.value.materialName = record.productName || ""; |
| | | form.value.specificationModel = record.model || ""; |
| | | form.value.quantity = record.quantity; |
| | | form.value.inspectorName = record.checkName || ""; |
| | | form.value.inspectDate = record.checkTime || ""; |
| | | form.value.problemDescription = record.defectivePhenomena || ""; |
| | | form.value.unqualifiedProcess = record.inspectType != null ? record.inspectType + 1 : undefined; |
| | | form.value.unqualifiedQuantity = record.quantity; |
| | | }; |
| | | |
| | | const openDialog = async (type, row) => { |
| | | operationType.value = type; |
| | | dialogFormVisible.value = true; |
| | | if (type === "add") { |
| | | form.value = { |
| | | projectName: "", |
| | | projectNo: "", |
| | | equipmentName: "", |
| | | equipmentDrawingNo: "", |
| | | materialName: "", |
| | | materialDrawingNo: "", |
| | | specificationModel: "", |
| | | materialQuality: "", |
| | | quantity: undefined, |
| | | unqualifiedQuantity: undefined, |
| | | unqualifiedProcess: undefined, |
| | | supplierName: "", |
| | | inspectorName: "", |
| | | inspectDate: "", |
| | | responsiblePerson: "", |
| | | responsibleDept: "", |
| | | problemDescription: "", |
| | | reasonAnalysis: "", |
| | | correctionAction: "", |
| | | disposalMethod: undefined, |
| | | repairEvaluation: "", |
| | | preventiveAction: "", |
| | | remark: "", |
| | | storageBlobDTOs: [], |
| | | storageBlobVOs: [], |
| | | }; |
| | | loadUnqualifiedList(); |
| | | Object.assign(data.form, { ...emptyForm }); |
| | | } else { |
| | | form.value = {}; |
| | | Object.assign(data.form, { ...emptyForm }); |
| | | if (row?.id) { |
| | | getDetail(row.id).then((res) => { |
| | | form.value = res.data || res || {}; |
| | | getQualityUnqualifiedOrderDetail(row.id).then((res) => { |
| | | const detail = res.data || res || {}; |
| | | Object.assign(data.form, { ...emptyForm }, detail); |
| | | }); |
| | | } |
| | | } |
| | |
| | | const submitForm = () => { |
| | | proxy.$refs.formRef.validate((valid) => { |
| | | if (valid) { |
| | | const { status, ...payload } = form.value || {}; |
| | | const { status, storageBlobVOs, ...payload } = form.value || {}; |
| | | if (operationType.value === "add") { |
| | | save(payload).then(() => { |
| | | saveQualityUnqualifiedOrder(payload).then(() => { |
| | | proxy.$modal.msgSuccess("æäº¤æå"); |
| | | closeDia(); |
| | | }); |
| | | } else if (operationType.value === "dispose") { |
| | | const dealFields = { |
| | | id: payload.id, |
| | | disposalMethod: payload.disposalMethod, |
| | | repairEvaluation: payload.repairEvaluation, |
| | | reasonAnalysis: payload.reasonAnalysis, |
| | | correctionAction: payload.correctionAction, |
| | | preventiveAction: payload.preventiveAction, |
| | | remark: payload.remark, |
| | | deptOpinion: payload.deptOpinion, |
| | | companyDecision: payload.companyDecision, |
| | | generalManagerOpinion: payload.generalManagerOpinion, |
| | | }; |
| | | dealQualityUnqualifiedOrder(dealFields).then(() => { |
| | | proxy.$modal.msgSuccess("å¤ç½®æå"); |
| | | closeDia(); |
| | | }); |
| | | } else { |
| | | update(payload).then(() => { |
| | | updateQualityUnqualifiedOrder(payload).then(() => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | closeDia(); |
| | | }); |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" inline style="margin-bottom: 0;"> |
| | | <el-form-item label="ç±»åï¼"> |
| | | <el-select v-model="searchForm.inspectType" clearable style="width: 200px" @change="handleQuery"> |
| | | <el-option label="åæææ£éª" :value="0" /> |
| | | <el-option label="è¿ç¨æ£éª" :value="1" /> |
| | | <el-option label="åºåæ£éª" :value="2" /> |
| | | </el-select> |
| | | <el-form :model="queryParams" inline style="margin-bottom: 0;"> |
| | | <el-form-item label="å¤çåç¼å·"> |
| | | <el-input v-model="queryParams.orderNo" style="width: 200px" placeholder="è¾å
¥ç¼å·" clearable |
| | | :prefix-icon="Search" @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æï¼"> |
| | | <el-select v-model="searchForm.inspectState" clearable style="width: 200px" @change="handleQuery"> |
| | | <el-option label="å¾
å¤ç" :value="0" /> |
| | | <el-option label="å·²å¤ç" :value="1" /> |
| | | </el-select> |
| | | <el-form-item label="项ç®åç§°"> |
| | | <el-input v-model="queryParams.projectName" style="width: 200px" placeholder="è¾å
¥é¡¹ç®" clearable |
| | | :prefix-icon="Search" @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="产ååç§°ï¼"> |
| | | <el-input |
| | | v-model="searchForm.productName" |
| | | style="width: 200px" |
| | | placeholder="请è¾å
¥äº§ååç§°æç´¢" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æ£æµæ¥æï¼"> |
| | | <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" |
| | | style="width: 300px" |
| | | placeholder="è¯·éæ©" clearable @change="changeDaterange" /> |
| | | <!-- <el-form-item label="ç¶æ">–>--> |
| | | <!-- <el-select v-model="queryParams.status" clearable style="width: 150px" @change="handleQuery" placeholder="å
¨é¨">–>--> |
| | | <!-- <el-option label="è稿" :value="0" />–>--> |
| | | <!-- <el-option label="å¾
审æ¹" :value="1" />–>--> |
| | | <!-- <el-option label="审æ¹ä¸" :value="2" />–>--> |
| | | <!-- <el-option label="已宿" :value="3" />–>--> |
| | | <!-- <el-option label="已驳å" :value="4" />–>--> |
| | | <!-- </el-select>–>--> |
| | | <!-- </el-form-item>–>--> |
| | | <el-form-item label="å建æ¶é´"> |
| | | <el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" |
| | | style="width: 260px" placeholder="è¯·éæ©" clearable @change="changeDaterange" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleQuery">æç´¢</el-button> |
| | | <el-button @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="mb20" style="text-align: right;"> |
| | | <!-- <el-button type="primary" @click="openForm('add')">æ°å¢</el-button>--> |
| | | <el-button type="primary" @click="openOrderForm">å¤çå</el-button> |
| | | <el-button @click="handleOut">导åº</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | <div class="table_list"> |
| | | <PIMTable |
| | | rowKey="id" |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :page="page" |
| | | :isSelection="true" |
| | | @selection-change="handleSelectionChange" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination" |
| | | :total="page.total" |
| | | ></PIMTable> |
| | | <el-button type="primary" @click="handleAdd">æ°å¢å¤çå</el-button> |
| | | <el-button type="danger" plain :disabled="!selectedRows.length" @click="handleDelete">å é¤</el-button> |
| | | </div> |
| | | <FormDia ref="formDia" @close="handleQuery"></FormDia> |
| | | <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia> |
| | | <OrderFormDia ref="orderFormDia" @close="handleQuery"></OrderFormDia> |
| | | <div class="table_list"> |
| | | <PIMTable rowKey="id" :column="tableColumn" :tableData="tableData" :page="page" |
| | | :isSelection="true" @selection-change="handleSelectionChange" |
| | | :tableLoading="tableLoading" @pagination="pagination" :total="page.total" /> |
| | | </div> |
| | | <OrderFormDia ref="orderFormDia" @close="handleQuery" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import {onMounted, ref, reactive, toRefs, nextTick, getCurrentInstance} from "vue"; |
| | | import FormDia from "@/views/qualityManagement/nonconformingManagement/components/formDia.vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import {qualityUnqualifiedDel, qualityUnqualifiedListPage} from "@/api/qualityManagement/nonconformingManagement.js"; |
| | | import InspectionFormDia from "@/views/qualityManagement/nonconformingManagement/components/inspectionFormDia.vue"; |
| | | import { onMounted, ref, reactive, nextTick, getCurrentInstance } from "vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { |
| | | qualityUnqualifiedOrderListPage, |
| | | deleteQualityUnqualifiedOrder, |
| | | } from "@/api/qualityManagement/nonconformingManagement.js"; |
| | | import OrderFormDia from "@/views/qualityManagement/nonconformingManagement/components/orderFormDia.vue"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | inspectType: "", |
| | | inspectState: "", |
| | | productName: "", |
| | | entryDate: undefined, // å½å
¥æ¥æ |
| | | entryDateStart: undefined, |
| | | entryDateEnd: undefined, |
| | | }, |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const disposalMethodMap = { 1: "è®©æ¥æ¥æ¶", 2: "åå
ç»´ä¿®", 3: "è¿åç»´ä¿®", 4: "æ¢è´§", 5: "éè´§", 6: "æ¥åº" }; |
| | | const statusMap = { 0: "è稿", 1: "å¾
审æ¹", 2: "审æ¹ä¸", 3: "已宿", 4: "已驳å" }; |
| | | |
| | | const queryParams = reactive({ |
| | | orderNo: "", |
| | | projectName: "", |
| | | status: null, |
| | | entryDateStart: undefined, |
| | | entryDateEnd: undefined, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "ç¶æ", |
| | | prop: "inspectState", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (params == 0) { |
| | | return "å¾
å¤ç"; |
| | | } else if (params == 1) { |
| | | return "å·²å¤ç"; |
| | | } else { |
| | | return null; |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 'ä¸åæ ¼') { |
| | | return "danger"; |
| | | } else if (params == 'åæ ¼') { |
| | | return "success"; |
| | | } else { |
| | | return 'danger'; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "æ£æµæ¥æ", |
| | | prop: "checkTime", |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "ç±»å«", |
| | | prop: "inspectType", |
| | | dataType: "tag", |
| | | width: 120, |
| | | formatData: (params) => { |
| | | if (params == 0) { |
| | | return "åæææ£éª"; |
| | | } else if (params == 1) { |
| | | return "è¿ç¨æ£éª"; |
| | | } else { |
| | | return 'åºåæ£éª'; |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 'ä¸åæ ¼') { |
| | | return "info"; |
| | | } else if (params == 'åæ ¼') { |
| | | return "success"; |
| | | } else { |
| | | return 'primary'; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "æ£éªå", |
| | | prop: "checkName", |
| | | }, |
| | | { |
| | | label: "产ååç§°", |
| | | prop: "productName", |
| | | }, |
| | | { |
| | | label: "è§æ ¼åå·", |
| | | prop: "model", |
| | | }, |
| | | { |
| | | label: "åä½", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "æ°é", |
| | | prop: "quantity", |
| | | width: 100 |
| | | }, |
| | | { |
| | | label: "ä¸åæ ¼ç°è±¡", |
| | | prop: "defectivePhenomena", |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "å¤çç»æ", |
| | | prop: "dealResult", |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "å¤ç人", |
| | | prop: "dealName", |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "å¤çæ¥æ", |
| | | prop: "dealTime", |
| | | width: 120 |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 100, |
| | | operation: [ |
| | | { |
| | | name: "å¤ç", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openInspectionForm("edit", row); |
| | | }, |
| | | disabled: (row) => row.inspectState === 1, |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | | |
| | | const dateRange = ref(undefined); |
| | | const tableData = ref([]); |
| | | const selectedRows = ref([]); |
| | | const tableLoading = ref(false); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | total: 0 |
| | | total: 0, |
| | | }); |
| | | const formDia = ref() |
| | | const inspectionFormDia = ref() |
| | | const orderFormDia = ref() |
| | | const { proxy } = getCurrentInstance() |
| | | const orderFormDia = ref(); |
| | | |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "å¤çåç¼å·", |
| | | prop: "orderNo", |
| | | width: 160, |
| | | }, |
| | | { |
| | | label: "项ç®åç§°", |
| | | prop: "projectName", |
| | | }, |
| | | { |
| | | label: "åå·è§æ ¼", |
| | | prop: "specificationModel", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "ä¸åæ ¼æ°é", |
| | | prop: "unqualifiedQuantity", |
| | | width: 100, |
| | | }, |
| | | { |
| | | label: "å¤ç½®æ¹å¼", |
| | | prop: "disposalMethod", |
| | | width: 110, |
| | | dataType: "tag", |
| | | formatData: (val) => disposalMethodMap[val] || "", |
| | | }, |
| | | // { |
| | | // label: "ç¶æ", |
| | | // prop: "status", |
| | | // width: 80, |
| | | // dataType: "tag", |
| | | // formatData: (val) => statusMap[val] || "", |
| | | // formatType: (val) => { |
| | | // const map = { 0: "info", 1: "warning", 2: "", 3: "success", 4: "danger" }; |
| | | // return map[val] || "info"; |
| | | // }, |
| | | // }, |
| | | { |
| | | label: "æ£éªå", |
| | | prop: "inspectorName", |
| | | width: 100, |
| | | }, |
| | | { |
| | | label: "æ£éªæ¥æ", |
| | | prop: "inspectDate", |
| | | width: 110, |
| | | }, |
| | | { |
| | | label: "å建æ¶é´", |
| | | prop: "createTime", |
| | | width: 160, |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 160, |
| | | operation: [ |
| | | { |
| | | name: "导åº", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | handleExport(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "å¤ç½®", |
| | | type: "text", |
| | | showHide: (row) => row.status === 0, |
| | | clickFun: (row) => { |
| | | nextTick(() => { |
| | | orderFormDia.value?.openDialog("dispose", row); |
| | | }); |
| | | }, |
| | | }, |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | nextTick(() => { |
| | | orderFormDia.value?.openDialog("edit", row); |
| | | }); |
| | | }, |
| | | }, |
| | | { |
| | | name: "详æ
", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | nextTick(() => { |
| | | orderFormDia.value?.openDialog("view", row); |
| | | }); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | | |
| | | const changeDaterange = (value) => { |
| | | searchForm.value.entryDateStart = undefined; |
| | | searchForm.value.entryDateEnd = undefined; |
| | | queryParams.entryDateStart = undefined; |
| | | queryParams.entryDateEnd = undefined; |
| | | if (value) { |
| | | searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); |
| | | searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD"); |
| | | queryParams.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); |
| | | queryParams.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD"); |
| | | } |
| | | getList(); |
| | | }; |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | const resetQuery = () => { |
| | | queryParams.orderNo = ""; |
| | | queryParams.projectName = ""; |
| | | queryParams.status = null; |
| | | dateRange.value = undefined; |
| | | queryParams.entryDateStart = undefined; |
| | | queryParams.entryDateEnd = undefined; |
| | | handleQuery(); |
| | | }; |
| | | |
| | | const pagination = (obj) => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | | }; |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const params = { ...searchForm.value, ...page }; |
| | | params.entryDate = undefined |
| | | qualityUnqualifiedListPage(params).then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records |
| | | page.total = res.data.total; |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | const params = { ...queryParams, page: page.current, size: page.size }; |
| | | qualityUnqualifiedOrderListPage(params) |
| | | .then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data?.records || []; |
| | | page.total = res.data?.total || 0; |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | |
| | | const handleSelectionChange = (selection) => { |
| | | selectedRows.value = selection; |
| | | }; |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openForm = (type, row) => { |
| | | if (type !== 'add' && row?.inspectState === 1) { |
| | | proxy.$modal.msgWarning("å·²å¤ççæ°æ®ä¸è½åç¼è¾"); |
| | | return; |
| | | } |
| | | nextTick(() => { |
| | | formDia.value?.openDialog(type, row) |
| | | }) |
| | | }; |
| | | // æå¼å¤çå¼¹æ¡ |
| | | const openInspectionForm = (type, row) => { |
| | | if (row?.inspectState === 1) { |
| | | proxy.$modal.msgWarning("å·²å¤ççæ°æ®ä¸è½åå¤ç"); |
| | | return; |
| | | } |
| | | nextTick(() => { |
| | | inspectionFormDia.value?.openDialog(type, row) |
| | | }) |
| | | }; |
| | | |
| | | // æå¼å¤çåå¼¹æ¡ |
| | | const openOrderForm = () => { |
| | | const handleAdd = () => { |
| | | nextTick(() => { |
| | | orderFormDia.value?.openDialog("add", null); |
| | | }); |
| | | }; |
| | | |
| | | // å é¤ |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map((item) => item.id); |
| | | } else { |
| | | if (selectedRows.value.length === 0) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ°æ®"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å é¤ï¼æ¯å¦ç¡®è®¤å é¤ï¼", "导åº", { |
| | | const ids = selectedRows.value.map((item) => item.id); |
| | | ElMessageBox.confirm("éä¸çå¤çåå°è¢«å é¤ï¼æ¯å¦ç¡®è®¤ï¼", "æç¤º", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | qualityUnqualifiedDel(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | .then(() => { |
| | | deleteQualityUnqualifiedOrder(ids).then(() => { |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | // å¯¼åº |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("éä¸çå
容å°è¢«å¯¼åºï¼æ¯å¦ç¡®è®¤å¯¼åºï¼", "导åº", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/quality/qualityUnqualified/export", {}, "ä¸åæ ¼ç®¡ç.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | |
| | | const handleExport = (row) => { |
| | | proxy.$download.zip( |
| | | `/qualityUnqualifiedOrder/export/${row.id}`, |
| | | `ä¸åæ ¼åå¤çå_${row.orderNo || row.id}.xlsx` |
| | | ); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | |
| | | </div> |
| | | <div class="stat-content"> |
| | | <div class="stat-value">Â¥{{ indicatorKpis.salesAmount.toLocaleString() }}</div> |
| | | <div class="stat-label">éå®é¢</div> |
| | | <div class="stat-label">ååéé¢</div> |
| | | </div> |
| | | <div class="stat-bg-decoration"></div> |
| | | </div> |
| | |
| | | const option = { |
| | | title: { text: 'å¤ç»´åº¦é宿æ è¶å¿', left: 'center' }, |
| | | tooltip: { trigger: 'axis' }, |
| | | legend: { data: ['è®¢åæ°', 'éå®é¢'], top: 30 }, |
| | | legend: { data: ['è®¢åæ°', 'ååéé¢'], top: 30 }, |
| | | grid: { left: '3%', right: '8%', bottom: '3%', containLabel: true }, |
| | | xAxis: { |
| | | type: 'category', |
| | |
| | | itemStyle: { color: '#409eff' } |
| | | }, |
| | | { |
| | | name: 'éå®é¢', |
| | | name: 'ååéé¢', |
| | | type: 'bar', |
| | | yAxisIndex: 0, |
| | | data: chartData.salesAmountList || [], |
| | |
| | | const option = { |
| | | title: { text: 'å¤ç»´åº¦é宿æ è¶å¿', left: 'center' }, |
| | | tooltip: { trigger: 'axis' }, |
| | | legend: { data: ['è®¢åæ°', 'éå®é¢'], top: 30 }, |
| | | legend: { data: ['è®¢åæ°', 'ååéé¢'], top: 30 }, |
| | | grid: { left: '3%', right: '8%', bottom: '3%', containLabel: true }, |
| | | xAxis: { type: 'category', data: [] }, |
| | | yAxis: [ |
| | |
| | | ], |
| | | series: [ |
| | | { name: 'è®¢åæ°', type: 'line', yAxisIndex: 1, data: [], itemStyle: { color: '#409eff' } }, |
| | | { name: 'éå®é¢', type: 'bar', yAxisIndex: 0, data: [], itemStyle: { color: '#67c23a' } } |
| | | { name: 'ååéé¢', type: 'bar', yAxisIndex: 0, data: [], itemStyle: { color: '#67c23a' } } |
| | | ] |
| | | } |
| | | indicatorChart.setOption(option) |