| | |
| | | <el-descriptions-item label="单据类型" :span="2" align="center"> |
| | | <el-checkbox-group v-model="introductionLetterList" :disabled="isDetail"> |
| | | <el-checkbox label="介绍信" value="介绍信" /> |
| | | <el-checkbox label="商标注册书" value="商标注册书" /> |
| | | <el-checkbox label="商标注册" value="商标注册" /> |
| | | <el-checkbox label="委印单" value="委印单" /> |
| | | <el-checkbox label="书号" value="书号" /> |
| | | </el-checkbox-group> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | |
| | | </div> |
| | | <el-table border :data="formData.materialInfo" style="width: 100%"> |
| | | <el-table-column label="材料名称"> |
| | | <template #default="{ row }" > |
| | | <template #default="{ row, $index }" > |
| | | <el-tree-select |
| | | v-if="!isDetail" |
| | | v-model="row.productById" |
| | | placeholder="请选择" |
| | | clearable |
| | | check-strictly |
| | | @change="(val) => getModels(val, row)" |
| | | @change="(val) => getModels(val, row, $index)" |
| | | :data="productOptions" |
| | | :render-after-expand="false" |
| | | :disabled="isDetail" |
| | |
| | | :disabled="isDetail" |
| | | > |
| | | <el-option |
| | | v-for="item in row.modelOptions || []" |
| | | v-for="item in row.modelOptions" |
| | | :key="item.id" |
| | | :label="item.model" |
| | | :value="item.id" |
| | |
| | | </el-table> |
| | | <el-descriptions border :column="2" :span="2"> |
| | | <el-descriptions-item |
| | | label="注意事项" |
| | | :span="2" |
| | | label="切料图示选择" |
| | | :span="1" |
| | | align="center" |
| | | style="white-space: pre-line; word-break: break-all; min-height: 60px;" |
| | | > |
| | | <el-radio-group v-model="formData.cuttingDiagramCheckout"> |
| | | <el-radio value="平张">平张</el-radio> |
| | | <el-radio value="卷筒">卷筒</el-radio> |
| | | </el-radio-group> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item |
| | | label="切料注意事项" |
| | | :span="1" |
| | | align="center" |
| | | style="white-space: pre-line; word-break: break-all; min-height: 60px;" |
| | | > |
| | |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <!-- ================= 切料图示 ================= --> |
| | | <div class="section-title" v-if="formData.cuttingFileVo.length > 0">切料图示</div> |
| | | <div class="section-title" v-if="type === 'add' || (type === 'detail' && formData.cuttingFileVo.length > 0)">切料图示</div> |
| | | <ActionFileUpload |
| | | v-if="formData.cuttingFileVo.length > 0" |
| | | v-if="type === 'add' || (type === 'detail' && formData.cuttingFileVo.length > 0)" |
| | | style="width: 50%;float: left;" |
| | | v-model:file-list="formData.cuttingFileVo" |
| | | :action="upload.url" |
| | |
| | | :onDownload="onDownload" |
| | | :onRemove="onRemove" |
| | | :onPreview="onPreview" |
| | | :onView="type === 'detail' ? false : true" |
| | | :onView="type!=='detail'" |
| | | :tip-text="type === 'detail' ? '' : '支持图片(jpg, jpeg, png)格式'" |
| | | /> |
| | | <el-image |
| | |
| | | <el-input v-model="formData.cutNum" placeholder="切料尺寸" :disabled="isDetail" /> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="切料数量" align="center"> |
| | | <el-input v-model="formData.cutSize" placeholder="切料尺寸" :disabled="isDetail" /> |
| | | <el-input v-model="formData.cutSize" placeholder="切料数量" :disabled="isDetail" /> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="中盒数量" align="center"> |
| | | <el-input v-model="formData.mediumBoxQty" placeholder="中盒数量" :disabled="isDetail" /> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, computed, onMounted, watch, getCurrentInstance } from 'vue' |
| | | import {computed, getCurrentInstance, onMounted, reactive, ref, 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 {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"; |
| | | import {getDeviceLedger} from "@/api/equipmentManagement/ledger.js" |
| | | import {userListNoPageByTenantId} from "@/api/system/user.js" |
| | | import {getToken} from "@/utils/auth"; |
| | | import filePreview from '@/components/filePreview/index.vue' |
| | | import { ElMessage } from "element-plus"; |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: { |
| | |
| | | headers: { Authorization: 'Bearer ' + getToken() } |
| | | }) |
| | | |
| | | const showCuttingFile = computed(() => { |
| | | return props.type === 'detail' && Array.isArray(formData.cuttingFileVo) && formData.cuttingFileVo.length > 0 |
| | | }) |
| | | |
| | | const filePreviewRef = ref() |
| | | const formData = reactive({ |
| | | productOrderList:null, |
| | |
| | | no: "", |
| | | productName: "", |
| | | productDescription: "", |
| | | cuttingDiagramCheckout:"", |
| | | clientName: "", |
| | | finishedSize: "", |
| | | cutNum: "", |
| | |
| | | ], |
| | | processContent: [ |
| | | { |
| | | id: "1", |
| | | processId: "", |
| | | processName: "", |
| | | mediumBoxQty: "", |
| | |
| | | ], |
| | | materialInfo: [ |
| | | { |
| | | id: "1", |
| | | productId: "", |
| | | name: "", |
| | | productModelId: "", |
| | |
| | | }) |
| | | |
| | | const getUploadFileUrl = (file) => { |
| | | console.log("file", file) |
| | | const response = file?.response |
| | | const data = response?.data |
| | | if (Array.isArray(data) && data.length) { |
| | |
| | | no: "", |
| | | productName: "", |
| | | productDescription: "", |
| | | cuttingDiagramCheckout:"平张", |
| | | clientName: "", |
| | | finishedSize: "", |
| | | cutNum: "", |
| | |
| | | ], |
| | | processContent: [ |
| | | { |
| | | id: "1", |
| | | processId: "", |
| | | processName: "", |
| | | mediumBoxQty: "", |
| | |
| | | ], |
| | | materialInfo: [ |
| | | { |
| | | id: "1", |
| | | productId: "", |
| | | name: "", |
| | | productModelId: "", |
| | |
| | | } |
| | | |
| | | const resolveFileUrl = (rawUrl) => { |
| | | console.log("rawUrl", rawUrl) |
| | | const u = String(rawUrl || "") |
| | | if (!u) return "" |
| | | if (/^(https?:)?\/\//i.test(u)) return u |
| | |
| | | |
| | | // 文件预览/下载 |
| | | const onDownload = (file) => { |
| | | console.log(file) |
| | | const url = resolveFileUrl(getUploadFileUrl(file)) |
| | | if (!url) return |
| | | proxy?.$modal?.loading?.("正在下载文件,请稍候...") |
| | |
| | | if(res){ |
| | | formData.productOrderList = res |
| | | } |
| | | console.log(formData) |
| | | }) |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | 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 getModels = (val, row) => { |
| | | const getModels = async (val, row, index) => { |
| | | const targetRow = formData.materialInfo[index] |
| | | row.productId = val || "" |
| | | row.productById = val || "" |
| | | row.productName = row.name || "" |
| | | row.name = val ? findProductLabelById(productOptions.value, val) : "" |
| | | |
| | | row.productModelId = "" |
| | | row.model = "" |
| | | row.unit = "" |
| | | row.modelOptions = [] |
| | | if (!val) { |
| | | return |
| | | |
| | | if (!val) return |
| | | |
| | | const res = await modelList({ id: val }) |
| | | formData.materialInfo[index] = { |
| | | ...targetRow, |
| | | modelOptions: Array.isArray(res) ? res : |
| | | Array.isArray(res?.data) ? res.data : |
| | | Array.isArray(res?.rows) ? res.rows : |
| | | Array.isArray(res?.data?.records) ? res.data.records : |
| | | [] |
| | | } |
| | | modelList({ id: val }).then(res => { |
| | | row.modelOptions = Array.isArray(res) ? res : Array.isArray(res?.data) ? res.data : [] |
| | | }) |
| | | // row.modelOptions = Array.isArray(res) ? res : |
| | | // Array.isArray(res?.data) ? res.data : |
| | | // Array.isArray(res?.rows) ? res.rows : |
| | | // Array.isArray(res?.data?.records) ? res.data.records : |
| | | // [] |
| | | |
| | | } |
| | | |
| | | const handleMaterialModelChange = (val, row) => { |
| | |
| | | |
| | | const addProcessRow = () => { |
| | | formData.processContent.push({ |
| | | id: Date.now().toString(), |
| | | processId: "", |
| | | processName: "", |
| | | openCount: "", |