| | |
| | | width="60" /> |
| | | <el-table-column label="产品大类" |
| | | prop="productCategory" /> |
| | | <el-table-column label="规格型号" |
| | | <el-table-column label="图纸编号" |
| | | prop="specificationModel" /> |
| | | <el-table-column label="单位" |
| | | prop="unit" /> |
| | |
| | | width="60" /> |
| | | <el-table-column label="产品大类" |
| | | prop="productCategory" /> |
| | | <el-table-column label="规格型号" |
| | | <el-table-column label="图纸编号" |
| | | prop="specificationModel" /> |
| | | <el-table-column label="单位" |
| | | prop="unit" |
| | |
| | | ref="productFormRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="产品大类:" |
| | | prop="productId"> |
| | | <el-tree-select v-model="productForm.productId" |
| | | placeholder="请选择" |
| | | clearable |
| | | check-strictly |
| | | @change="getModels" |
| | | :data="productOptions" |
| | | :render-after-expand="false" |
| | | style="width: 100%" /> |
| | | <el-form-item label="产品选择:" |
| | | prop="productSelect"> |
| | | <div style="display: flex; gap: 10px;"> |
| | | <el-input |
| | | v-model="productForm.productCategory" |
| | | placeholder="请选择产品" |
| | | disabled |
| | | style="flex: 1;" |
| | | /> |
| | | <el-button type="primary" @click="openProductSelectDialog">选择</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="规格型号:" |
| | | prop="productModelId"> |
| | | <el-select v-model="productForm.productModelId" |
| | | placeholder="请选择" |
| | | clearable |
| | | @change="getProductModel"> |
| | | <el-option v-for="item in modelOptions" |
| | | :key="item.id" |
| | | :label="item.model" |
| | | :value="item.id" /> |
| | | </el-select> |
| | | <el-form-item label="图纸编号:" |
| | | prop="specificationModel"> |
| | | <el-input v-model="productForm.specificationModel" placeholder="请输入图纸编号" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | v-model="fileListDialogVisible" |
| | | title="附件列表" |
| | | /> |
| | | |
| | | <!-- 产品选择对话框 --> |
| | | <ProductSelectDialog |
| | | v-model="productSelectVisible" |
| | | :single="true" |
| | | @confirm="handleProductSelect" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getToken } from "@/utils/auth"; |
| | | import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue"; |
| | | import pagination from "@/components/PIMTable/Pagination.vue"; |
| | | import { |
| | | ref, |
| | |
| | | const productOperationType = ref(""); |
| | | const productOperationIndex = ref(""); |
| | | const currentId = ref(""); |
| | | const productSelectVisible = ref(false); |
| | | const productFormData = reactive({ |
| | | productForm: { |
| | | productId: "", |
| | |
| | | return Promise.resolve([]); |
| | | } |
| | | }; |
| | | |
| | | const getProductModel = value => { |
| | | const index = modelOptions.value.findIndex(item => item.id === value); |
| | | if (index !== -1) { |
| | |
| | | delProduct(ids).then(res => { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | closeProductDia(); |
| | | getSalesLedgerWithProducts({ id: currentId.value, type: 2 }).then( |
| | | getPurchaseById({ id: currentId.value, type: 2 }).then( |
| | | res => { |
| | | productData.value = res.productData; |
| | | } |
| | |
| | | proxy.resetForm("productFormRef"); |
| | | productFormVisible.value = false; |
| | | }; |
| | | |
| | | // 打开产品选择对话框 |
| | | const openProductSelectDialog = () => { |
| | | productSelectVisible.value = true; |
| | | }; |
| | | |
| | | // 处理产品选择 |
| | | const handleProductSelect = (selectedProducts) => { |
| | | if (selectedProducts && selectedProducts.length > 0) { |
| | | const product = selectedProducts[0]; |
| | | productForm.value.productCategory = product.productName; |
| | | productForm.value.specificationModel = product.model; |
| | | productForm.value.unit = product.unit; |
| | | } |
| | | }; |
| | | |
| | | // 导出 |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | // 检查是否有他人维护的数据 |
| | | const unauthorizedData = selectedRows.value.filter( |
| | | item => item.recorderName !== userStore.nickName |
| | | ); |
| | | if (unauthorizedData.length > 0) { |
| | | proxy.$modal.msgWarning("不可删除他人维护的数据"); |
| | | return; |
| | | } |
| | | ids = selectedRows.value.map(item => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("请选择数据"); |