| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <FormDialog |
| | | v-model="visible" |
| | | :title="type === 'add' ? 'ç»å®å·¥èºè·¯çº¿' : 'ç¼è¾å·¥èºè·¯çº¿'" |
| | | width="1400px" |
| | | :operation-type="type" |
| | | :column="8" |
| | | @close="handleClose" |
| | | @confirm="handleConfirm" |
| | | @cancel="handleClose" |
| | | > |
| | | <!-- ================= åºæ¬ä¿¡æ¯ ================= --> |
| | | <el-descriptions :column="3"> |
| | | <el-descriptions-item label="ç¼å·" align="center" v-if="formData.productOrderList"> |
| | | {{ formData.productOrderList.salesContractNo || "ææ æ°æ®" }} |
| | | </el-descriptions-item> |
| | | |
| | | <el-descriptions-item label="å¶åæ¥æ" align="center" v-if="formData.productOrderList"> |
| | | {{ formData.productOrderList.entryDate || "ææ æ°æ®" }} |
| | | </el-descriptions-item> |
| | | |
| | | <el-descriptions-item label="äº¤ä»æ¥æ" align="center" v-if="formData.productOrderList"> |
| | | {{ formData.productOrderList.deliveryDate || "ææ æ°æ®" }} |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | |
| | | <el-descriptions border :column="4"> |
| | | <el-descriptions-item label="å§æåä½" :span="2" align="center"> |
| | | {{formData.clientName || "--"}} |
| | | </el-descriptions-item> |
| | | |
| | | <el-descriptions-item label="æ°é" :span="1" align="center"> |
| | | {{formData.orderQty || "--"}} |
| | | </el-descriptions-item> |
| | | |
| | | <el-descriptions-item label="æå尺寸" :span="1" align="center"> |
| | | {{formData.specificationModel || "--"}} |
| | | </el-descriptions-item> |
| | | |
| | | <el-descriptions-item label="产ååç§°" :span="2" align="center"> |
| | | {{formData.productName || "--"}} |
| | | </el-descriptions-item> |
| | | |
| | | <el-descriptions-item label="åæ®ç±»å" :span="2" align="center"> |
| | | <el-checkbox-group v-model="introductionLetterList"> |
| | | <el-checkbox label="ä»ç»ä¿¡" value="ä»ç»ä¿¡" /> |
| | | <el-checkbox label="åæ æ³¨å书" value="åæ æ³¨å书" /> |
| | | <el-checkbox label="å§å°å" value="å§å°å" /> |
| | | </el-checkbox-group> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | |
| | | <!-- ================= ææè¡¨ ================= --> |
| | | <div class="process-table-header"> |
| | | <div class="section-title">ææä¿¡æ¯</div> |
| | | <el-button type="primary" size="small" @click="addMaterialRow">æ°å¢ä¸è¡</el-button> |
| | | </div> |
| | | <el-table border :data="formData.materialInfo" style="width: 100%"> |
| | | <el-table-column label="ææåç§°"> |
| | | <template #default="{ row }"> |
| | | <el-tree-select |
| | | v-model="row.productId" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | | check-strictly |
| | | @change="(val) => getModels(val, row)" |
| | | :data="productOptions" |
| | | :render-after-expand="false" |
| | | style="width: 100%" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="è§æ ¼"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="row.productModelId" |
| | | placeholder="è¯·éæ©è§æ ¼" |
| | | filterable |
| | | clearable |
| | | @change="(val) => handleMaterialModelChange(val, row)" |
| | | > |
| | | <el-option |
| | | v-for="item in row.modelOptions || []" |
| | | :key="item.id" |
| | | :label="item.model" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ°é"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.num" placeholder="æ°é"> |
| | | <template #append>{{ row.numSuffix }}</template> |
| | | </el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="计éåä½"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.unit" placeholder="计éåä½" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åä»·"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.price" placeholder="åä»·"> |
| | | <template #append>{{ row.unitSuffix }}</template> |
| | | </el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="éé¢"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.totalAmount" placeholder="éé¢" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="80"> |
| | | <template #default="{ $index }"> |
| | | <el-button type="danger" size="small" @click="removeMaterialRow($index)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-descriptions border :column="2" :span="2"> |
| | | <el-descriptions-item |
| | | label="注æäºé¡¹" |
| | | :span="2" |
| | | align="center" |
| | | style="white-space: pre-line; word-break: break-all; min-height: 60px;" |
| | | > |
| | | <el-input |
| | | v-model="formData.productDescription" |
| | | :autosize="{ minRows: 2, maxRows: 4 }" |
| | | type="textarea" |
| | | placeholder="请è¾å
¥æ³¨æäºé¡¹" |
| | | /> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <hr> |
| | | <!-- ================= åæå¾ç¤º ================= --> |
| | | <div class="section-title">åæå¾ç¤º</div> |
| | | <ActionFileUpload |
| | | style="width: 50%;" |
| | | v-model:file-list="fileList" |
| | | :action="upload.url" |
| | | :headers="upload.headers" |
| | | :multiple="false" |
| | | :name="'files'" |
| | | :onSuccess="uploadSuccess" |
| | | tip-text="æ¯æå¾çï¼jpg, jpeg, pngï¼æ ¼å¼" |
| | | /> |
| | | <!-- ================= åæä¿¡æ¯ ================= --> |
| | | <el-descriptions |
| | | border |
| | | :column="6" |
| | | direction="vertical" |
| | | style="width: 100%" |
| | | class="fixed-desc" |
| | | > |
| | | <el-descriptions-item label="åæå°ºå¯¸" align="center"> |
| | | <el-input v-model="formData.cutNum" placeholder="åæå°ºå¯¸" /> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="åææ°é" align="center"> |
| | | <el-input v-model="formData.cutSize" placeholder="åæå°ºå¯¸" /> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="ä¸çæ°é" align="center"> |
| | | <el-input v-model="formData.mediumBoxQty" placeholder="ä¸çæ°é" /> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="å°çæ°é" align="center"> |
| | | <el-input v-model="formData.smallBoxQty" placeholder="å°çæ°é" /> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="æ£æ°" align="center"> |
| | | <el-input v-model="formData.positiveQty" placeholder="æ£æ°" /> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="å æ¾æ°" align="center"> |
| | | <el-input v-model="formData.allowanceQty" placeholder="å æ¾æ°" /> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | |
| | | <div class="middle-sheet-table"> |
| | | <table class="middle-sheet-table__inner"> |
| | | <tbody> |
| | | <tr> |
| | | <th>软çç:</th> |
| | | <th colspan="2">å¼å¼ è²</th> |
| | | <th>ææ¿</th> |
| | | <th colspan="2">弿¼</th> |
| | | <th>å«åç</th> |
| | | <th>èè²å</th> |
| | | </tr> |
| | | <tr> |
| | | <th rowspan="2">å¶ç</th> |
| | | <th>设计å¶ä½è´¹</th> |
| | | <th>æ¼çè´¹</th> |
| | | <th>åºçè´¹</th> |
| | | <th>ææ ·è´¹</th> |
| | | <th>å«åçè´¹</th> |
| | | <th>ç«/å¸çè´¹</th> |
| | | <th>å°è®¡</th> |
| | | </tr> |
| | | <tr v-for="(plate, index) in formData.plateMaking" :key="index"> |
| | | <td> |
| | | <el-input v-model="plate.designProductionFee" placeholder="请è¾å
¥è®¾è®¡å¶ä½è´¹" /> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="plate.impositionFee" placeholder="请è¾å
¥æ¼çè´¹" /> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="plate.filmOutputFee" placeholder="请è¾å
¥åºçè´¹" /> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="plate.proofingFee" placeholder="请è¾å
¥ææ ·è´¹" /> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="plate.doctorBladePlateFee" placeholder="请è¾å
¥å«åçè´¹" /> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="plate.hotEmbossingPlateFee" placeholder="请è¾å
¥ç«/å¸çè´¹" /> |
| | | </td> |
| | | <td> |
| | | <el-input v-model="plate.subtotalFee" placeholder="请è¾å
¥å°è®¡" /> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | <!-- class="section-title" --> |
| | | <!-- ================= å·¥èºå å·¥ ================= --> |
| | | <div class="process-table-header"> |
| | | <div class="section-title">å·¥èºå å·¥</div> |
| | | <el-button type="primary" size="small" @click="addProcessRow">æ°å¢ä¸è¡</el-button> |
| | | </div> |
| | | <el-table border :data="formData.processContent" style="width: 100%" :span-method="objectSpanMethod"> |
| | | <el-table-column label="å·¥åº" width="140"> |
| | | <template #default="{ row }"> |
| | | <el-table-column label="å·¥åº" width="140"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="row.processId" |
| | | placeholder="è¯·éæ©å·¥åº" |
| | | @change="(val) => onProcessChange(val, row)" |
| | | > |
| | | <el-option |
| | | v-for="item in processOptions" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="弿°"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.openCount" placeholder="请è¾å
¥å¼æ°" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å·¥èºæ£æ°"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.processPositive" placeholder="请è¾å
¥å·¥èºæ£æ°" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å æ¾æ°"> |
| | | <template #default="{ row }"> |
| | | <el-input v-model="row.allowanceQty" placeholder="请è¾å
¥å æ¾æ°" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æºå°" width="180"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="row.deviceId" |
| | | placeholder="è¯·éæ©æºå°" |
| | | filterable |
| | | clearable |
| | | @change="(val) => handleDeviceChange(val, row)" |
| | | > |
| | | <el-option |
| | | v-for="item in deviceOptions" |
| | | :key="item.id" |
| | | :label="item.deviceName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æ¥å·¥äºº" width="220"> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-model="row.reportUserIds" |
| | | placeholder="è¯·éæ©æ¥å·¥äºº" |
| | | filterable |
| | | clearable |
| | | multiple |
| | | collapse-tags |
| | | collapse-tags-tooltip |
| | | @change="(val) => handleReportUsersChange(val, row)" |
| | | > |
| | | <el-option |
| | | v-for="item in userOptions" |
| | | :key="item.userId" |
| | | :label="item.nickName" |
| | | :value="item.userId" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å·¥èºè¦æ±"> |
| | | <template #default="{ rowIndex }"> |
| | | <el-input |
| | | v-model="formData.processRequirement" |
| | | type="textarea" |
| | | :rows="6" |
| | | placeholder="请è¾å
¥å·¥èºè¦æ±" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="80"> |
| | | <template #default="{ $index }"> |
| | | <el-button type="danger" size="small" @click="removeProcessRow($index)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <!-- ================= å
è£
ä¿¡æ¯ ================= --> |
| | | <el-descriptions border :column="3" class="mt"> |
| | | <el-descriptions-item label="éè´§å°ç¹" align="center"> |
| | | <el-input v-model="formData.deliveryAddress" placeholder="éè´§å°ç¹" /> |
| | | </el-descriptions-item> |
| | | |
| | | <el-descriptions-item label="è系人" align="center"> |
| | | <el-input v-model="formData.contactName" placeholder="è系人" /> |
| | | </el-descriptions-item> |
| | | |
| | | <el-descriptions-item label="å
è£
è¦æ±" align="center"> |
| | | <el-input v-model="formData.packagingRequirement" placeholder="å
è£
è¦æ±" /> |
| | | </el-descriptions-item> |
| | | |
| | | <el-descriptions-item label="尺寸" align="center"> |
| | | <el-input v-model="formData.postProcessSize" placeholder="尺寸" /> |
| | | </el-descriptions-item> |
| | | |
| | | <el-descriptions-item label="å®è´§æ°é" align="center"> |
| | | {{formData.orderQty || "--"}} |
| | | </el-descriptions-item> |
| | | |
| | | <el-descriptions-item label="å®äº¤æ°é" :span="3" align="center"> |
| | | <el-input v-model="formData.actualDeliveryQty" placeholder="å®äº¤æ°é" /> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </FormDialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, computed, onMounted, watch } from 'vue' |
| | | import dayjs from 'dayjs' |
| | | import FormDialog from '@/components/Dialog/FormDialog.vue' |
| | | import ActionFileUpload from "@/components/Upload/ActionFileUpload.vue"; |
| | | import { list } from "@/api/productionManagement/productionProcess.js" |
| | | import { modelList, productTreeList } from "@/api/basicData/product.js" |
| | | import {getSalesLedgerWithProducts} from "@/api/salesManagement/salesLedger.js" |
| | | import { getDeviceLedger } from "@/api/equipmentManagement/ledger.js" |
| | | import { userListNoPageByTenantId } from "@/api/system/user.js" |
| | | import { getToken } from "@/utils/auth"; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | type: { |
| | | type: String, |
| | | default: 'add' |
| | | }, |
| | | orderData: { |
| | | type: Object, |
| | | default: () => ({}) |
| | | }, |
| | | rowData: { |
| | | type: Object, |
| | | default: null |
| | | } |
| | | }) |
| | | |
| | | const emit = defineEmits(['update:modelValue', 'confirm']) |
| | | |
| | | const visible = computed({ |
| | | get: () => props.modelValue, |
| | | set: (val) => emit('update:modelValue', val) |
| | | }) |
| | | |
| | | const processOptions = ref([]) |
| | | const deviceOptions = ref([]) |
| | | const userOptions = ref([]) |
| | | const reportWorkerList = ref([]) |
| | | const productOptions = ref([]) |
| | | const introductionLetterList = ref([]) |
| | | const fileList = ref([]) |
| | | const upload = reactive({ |
| | | url: import.meta.env.VITE_APP_BASE_API + '/basic/customer-follow/upload', |
| | | headers: { Authorization: 'Bearer ' + getToken() } |
| | | }) |
| | | |
| | | const formData = reactive({ |
| | | productOrderList:null, |
| | | salesLedgerId: null, |
| | | productOrderId: null, |
| | | printOrderTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), |
| | | fileList:[], |
| | | finishTime: "", |
| | | no: "", |
| | | productName: "", |
| | | productDescription: "", |
| | | clientName: "", |
| | | finishedSize: "", |
| | | cutNum: "", |
| | | cutSize:"", |
| | | mediumBoxQty: "", |
| | | smallBoxQty: "", |
| | | positiveQty: "", |
| | | allowanceQty: "", |
| | | introductionLetter: "", |
| | | plateMaking: [ |
| | | { |
| | | designProductionFee: "", |
| | | impositionFee: "", |
| | | filmOutputFee: "", |
| | | proofingFee: "", |
| | | doctorBladePlateFee: "", |
| | | hotEmbossingPlateFee: "", |
| | | subtotalFee: "" |
| | | } |
| | | ], |
| | | processContent: [ |
| | | { |
| | | id: "1", |
| | | processId: "", |
| | | processName: "", |
| | | mediumBoxQty: "", |
| | | smallBoxQty: "", |
| | | openCount: "", |
| | | processPositive: "", |
| | | allowanceQty: "", |
| | | deviceId: "", |
| | | deviceName: "", |
| | | reportUserIds: [], |
| | | reportWorkerList: [] |
| | | } |
| | | ], |
| | | materialInfo: [ |
| | | { |
| | | id: "1", |
| | | productId: "", |
| | | name: "", |
| | | productModelId: "", |
| | | model: "", |
| | | modelOptions: [], |
| | | num: "", |
| | | numSuffix: "å¼ ", |
| | | unitSuffix: "å
/kg", |
| | | unit: "", |
| | | price: "", |
| | | totalAmount: "" |
| | | } |
| | | ], |
| | | processRequirement: "", |
| | | deliveryAddress: "", |
| | | contactName: "", |
| | | packagingRequirement: "", |
| | | postProcessSize: "", |
| | | orderQty: "", |
| | | actualDeliveryQty: "", |
| | | productionDept: "", |
| | | technicalDept: "", |
| | | warehouseDept: "", |
| | | productModelId: "", |
| | | specificationModel:"", |
| | | }) |
| | | |
| | | // çå¬ checkbox group ååå¹¶åæ¥å° introductionLetter å符串 |
| | | watch(introductionLetterList, (val) => { |
| | | formData.introductionLetter = val.join(',') |
| | | }) |
| | | const onProcessChange = (processId, row) => { |
| | | const selected = processOptions.find(item => item.id === processId) |
| | | row.processName = selected?.name || '' |
| | | } |
| | | const cloneDeep = (val) => JSON.parse(JSON.stringify(val)) |
| | | |
| | | const uploadSuccess = (...args) => { |
| | | console.log(...args) |
| | | } |
| | | |
| | | const mergeRowDataToForm = (source) => { |
| | | if (!source || typeof source !== 'object') { |
| | | return |
| | | } |
| | | |
| | | Object.keys(formData).forEach((key) => { |
| | | if (source[key] !== undefined) { |
| | | formData[key] = Array.isArray(source[key]) ? cloneDeep(source[key]) : source[key] |
| | | } |
| | | }) |
| | | |
| | | // å
¼å®¹ index.vue é常ç¨å段åä¸å¼¹çªå段åä¸ä¸è´çæ
åµ |
| | | if (source.productName === undefined && source.productCategory !== undefined) { |
| | | formData.productName = source.productCategory |
| | | } |
| | | if (source.orderQty === undefined && source.quantity !== undefined) { |
| | | formData.orderQty = source.quantity |
| | | } |
| | | if (source.no === undefined && source.salesContractNo !== undefined) { |
| | | formData.no = source.salesContractNo |
| | | } |
| | | if (source.clientName === undefined && source.customerName !== undefined) { |
| | | formData.clientName = source.customerName |
| | | } |
| | | if (source.productOrderId === undefined && source.id !== undefined) { |
| | | formData.productOrderId = source.id |
| | | } |
| | | } |
| | | |
| | | // è·åéå®è®¢å |
| | | const getProductOrder = () => { |
| | | if(!formData.salesLedgerId) return |
| | | getSalesLedgerWithProducts({ |
| | | type: "1", |
| | | id: formData.salesLedgerId |
| | | }).then(res => { |
| | | if(res){ |
| | | formData.productOrderList = res |
| | | } |
| | | console.log(formData) |
| | | }) |
| | | |
| | | } |
| | | |
| | | watch(() => props.orderData, (val) => { |
| | | mergeRowDataToForm(val) |
| | | }, { immediate: true, deep: true }) |
| | | |
| | | watch( |
| | | () => props.rowData, |
| | | (val) => { |
| | | mergeRowDataToForm(val) |
| | | getProductOrder() |
| | | }, |
| | | { immediate: true, deep: true } |
| | | ) |
| | | |
| | | const getProcessList = () => { |
| | | list().then(res => { |
| | | processOptions.value = res.data |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | const getDeviceList = () => { |
| | | getDeviceLedger().then(res => { |
| | | deviceOptions.value = Array.isArray(res?.data) ? res.data : [] |
| | | }) |
| | | } |
| | | |
| | | const getUserList = () => { |
| | | userListNoPageByTenantId().then(res => { |
| | | userOptions.value = Array.isArray(res?.data) ? res.data : [] |
| | | }) |
| | | } |
| | | |
| | | const convertProductOptions = (data) => { |
| | | return data.map(item => ({ |
| | | label: item.label || item.productName || item.name || "", |
| | | value: item.id, |
| | | children: item.children?.length ? convertProductOptions(item.children) : undefined |
| | | })) |
| | | } |
| | | |
| | | const findProductLabelById = (options, productId) => { |
| | | for (const item of options) { |
| | | if (item.value === productId) { |
| | | return item.label |
| | | } |
| | | if (item.children?.length) { |
| | | const label = findProductLabelById(item.children, productId) |
| | | if (label) { |
| | | return label |
| | | } |
| | | } |
| | | } |
| | | return "" |
| | | } |
| | | |
| | | const getMaterialProductOptions = () => { |
| | | productTreeList().then(res => { |
| | | const rawData = Array.isArray(res?.data) ? res.data : Array.isArray(res) ? res : [] |
| | | productOptions.value = convertProductOptions(rawData) |
| | | }) |
| | | } |
| | | |
| | | const handleProcessChange = (val, row) => { |
| | | console.log(row) |
| | | const process = processOptions.value.find(item => item.id === val) |
| | | if (process) { |
| | | row.processName = process.name |
| | | console.log(process) |
| | | if (process.deviceId) { |
| | | row.deviceId = process.deviceId || "" |
| | | row.deviceName = process.deviceName || "" |
| | | } |
| | | } |
| | | } |
| | | |
| | | const handleDeviceChange = (val, row) => { |
| | | const device = deviceOptions.value.find(item => item.id === val) |
| | | row.deviceName = device?.deviceName || "" |
| | | row.deviceId = val || "" |
| | | } |
| | | |
| | | const handleReportUsersChange = (val, row) => { |
| | | const userMap = new Map( |
| | | userOptions.value.map(item => [item.userId, item.nickName]) |
| | | ) |
| | | row.reportWorkerList = (val || []).map(userId => ({ |
| | | userId, |
| | | userName: userMap.get(userId) || '' |
| | | })) |
| | | } |
| | | |
| | | const getModels = (val, row) => { |
| | | row.productId = val || "" |
| | | row.name = val ? findProductLabelById(productOptions.value, val) : "" |
| | | row.productModelId = "" |
| | | row.model = "" |
| | | row.unit = "" |
| | | row.modelOptions = [] |
| | | if (!val) { |
| | | return |
| | | } |
| | | modelList({ id: val }).then(res => { |
| | | row.modelOptions = Array.isArray(res) ? res : Array.isArray(res?.data) ? res.data : [] |
| | | }) |
| | | } |
| | | |
| | | const handleMaterialModelChange = (val, row) => { |
| | | const currentModel = (row.modelOptions || []).find(item => item.id === val) |
| | | row.productModelId = val || "" |
| | | row.model = currentModel?.model || "" |
| | | row.unit = currentModel?.unit || "" |
| | | } |
| | | |
| | | // ææä¿¡æ¯ |
| | | const addMaterialRow = () => { |
| | | formData.materialInfo.push({ |
| | | id: Date.now().toString(), |
| | | productId: "", |
| | | name: "", |
| | | productModelId: "", |
| | | model: "", |
| | | modelOptions: [], |
| | | num: "", |
| | | numSuffix: "å¼ ", |
| | | unitSuffix: "å
/kg", |
| | | unit: "", |
| | | price: "", |
| | | totalAmount: "" |
| | | }) |
| | | } |
| | | |
| | | const removeMaterialRow = (index) => { |
| | | formData.materialInfo.splice(index, 1) |
| | | } |
| | | |
| | | const addProcessRow = () => { |
| | | formData.processContent.push({ |
| | | id: Date.now().toString(), |
| | | processId: "", |
| | | processName: "", |
| | | openCount: "", |
| | | processPositive: "", |
| | | allowanceQty: "", |
| | | deviceId: "", |
| | | deviceName: "", |
| | | reportUserIds: [], |
| | | reportWorkerList: [] |
| | | }) |
| | | } |
| | | |
| | | const removeProcessRow = (index) => { |
| | | formData.processContent.splice(index, 1) |
| | | } |
| | | |
| | | const objectSpanMethod = ({ column, rowIndex }) => { |
| | | if (column.label === "å·¥èºè¦æ±") { |
| | | if (rowIndex === 0) { |
| | | return { |
| | | rowspan: Math.max(formData.processContent.length, 1), |
| | | colspan: 1, |
| | | } |
| | | } |
| | | return { |
| | | rowspan: 0, |
| | | colspan: 0, |
| | | } |
| | | } |
| | | } |
| | | |
| | | const handleClose = () => { |
| | | visible.value = false |
| | | } |
| | | |
| | | const handleConfirm = () => { |
| | | emit('confirm', JSON.parse(JSON.stringify(formData))) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getProcessList() |
| | | getDeviceList() |
| | | getUserList() |
| | | getMaterialProductOptions() |
| | | }) |
| | | defineExpose({ |
| | | getProductOrder |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .section-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | margin: 20px 0 10px; |
| | | padding-left: 10px; |
| | | border-left: 4px solid #409eff; |
| | | } |
| | | |
| | | .fixed-desc { |
| | | margin-top: 20px; |
| | | :deep(.el-descriptions__table) { |
| | | table-layout: fixed; |
| | | width: 100%; |
| | | } |
| | | :deep(.el-descriptions__cell) { |
| | | width: 25%; |
| | | word-break: break-word; |
| | | } |
| | | } |
| | | |
| | | .middle-sheet-table { |
| | | margin-top: 20px; |
| | | width: 100%; |
| | | border: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .middle-sheet-table__inner { |
| | | width: 100%; |
| | | border-collapse: collapse; |
| | | table-layout: fixed; |
| | | |
| | | th, td { |
| | | border: 1px solid #ebeef5; |
| | | padding: 8px; |
| | | text-align: center; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | th { |
| | | background-color: #f5f7fa; |
| | | color: #606266; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | :deep(.el-input__wrapper) { |
| | | box-shadow: none !important; |
| | | background-color: transparent; |
| | | } |
| | | } |
| | | |
| | | .process-table-header { |
| | | margin-top: 20px; |
| | | margin-bottom: 10px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | span { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | |
| | | .mt { |
| | | margin-top: 20px; |
| | | } |
| | | :deep(.el-textarea__inner){ |
| | | box-shadow: none; |
| | | } |
| | | </style> |