| | |
| | | import request from "@/common/untils/request.js" |
| | | |
| | | // 销售线索列表 |
| | | export function getSalesLeadsList(data) { |
| | | return request({ |
| | | url: "/api/salesLeads/list", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 添加销售线索 |
| | | export function getAddSalesLeads(data) { |
| | | return request({ |
| | | url: "/api/salesLeads/add", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 删除销售线索 |
| | | export function getDeleteSalesLeads(data) { |
| | | return request({ |
| | | url: "/api/salesLeads/delete", |
| | | method: "delete", |
| | | data |
| | | }) |
| | | } |
| | | // 更新销售线索 |
| | | export function getUpdateSalesLeads(data) { |
| | | return request({ |
| | | url: "/api/salesLeads/update", |
| | | method: "put", |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // 推进销售线索 |
| | | export function pushSalesSources(data) { |
| | | return request({ |
| | | url: "/api/salesLeads/push", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // 商机来源列表 |
| | | export function getSalesSourcesList() { |
| | | return request({ |
| | | url: "/api/salesSources/list", |
| | | method: "get" |
| | | }) |
| | | } |
| | | // 添加报价单 |
| | | export function getAddQuotation(data) { |
| | | return request({ |
| | | url: "/api/quotation/add", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 更新报价单 |
| | | export function getUpdateQuotation(data) { |
| | | return request({ |
| | | url: "/api/quotation/update", |
| | | method: "put", |
| | | data |
| | | }) |
| | | } |
| | | // 获取客户来源等所有数据 |
| | | export function getAllData() { |
| | | return request({ |
| | | url: "/api/data/getAllData", |
| | | method: "get" |
| | | }) |
| | | } |
| | | // 客户管理列表 |
| | | export function getClientList(data) { |
| | | return request({ |
| | | url: "/api/client/list", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // ----bom --- 計量單位 的數據 |
| | | export function postGetUnitDictList(data) { |
| | | return request({ |
| | | url: "/api-s/v1/dict/getUnitDictList", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // ----bom --- 計量單位 的數據 更新 |
| | | export function postGetSaveSUnitDict(data) { |
| | | return request({ |
| | | url: "/api-s/v1/dict/saveUnitDict", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // import request from "@/common/untils/request.js" |
| | |
| | | }) |
| | | } |
| | | |
| | | // |
| | | // 更新所属行业 |
| | | export function updateIndustry(data) { |
| | | return request({ |
| | | url: "/api/i/updateIndustry", |
| | | method: "put", |
| | | data |
| | | }) |
| | | } |
| | | // 所属行业列表 |
| | | export const getIndustryList = async (data) => { |
| | | return await axios.get(`/api/i/getIndustryList`, { |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | <el-button size="small" type="primary" @click="add">新增</el-button> |
| | | <el-button size="small" type="primary" @click="empty">清空</el-button> |
| | | |
| | | <el-button size="small" v-if="recalculateShow" type="primary" @click="recalculate" :disabled="isRecalculate ? false : true" |
| | | <el-button |
| | | size="small" |
| | | v-if="recalculateShow" |
| | | type="primary" |
| | | @click="recalculate" |
| | | :disabled="isRecalculate ? false : true" |
| | | >重算</el-button |
| | | > |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getProductList } from "@/api/common/other" |
| | | import { getProductList } from "@/api/productManage/product" |
| | | import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" |
| | | export default { |
| | | name: "CommmonFormTableView", |
| | |
| | | total: false, |
| | | refundable: false, |
| | | sumProp: [], |
| | | titleProp:["#", "产品名称"], |
| | | titleProp: ["#", "产品名称"], |
| | | mergeNumber: 1 |
| | | } |
| | | } |
| | | }, |
| | | recalculateShow:{ |
| | | type:[Boolean], |
| | | defalut:true, |
| | | }, |
| | | |
| | | recalculateShow: { |
| | | type: [Boolean], |
| | | defalut: true |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | // 产品名称 |
| | | async getProductList() { |
| | | await getProductList({ |
| | | productName: "", |
| | | productNumber: "", |
| | | page: 1, |
| | | pageSize: 5 |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | console.log(res.data) |
| | | if (res.data.code === 200) { |
| | | if (res.data.data.data && res.data.data.data.length > 0) { |
| | | this.productList = res.data.data.data |
| | | if (res.data.data.list && res.data.data.list.length > 0) { |
| | | this.productList = res.data.data.list |
| | | } |
| | | } |
| | | }) |
| | |
| | | :summary-method="getSummaries" |
| | | :span-method="arraySpanMethod" |
| | | @selection-change="handleSelectionChange" |
| | | highlight-current-row |
| | | @row-click="tableRowClick" |
| | | :header-cell-style="{ background: '#ECF4FF', color: '#666' }" |
| | | > |
| | | <el-table-column v-if="tableList.selectBox" type="selection" width="40"> </el-table-column> |
| | |
| | | return {} |
| | | }, |
| | | computed: {}, |
| | | mounted() {}, |
| | | methods: { |
| | | tableRowClick(row) { |
| | | console.log(row) |
| | | this.$emit("tableRowClick", row) |
| | | }, |
| | | handleReserve(row) { |
| | | return row._id ? row._id : row.id |
| | | }, |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getSupplierTypeList, updateSupplierType } from "@/api/supplierManage/supplier" |
| | | import { getSupplierTypeList, updateSupplierType, updateIndustry, getIndustryList } from "@/api/supplierManage/supplier" |
| | | export default { |
| | | name: "EditDropdownDialog", |
| | | props: { |
| | |
| | | setList() { |
| | | if (this.editConfig.title === "供应商类型") { |
| | | this.getSupplierTypeList() |
| | | } else if (this.editConfig.title === "所属行业") { |
| | | this.getIndustryList() |
| | | } |
| | | }, |
| | | // 供应商类型 |
| | |
| | | page: 1, |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | console.log("dsss") |
| | | console.log(res.data) |
| | | this.tableData = res.data.data.list |
| | | }) |
| | | }, |
| | | // 所属行业 |
| | | async getIndustryList() {}, |
| | | async getIndustryList() { |
| | | await getIndustryList({ |
| | | page: 1, |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | console.log(res.data) |
| | | this.tableData = res.data.data.list |
| | | }) |
| | | }, |
| | | handleClose() { |
| | | this.editConfig.editVisible = false |
| | | }, |
| | |
| | | // 新增下拉框 |
| | | addDropdown() { |
| | | this.tableData.push({ |
| | | name: "", |
| | | id: 0 |
| | | ID: 0, |
| | | name: "" |
| | | }) |
| | | }, |
| | | async saveClick() { |
| | | console.log(this.tableData) |
| | | this.tableData.map((ite) => { |
| | | ite.ID = 0 |
| | | return { ...ite } |
| | | }) |
| | | if (this.editConfig.title === "供应商类型") { |
| | | updateSupplierType({ |
| | | supplierTypes: this.tableData |
| | |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | this.$message.success("编辑成功") |
| | | this.$parent.getData() |
| | | this.$parent.getSupplierTypeList() |
| | | this.handleClose() |
| | | } |
| | | }) |
| | | } else if (this.editConfig.title === "所属行业") { |
| | | updateIndustry({ |
| | | industries: this.tableData |
| | | }).then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | this.$message.success("编辑成功") |
| | | this.$parent.getIndustryList() |
| | | this.handleClose() |
| | | } |
| | | }) |
| | | } |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getProductList } from "@/api/common/other" |
| | | import { getProductList } from "@/api/productManage/product" |
| | | export default { |
| | | name: "EditSelCommonDialog", |
| | | props: { |
| | |
| | | // 产品名称 |
| | | async getProductList() { |
| | | await getProductList({ |
| | | productName: this.keywordType === "产品名称" ? this.keyword : "", |
| | | productNumber: this.keywordType === "产品编号" ? this.keyword : "", |
| | | page: 1, |
| | | pageSize: 5 |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | console.log(res.data) |
| | | if (res.data.code === 200) { |
| | | if (res.data.data.data && res.data.data.data.length > 0) { |
| | | const list = res.data.data.data.map((item) => { |
| | | if (res.data.data.list && res.data.data.list.length > 0) { |
| | | const list = res.data.data.list.map((item) => { |
| | | return { |
| | | ...item |
| | | } |
| | |
| | | @resetClick="resetClick" |
| | | /> |
| | | <div class="add-view"> |
| | | <el-button type="primary" size="mini" @click="addBtnClick">新建</el-button> |
| | | <!-- <el-button type="primary" size="mini" @click="addBtnClick">新建</el-button> --> |
| | | </div> |
| | | </div> |
| | | <template> |
| | | <TableCommonView ref="tableListRef" :table-list="tableList" @selCommonClick="selCommonClick"> |
| | | <template slot="tableButton"> |
| | | <!-- <template slot="tableButton"> |
| | | <el-table-column label="操作" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button> |
| | | <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </template> --> |
| | | </TableCommonView> |
| | | <div class="btn-pager"> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | |
| | | tableColumn: [ |
| | | { label: "产品编码", prop: "number", min: 190, isCommonClick: true }, |
| | | { label: "产品名称", prop: "name", min: 130 }, |
| | | { label: "供应商", prop: "id", min: 130 }, |
| | | { label: "供应商", prop: "supplierNumber", min: 130 }, |
| | | { label: "产品类别", prop: "productType", min: 130 }, |
| | | { label: "规格", prop: "sales_resources", min: 130 }, |
| | | { label: "型号", prop: "province", min: 130 }, |
| | | { label: "规格", prop: "specifications", min: 130 }, |
| | | { label: "型号", prop: "modelNumber", min: 130 }, |
| | | { label: "单位", prop: "unit", min: 60 }, |
| | | { label: "价格", prop: "contact_phone1", min: 130 }, |
| | | { label: "最低库存", prop: "desc", min: 80 }, |
| | | { label: "最高库存", prop: "member_name", min: 80 } |
| | | { label: "价格", prop: "purchasePrice", min: 130 }, |
| | | { label: "最低库存", prop: "minimumStock", min: 80 }, |
| | | { label: "最高库存", prop: "maximumStock", min: 80 } |
| | | ] |
| | | } |
| | | this.searchOptions = [] |
| | |
| | | // 请求数据 |
| | | async getData(val, content) { |
| | | await getProductList({ |
| | | val, |
| | | content, |
| | | [val]: content, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | if (res.data.code === 200) { |
| | | const list = res.data.data.list.map((item) => { |
| | | return { |
| | | ...item |
| | | ...item, |
| | | supplierNumber: item.supplier.number |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list || [] |
| | |
| | | // 搜索 |
| | | searchClick(val, content) { |
| | | console.log(val, content) |
| | | this.getData(val, content) |
| | | this.getData(val.value, content) |
| | | }, |
| | | resetClick() { |
| | | this.getData() |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | // import { getAddContact, getUpdateContact } from "@/api/client/contacts" |
| | | // import { createProduct, updateProduct } from "@/api/productManage/product" |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView" |
| | | export default { |
| | | name: "AddNewProduct", |
| | |
| | | const params = this.saveParams() |
| | | console.log(params) |
| | | if (this.editConfig.title === "添加") { |
| | | // getAddContact(params).then((res) => { |
| | | // createProduct(params).then((res) => { |
| | | // console.log(res) |
| | | // this.editConfig.visible = false |
| | | // if (res.code === 200) { |
| | |
| | | // } |
| | | // }) |
| | | } else { |
| | | // getUpdateContact(params).then((res) => { |
| | | // updateProduct(params).then((res) => { |
| | | // console.log(res) |
| | | // this.editConfig.visible = false |
| | | // if (res.code === 200) { |
| | |
| | | } |
| | | }, |
| | | saveParams() { |
| | | let data = this.editConfig.infomation |
| | | // let data = this.editConfig.infomation |
| | | let params = { |
| | | id: this.editConfig.title === "添加" ? 0 : data.id, |
| | | birthday: data.birthday || "", |
| | | city_id: data.city_id || 0, |
| | | client_id: this.clientId || 0, |
| | | country_id: data.country_id || 0, |
| | | desc: data.desc || "", |
| | | email: data.email || "", |
| | | is_first: data.is_first || false, |
| | | member_id: data.member_id || 0, |
| | | name: data.name || "", |
| | | number: data.number || "", |
| | | phone: data.phone || "", |
| | | position: data.position || "", |
| | | province_id: data.province_id || 0, |
| | | region_id: data.region_id || 0, |
| | | wechat: data.wechat || "" |
| | | deliveryTime: 0, |
| | | id: 0, |
| | | maximumStock: 0, |
| | | minimumStock: 0, |
| | | name: "string", |
| | | number: "string", |
| | | productType: "string", |
| | | purchasePrice: 0, |
| | | remark: "string", |
| | | shippingDuration: 0, |
| | | specifications: "string", |
| | | supplierId: 0, |
| | | unit: "string" |
| | | } |
| | | return params |
| | | }, |
| | |
| | | tableColumn: [ |
| | | { label: "产品名称", prop: "name", productName: true, isRequird: true }, |
| | | { label: "产品编码", prop: "number" }, |
| | | { label: "计量单位", prop: "number" }, |
| | | { label: "规格型号", prop: "number" }, |
| | | { label: "采购价格", prop: "amount", inputFloat: true, isRequird: true }, |
| | | { label: "供货时长", prop: "price", inputNumber: true, isRequird: true }, |
| | | { label: "物流时长", prop: "total", inputNumber: true, isRequird: true } |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "规格型号", prop: "specifications" }, |
| | | { label: "采购价格", prop: "purchasePrice", inputFloat: true, isRequird: true }, |
| | | { label: "供货时长", prop: "deliveryTime", inputNumber: true, isRequird: true }, |
| | | { label: "物流时长", prop: "shippingDuration", inputNumber: true, isRequird: true } |
| | | ] |
| | | } |
| | | }, |
| | |
| | | size="mini" |
| | | > |
| | | <el-option |
| | | v-for="item in supplierTypeOptions" |
| | | :key="item.id" |
| | | v-for="(item, index) in supplierTypeOptions" |
| | | :key="index" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | > |
| | |
| | | class="common-select-sel" |
| | | size="mini" |
| | | > |
| | | <el-option v-for="item in industryOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | <el-option |
| | | v-for="(item, index) in industryOptions" |
| | | :key="index" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <div class="common-select-btn" @click="setIndustry"><i class="el-icon-setting"></i></div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { createSupplier, createContract, updateSupplier } from "@/api/supplierManage/supplier" |
| | | import { createSupplier, createContract, updateSupplier, getIndustryList } from "@/api/supplierManage/supplier" |
| | | import EditDropdownDialog from "@/views/other/commonDialog/EditDropdownDialog" |
| | | import { getSupplierTypeList } from "@/api/supplierManage/supplier" |
| | | export default { |
| | |
| | | }, |
| | | created() { |
| | | this.getSupplierTypeList() |
| | | this.getIndustryList() |
| | | }, |
| | | methods: { |
| | | // 供应商类型 |
| | |
| | | page: 1, |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | console.log("dsss") |
| | | console.log(res.data) |
| | | this.supplierTypeOptions = res.data.data.list |
| | | }) |
| | | }, |
| | | // 所属行业 |
| | | async getIndustryList() { |
| | | await getIndustryList({ |
| | | page: 1, |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | this.industryOptions = res.data.data.list |
| | | }) |
| | | }, |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | // import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" |
| | | import { getProductList } from "@/api/productManage/product" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | export default { |
| | | name: "AddSupplierDialog", |
| | |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.getProductList() |
| | | }, |
| | | methods: { |
| | | setTable() { |
| | |
| | | tableInfomation: [], |
| | | selectIndex: true, |
| | | tableColumn: [ |
| | | { label: "供应商编号", prop: "number", min: 190, isCommonClick: true }, |
| | | { label: "供应商名称", prop: "name", min: 130 }, |
| | | { label: "采购价格", prop: "contact_name", min: 130 }, |
| | | { label: "供货天数", prop: "contact_phone", min: 130 }, |
| | | { label: "物流时长(天)", prop: "sales_resources", min: 130 } |
| | | { label: "供应商编号", prop: "supplierNumber", min: 190, isCommonClick: true }, |
| | | { label: "供应商名称", prop: "supplierName", min: 130 }, |
| | | { label: "采购价格", prop: "purchasePrice", min: 130 }, |
| | | { label: "供货天数", prop: "deliveryTime", min: 130 }, |
| | | { label: "物流时长(天)", prop: "shippingDuration", min: 130 } |
| | | ] |
| | | } |
| | | }, |
| | | // 产品列表 |
| | | async getProductList(val, content) { |
| | | console.log(val, content) |
| | | await getProductList({ |
| | | number: this.editConfig.infomation.number, |
| | | supplierId: this.editConfig.infomation.supplierId, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | console.log(res.data) |
| | | const list = res.data.data.list.map((item) => { |
| | | return { |
| | | ...item, |
| | | supplierNumber: item.supplier.number, |
| | | supplierName: item.supplier.name |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list || [] |
| | | this.tableList.totalCount = res.data.data.total |
| | | }) |
| | | }, |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | |
| | | ref="tableListRef" |
| | | :table-list="tableList" |
| | | @selCommonClick="selCommonClick" |
| | | @getSelectArray="getSelectArray" |
| | | @tableRowClick="tableRowClick" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="120"> |
| | |
| | | > |
| | | <el-button v-else @click="enableClick(scope.row, '停用')" type="text" size="small">停用</el-button> |
| | | <el-button @click="modifyClick(scope.row)" type="text" size="small">修改</el-button> |
| | | <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> --> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | </div> |
| | | <template> |
| | | <TableCommonView |
| | | ref="tableListRef" |
| | | ref="tableListProduct" |
| | | :table-list="productTableList" |
| | | @selCommonClick="selCommonClick" |
| | | @getSelectArray="getSelectArray" |
| | |
| | | <el-button @click="raleteClick(scope.row)" type="text" size="small">相关供应商</el-button> |
| | | <el-button @click="editClick(scope.row)" type="text" size="small">修改</el-button> |
| | | <el-button @click="delClick(scope.row)" type="text" size="small">删除</el-button> |
| | | <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> --> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | import AddSupplier from "@/views/supplierManage/supplier/AddSupplier" |
| | | import RaleteSupplierList from "@/views/supplierManage/supplier/RaleteSupplierList" |
| | | import AddNewProduct from "@/views/supplierManage/supplier/AddNewProduct" |
| | | import { getProductList, deleteProduct } from "@/api/productManage/product" |
| | | |
| | | export default { |
| | | name: "SupplierManage", |
| | |
| | | currPage: 1, |
| | | pageSize: 10, |
| | | totalCount: 0 |
| | | } |
| | | }, |
| | | supplierId: 0 |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | selectIndex: true, |
| | | ref: "tableListRef", |
| | | tableColumn: [ |
| | | { label: "供应商编号", prop: "number", min: 190, isCommonClick: true }, |
| | | { label: "供应商名称", prop: "name", min: 130 }, |
| | |
| | | }, |
| | | setProductTable() { |
| | | this.productTableList = { |
| | | tableInfomation: [ |
| | | { |
| | | number: "aaaaa" |
| | | } |
| | | ], |
| | | tableInfomation: [], |
| | | selectBox: true, |
| | | selectIndex: true, |
| | | tableColumn: [ |
| | | { label: "产品编码", prop: "number", min: 190 }, |
| | | { label: "产品名称", prop: "name", min: 130 }, |
| | | { label: "产品规格", prop: "contact_name", min: 130 }, |
| | | { label: "单位", prop: "contact_phone", min: 130 }, |
| | | { label: "采购价格", prop: "sales_resources", min: 130 }, |
| | | { label: "供货时长(天)", prop: "province", min: 130 }, |
| | | { label: "物流时长(天)", prop: "city", min: 130 } |
| | | { label: "产品规格", prop: "specifications", min: 130 }, |
| | | { label: "单位", prop: "unit", min: 130 }, |
| | | { label: "采购价格", prop: "purchasePrice", min: 130 }, |
| | | { label: "供货时长(天)", prop: "deliveryTime", min: 130 }, |
| | | { label: "物流时长(天)", prop: "shippingDuration", min: 130 } |
| | | ] |
| | | } |
| | | this.searchProductOptions = [] |
| | |
| | | } |
| | | }, |
| | | // 请求数据 |
| | | async getData(val, content, searchName) { |
| | | if (searchName === "供应商") { |
| | | this.getSupplierList(val, content) |
| | | } else if (searchName === "产品") { |
| | | this.getProductList(val, content) |
| | | } else { |
| | | this.getSupplierList() |
| | | this.getProductList() |
| | | } |
| | | async getData(val, content) { |
| | | this.getSupplierList(val, content) |
| | | }, |
| | | // 供应商列表 |
| | | async getSupplierList(val, content) { |
| | |
| | | }) |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.data.total |
| | | if (list && list.length > 0) { |
| | | this.supplierId = this.tableList.tableInfomation[0].ID |
| | | } else { |
| | | this.supplierId = 0 |
| | | } |
| | | this.getProductList() |
| | | } |
| | | }) |
| | | }, |
| | | // 产品列表 |
| | | async getProductList(val, content) { |
| | | console.log(val, content) |
| | | // await getProductList({ |
| | | // [val]: content, |
| | | // page: this.productPagerOptions.currPage, |
| | | // pageSize: this.productPagerOptions.pageSize |
| | | // }).then((res) => { |
| | | // console.log(res.data) |
| | | // }) |
| | | await getProductList({ |
| | | [val]: content, |
| | | supplierId: this.supplierId, |
| | | page: this.productPagerOptions.currPage, |
| | | pageSize: this.productPagerOptions.pageSize |
| | | }).then((res) => { |
| | | console.log(res.data) |
| | | const list = res.data.data.list.map((item) => { |
| | | return { |
| | | ...item |
| | | } |
| | | }) |
| | | this.productTableList.tableInfomation = list || [] |
| | | this.productPagerOptions.totalCount = res.data.data.total |
| | | }) |
| | | }, |
| | | // 搜索供应商 |
| | | searchClick(val, content) { |
| | | console.log(val, content) |
| | | this.getData(val.value, content, "供应商") |
| | | this.getSupplierList(val.value, content) |
| | | }, |
| | | resetClick() { |
| | | this.getData("", "", "供应商") |
| | | this.getSupplierList() |
| | | }, |
| | | // 搜索产品 |
| | | searchProductClick(val, content) { |
| | | console.log(val, content) |
| | | this.getData(val.value, content, "产品") |
| | | this.getProductList(val.value, content) |
| | | }, |
| | | resetProductClick() { |
| | | this.getData("", "", "产品") |
| | | this.getProductList() |
| | | }, |
| | | // 新建供应商 |
| | | addBtnClick() { |
| | |
| | | // this.newProductConfig.title = "修改" |
| | | }, |
| | | // 删除 |
| | | delClick() { |
| | | if (this.selValueList && this.selValueList.length > 0) { |
| | | this.$confirm("是否确认删除?", "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | console.log("dddd") |
| | | // deleteSupplier({ id: this.selValueList }).then((response) => { |
| | | // if (response.code === 200) { |
| | | // this.$message.success("删除成功") |
| | | // this.getData() |
| | | // } else { |
| | | // this.$message.warning("删除失败") |
| | | // } |
| | | // }) |
| | | delClick(row) { |
| | | this.$confirm("是否确认删除?", "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | console.log("dddd") |
| | | deleteProduct({ id: row.ID }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("删除成功") |
| | | this.getProductList() |
| | | } else { |
| | | this.$message.warning("删除失败") |
| | | } |
| | | }) |
| | | .catch(() => {}) |
| | | } else { |
| | | this.$message.warning("请至少选择一条记录") |
| | | } |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | getSelectArray(val) { |
| | | console.log(val) |
| | |
| | | }) |
| | | this.selValueList = list |
| | | }, |
| | | tableRowClick(row) { |
| | | console.log(row) |
| | | this.supplierId = row.ID |
| | | this.getProductList() |
| | | }, |
| | | // 详情 |
| | | selCommonClick(row) { |
| | | console.log(row) |