| | |
| | | <el-form :model="productForm" label-width="140px" label-position="top" :rules="productRules" ref="productFormRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="产品大类:" prop="productCategory"> |
| | | <!-- <el-select v-model="productForm.productCategory" placeholder="请选择" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | </el-select> --> |
| | | <el-tree-select v-model="productForm.productCategory" placeholder="请选择" clearable check-strictly |
| | | @change="getModels" :data="productOptions" :render-after-expand="false" filterable 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" filterable> |
| | | <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> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- 产品选择对话框 --> |
| | | <ProductSelectDialog |
| | | v-model="productSelectVisible" |
| | | :single="true" |
| | | @confirm="handleProductSelect" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { getToken } from "@/utils/auth"; |
| | | import pagination from "@/components/PIMTable/Pagination.vue"; |
| | | import {onMounted, ref, getCurrentInstance} from "vue"; |
| | | import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue"; |
| | | import { addShippingInfo } from "@/api/salesManagement/deliveryLedger.js"; |
| | | import { ElMessageBox, ElMessage } from "element-plus"; |
| | | import { UploadFilled, Download } from "@element-plus/icons-vue"; |
| | |
| | | const productFormVisible = ref(false); |
| | | const productOperationType = ref(""); |
| | | const currentId = ref(""); |
| | | const productSelectVisible = ref(false); |
| | | const productFormData = reactive({ |
| | | productForm: { |
| | | productCategory: "", |
| | |
| | | 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 handleImport = () => { |
| | | importUpload.title = "导入销售台账"; |
| | |
| | | // 状态是字符串 |
| | | const statusStr = String(status).trim(); |
| | | |
| | | // 如果状态是"已撤销",直接返回 |
| | | if (statusStr === '已撤销') { |
| | | return '已撤销'; |
| | | } |
| | | |
| | | // 如果已发货(有发货日期或车牌号),显示"已发货" |
| | | if (row.shippingDate || row.shippingCarNumber) { |
| | | return '已发货'; |
| | | } |
| | | |
| | | const statusTextMap = { |
| | | '待发货': '待发货', |
| | | '待审核': '待审核', |
| | | '审核中': '审核中', |
| | | '发货中': '发货中', |
| | | '审核拒绝': '审核拒绝', |
| | | '审核通过': '审核通过', |
| | | '已发货': '已发货', |
| | | '已撤销': '已撤销' |
| | | }; |
| | | return statusTextMap[statusStr] || '待发货'; |
| | | |
| | | // 如果状态在映射表中,直接返回对应文本 |
| | | if (statusTextMap[statusStr]) { |
| | | return statusTextMap[statusStr]; |
| | | } |
| | | |
| | | return '待发货'; |
| | | }; |
| | | |
| | | /** |
| | |
| | | // 状态是字符串 |
| | | const statusStr = String(status).trim(); |
| | | |
| | | // 如果状态是"已撤销",显示橙色 |
| | | if (statusStr === '已撤销') { |
| | | return 'warning'; |
| | | } |
| | | |
| | | // 如果已发货(有发货日期或车牌号),显示绿色 |
| | | if (row.shippingDate || row.shippingCarNumber) { |
| | | return 'success'; |
| | | } |
| | | |
| | | const typeTextMap = { |
| | | '待发货': 'info', |
| | | '待审核': 'info', |
| | |
| | | '审核拒绝': 'danger', |
| | | '已撤销': 'warning', |
| | | '审核通过': 'success', |
| | | '已发货': 'success' |
| | | '已发货': 'success', |
| | | '发货中': 'warning' |
| | | }; |
| | | return typeTextMap[statusStr] || 'info'; |
| | | |
| | | // 如果状态在映射表中,直接返回对应类型 |
| | | if (typeTextMap[statusStr]) { |
| | | return typeTextMap[statusStr]; |
| | | } |
| | | |
| | | return 'info'; |
| | | }; |
| | | |
| | | /** |