| | |
| | | import Vue from 'vue' |
| | | import Vuex from 'vuex' |
| | | import getSupplierName from "./modules/getSupplierName" |
| | | |
| | | Vue.use(Vuex) |
| | | |
| | |
| | | actions: { |
| | | }, |
| | | modules: { |
| | | getSupplierName |
| | | } |
| | | }) |
New file |
| | |
| | | import { getSupplierList } from "@/api/supplierManage/supplier" |
| | | import { Message } from "element-ui" |
| | | |
| | | export default{ |
| | | state:{ |
| | | supplierList:[], //供应商列表 |
| | | }, |
| | | mutations:{ |
| | | supplierNameList(state, payload) { |
| | | state.supplierList = payload |
| | | }, |
| | | }, |
| | | actions:{ |
| | | getSupplier(context){ |
| | | getSupplierList({page:1,pageSize:50}).then((res) => { |
| | | if (res.data.code == 200) { |
| | | context.commit("supplierNameList", res.data.data.list) |
| | | } else { |
| | | Message.error(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | <el-button type="primary" size="mini" disabled>快速创建</el-button> --> |
| | | </div> |
| | | </div> |
| | | <TableCommonView ref="tableListRef" :table-list="tableList" :select-box="false" @selCommonClick="selNameClick"> |
| | | <TableCommonView |
| | | ref="tableListRef" |
| | | :table-list="tableList" |
| | | :select-box="false" |
| | | @selCommonClick="selNameClick" |
| | | @selTableCol="selTableCol" |
| | | > |
| | | </TableCommonView> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <!-- <div class="remark">说明:支持多字段模糊查询,仅显示符合条件的前5条数据</div> --> |
| | |
| | | } |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val |
| | | this.tableList.tableColumn = this.setColumnVisible(val) |
| | | this.showcol = val; |
| | | this.tableList.tableColumn = this.setColumnVisible(val); |
| | | }, |
| | | // setColumnVisible(showCol){ |
| | | // return this.tableColumn.map(ele=>{ |
| | | // return { |
| | | // ...ele, |
| | | // isShowColumn:showCol.includes(ele.label) |
| | | // } |
| | | // }) |
| | | // }, |
| | | // 请求数据 |
| | | async getData() { |
| | | this.loading = true |
| | |
| | | v-model="editConfig.infomation.supplierName" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'client'); |
| | | querySearchAsync(queryString, callback, 'supplier'); |
| | | } |
| | | " |
| | | value-key="name" |
| | |
| | | }, |
| | | created() { |
| | | this.handleGetBomKindDictList(); |
| | | this.$store.dispatch("getSupplier") |
| | | }, |
| | | computed: { |
| | | supplierList() { |
| | | return this.$store.state.getSupplierName.supplierList |
| | | } |
| | | }, |
| | | watch:{ |
| | | 'editCommonConfig.visible':{ |
| | |
| | | // 选择客户相关方法 |
| | | querySearchAsync(queryString, cb, value) { |
| | | var restaurants = []; |
| | | if (value === "client") { |
| | | restaurants = this.clientList; |
| | | if (value === "supplier") { |
| | | restaurants = this.supplierList; |
| | | } |
| | | var results = queryString |
| | | ? restaurants.filter(this.createStateFilter(queryString)) |
| | |
| | | :table-list="tableList" |
| | | :select-box="false" |
| | | @selCommonClick="selNameClick" |
| | | @selTableCol="selTableCol" |
| | | > |
| | | </TableCommonView> |
| | | <div slot="footer" class="dialog-footer"> |
| | |
| | | loading: false, |
| | | searchOptions: [], |
| | | tableList: {}, |
| | | search_map: {} |
| | | search_map: {}, |
| | | tableColumn: [ |
| | | { label: "供应商编号", prop: "number", min: 190, isCommonClick: true }, |
| | | { label: "供应商名称", prop: "name", min: 130 }, |
| | | { label: "供应商类型", prop: "supplierType", min: 130 }, |
| | | { label: "所属行业", prop: "industry", min: 130 }, |
| | | { label: "联系人", prop: "contact", min: 130 }, |
| | | { label: "联系电话", prop: "phone", min: 130 }, |
| | | { label: "状态", prop: "status_name", min: 130 }, |
| | | { label: "创建时间", prop: "member_name", min: 130 } |
| | | ], |
| | | showCol: ['供应商编号', '供应商名称', '供应商类型', '所属行业', '联系人', '联系电话','状态','创建时间'] |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.getData() |
| | | }, |
| | | mounted(){ |
| | | }, |
| | | methods: { |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | tableColumn: [ |
| | | { label: "供应商编号", prop: "number", min: 190, isCommonClick: true }, |
| | | { label: "供应商名称", prop: "name", min: 130 }, |
| | | { label: "供应商类型", prop: "supplierType", min: 130 }, |
| | | { label: "所属行业", prop: "industry", min: 130 }, |
| | | { label: "联系人", prop: "contact", min: 130 }, |
| | | { label: "联系电话", prop: "phone", min: 130 }, |
| | | { label: "状态", prop: "status_name", min: 130 }, |
| | | { label: "创建时间", prop: "member_name", min: 130 } |
| | | ] |
| | | tableColumn:this.setColumnVisible(this.showCol), |
| | | showcol: this.showCol, |
| | | allcol:[] |
| | | } |
| | | this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label); |
| | | this.searchOptions = [] |
| | | for (let i = 0; i < this.tableList.tableColumn.length; i++) { |
| | | const label = this.tableList.tableColumn[i].label |
| | | const value = this.tableList.tableColumn[i].prop |
| | | this.searchOptions.push({ value: value, label: label }) |
| | | } |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val; |
| | | this.tableList.tableColumn = this.setColumnVisible(val); |
| | | }, |
| | | setColumnVisible(showCol){ |
| | | return this.tableColumn.map(ele=>{ |
| | | return { |
| | | ...ele, |
| | | isShowColumn:showCol.includes(ele.label) |
| | | } |
| | | }) |
| | | }, |
| | | handleClose() { |
| | | this.editConfig.editVisible = false |
| | |
| | | status_name: item.status === 0 ? "未启用" : "启用" |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list.slice(0, 5) || [] |
| | | // this.tableList.tableInfomation = list.slice(0, 5) || [] |
| | | this.tableList.tableInfomation = list |
| | | } else { |
| | | this.tableList.tableInfomation = [] |
| | | } |
| | |
| | | import DetailSupplier from "@/views/purchaseManage/purchase/DetailSupplier" |
| | | import AddPurchase from "@/views/purchaseManage/purchase/components/AddPurchase" |
| | | import { getDataByType } from "@/api/data" |
| | | import { getSupplierList } from "@/api/supplierManage/supplier" |
| | | export default { |
| | | name: "SupplierManage", |
| | | props: {}, |
| | |
| | | editConfig: { |
| | | visible: false, |
| | | title: "创建", |
| | | infomation: {} |
| | | infomation: { |
| | | supplierList:[] |
| | | } |
| | | }, |
| | | purchaseStatusList: getDataByType("purchaseStatus"), |
| | | tableColumn: [ |
| | |
| | | created() { |
| | | this.setTable() |
| | | this.getData() |
| | | this.getSupplierData() |
| | | }, |
| | | methods: { |
| | | getpurchaseStatus(val) { |
| | |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | // 获取供应商数据 |
| | | async getSupplierData() { |
| | | await getSupplierList({ |
| | | // [val]: content, |
| | | page:1, |
| | | pageSize: 10 |
| | | }) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.editConfig.infomation.supplierList=res.data.data.list |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | // 搜索 |
| | | onFilterSearch(searchText){ |
| | | this.search = searchText ?? '' |