| | |
| | | <el-button type="primary" |
| | | @click="openProDia1('addOne')" |
| | | style="margin-left: 10px">新增产品大类</el-button> |
| | | <el-button type="primary" |
| | | @click="getloadData" |
| | | style="margin-left: 10px">拉取数据</el-button> |
| | | </div> |
| | | <div ref="containerRef"> |
| | | <el-tree ref="tree" |
| | |
| | | </div> |
| | | </div> |
| | | <div class="right"> |
| | | <div style="margin-bottom: 10px" |
| | | <div style="margin-bottom: 10px; display: flex; align-items: center; gap: 10px" |
| | | v-if="isShowButton"> |
| | | <el-button type="primary" |
| | | @click="openModelDia('add')"> |
| | |
| | | </el-button> |
| | | <ImportExcel :product-id="currentId" |
| | | @uploadSuccess="getModelList" /> |
| | | <el-input v-model="specification" |
| | | placeholder="规格型号" |
| | | style="width: 150px" |
| | | clearable |
| | | @change="getModelList" /> |
| | | <el-input v-model="materialCode" |
| | | placeholder="物料编号" |
| | | style="width: 150px" |
| | | clearable |
| | | @change="getModelList" /> |
| | | <el-button type="danger" |
| | | @click="handleDelete" |
| | | style="margin-left: 10px" |
| | | plain> |
| | | 删除 |
| | | </el-button> |
| | |
| | | <PIMTable rowKey="id" |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :page="page" |
| | | :isSelection="true" |
| | | :isShowPagination="false" |
| | | @selection-change="handleSelectionChange" |
| | | :tableLoading="tableLoading"></PIMTable> |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination"></PIMTable> |
| | | </div> |
| | | <el-dialog v-model="productDia" |
| | | title="产品" |
| | |
| | | <el-select v-model="form.inventoryCategoryId" |
| | | placeholder="请选择存货类别" |
| | | clearable |
| | | filterable |
| | | style="width: 100%"> |
| | | <el-option v-for="item in inventoryCategoryList" |
| | | :key="item.id" |
| | |
| | | <el-select v-model="form.materialTypeId" |
| | | placeholder="请选择物料类型" |
| | | clearable |
| | | filterable |
| | | style="width: 100%"> |
| | | <el-option v-for="item in materialTypeList" |
| | | :key="item.id" |
| | |
| | | @keydown.enter.prevent /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="物料编码:" |
| | | prop="materialCode"> |
| | | <el-input v-model="modelForm.materialCode" |
| | | placeholder="请输入物料编码" |
| | | clearable |
| | | @keydown.enter.prevent /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | |
| | | <el-select v-model="modelForm.supplyType" |
| | | placeholder="请选择供应方式" |
| | | clearable |
| | | filterable |
| | | style="width: 100%"> |
| | | <el-option label="自制" |
| | | value="自制" /> |
| | |
| | | addOrEditProductConfig, |
| | | updateOrEditProductConfig, |
| | | delProductConfig, |
| | | loadData, |
| | | } from "@/api/basicData/newProduct.js"; |
| | | import ImportExcel from "./ImportExcel/index.vue"; |
| | | |
| | |
| | | const expandedKeys = ref([]); |
| | | const inventoryCategoryList = ref([]); |
| | | const materialTypeList = ref([]); |
| | | const specification = ref(""); |
| | | const materialCode = ref(""); |
| | | |
| | | const getloadData = () => { |
| | | loadData() |
| | | .then(res => { |
| | | getInventoryCategoryList(); |
| | | getMaterialTypeList(); |
| | | getProductTreeList(); |
| | | tableData.value = []; |
| | | isShowButton.value = false; |
| | | }) |
| | | .catch(err => { |
| | | console.error("拉取失败:", err); |
| | | }); |
| | | }; |
| | | |
| | | // 获取存货类别列表 |
| | | const getInventoryCategoryList = () => { |
| | |
| | | prop: "specification", |
| | | }, |
| | | { |
| | | label: "物料编码", |
| | | prop: "materialCode", |
| | | }, |
| | | { |
| | | label: "单位", |
| | | prop: "baseUnit", |
| | | }, |
| | |
| | | const tableLoading = ref(false); |
| | | const isShowButton = ref(false); |
| | | const selectedRows = ref([]); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | total: 0, |
| | | }); |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | |
| | | modelForm: { |
| | | specification: "", |
| | | supplyType: "", |
| | | materialCode: "", |
| | | id: null, |
| | | }, |
| | | modelRules: { |
| | | specification: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | supplyType: [{ required: true, message: "请选择", trigger: "change" }], |
| | | materialCode: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | }, |
| | | configForm: { |
| | | configName: "", |
| | |
| | | modelForm.value.specification = ""; |
| | | modelForm.value.supplyType = ""; |
| | | modelForm.value.id = null; |
| | | modelForm.value.materialCode = null; |
| | | |
| | | if (type === "edit" && data) { |
| | | // 编辑模式,回填数据 |
| | | modelForm.value.specification = data.specification || ""; |
| | | modelForm.value.supplyType = data.supplyType || ""; |
| | | modelForm.value.id = data.skuId || null; |
| | | modelForm.value.materialCode = data.materialCode || null; |
| | | } |
| | | }; |
| | | // 提交产品名称修改 |
| | |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | closeConfigDia(); |
| | | getProductTreeList(); |
| | | getMaterialTypeList(); |
| | | }); |
| | | } else { |
| | | addOrEditProductConfig(params).then(res => { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | closeConfigDia(); |
| | | getProductTreeList(); |
| | | getMaterialTypeList(); |
| | | }); |
| | | } |
| | | } |
| | |
| | | const params = { |
| | | materialId: currentId.value, |
| | | specification: modelForm.value.specification, |
| | | materialCode: modelForm.value.materialCode, |
| | | supplyType: modelForm.value.supplyType, |
| | | }; |
| | | if (modelOperationType.value === "add") { |
| | |
| | | }; |
| | | |
| | | // 查询规格型号 |
| | | const pagination = obj => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getModelList(); |
| | | }; |
| | | const getModelList = () => { |
| | | if (!currentId.value) { |
| | | return; |
| | |
| | | tableLoading.value = true; |
| | | modelListPage({ |
| | | materialId: currentId.value, |
| | | current: page.current, |
| | | size: page.size, |
| | | specification: specification.value, |
| | | materialCode: materialCode.value, |
| | | }).then(res => { |
| | | console.log("res", res); |
| | | tableData.value = res.data; |
| | | tableData.value = res.data.records || []; |
| | | page.total = res.data.total; |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | |
| | | gap: 20px; |
| | | } |
| | | .left { |
| | | width: 450px; |
| | | min-width: 450px; |
| | | width: 465px; |
| | | min-width: 465px; |
| | | background: #ffffff; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |