From a7f37d5a76f80df4bad37a58ad95ab41ba0be22e Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期四, 02 十一月 2023 09:40:53 +0800
Subject: [PATCH] 修改采购管理,供应商列表和产品名称列表展示
---
src/store/modules/getSupplierName.js | 25 ++++++++
src/store/index.js | 2
src/views/purchaseManage/purchase/components/AddPurchase.vue | 10 ++-
src/views/purchaseManage/purchase/index.vue | 20 ++++++
src/views/other/commonDialog/SelectCommonDialog.vue | 20 +++++-
src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue | 46 +++++++++++----
6 files changed, 104 insertions(+), 19 deletions(-)
diff --git a/src/store/index.js b/src/store/index.js
index ceffa8e..3f464bf 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -1,5 +1,6 @@
import Vue from 'vue'
import Vuex from 'vuex'
+import getSupplierName from "./modules/getSupplierName"
Vue.use(Vuex)
@@ -13,5 +14,6 @@
actions: {
},
modules: {
+ getSupplierName
}
})
diff --git a/src/store/modules/getSupplierName.js b/src/store/modules/getSupplierName.js
new file mode 100644
index 0000000..3a9a5c5
--- /dev/null
+++ b/src/store/modules/getSupplierName.js
@@ -0,0 +1,25 @@
+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)
+ }
+ })
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/views/other/commonDialog/SelectCommonDialog.vue b/src/views/other/commonDialog/SelectCommonDialog.vue
index 2e31f18..2b2516f 100644
--- a/src/views/other/commonDialog/SelectCommonDialog.vue
+++ b/src/views/other/commonDialog/SelectCommonDialog.vue
@@ -28,7 +28,13 @@
<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> -->
@@ -127,9 +133,17 @@
}
},
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
diff --git a/src/views/purchaseManage/purchase/components/AddPurchase.vue b/src/views/purchaseManage/purchase/components/AddPurchase.vue
index 260540a..5dcef72 100644
--- a/src/views/purchaseManage/purchase/components/AddPurchase.vue
+++ b/src/views/purchaseManage/purchase/components/AddPurchase.vue
@@ -59,7 +59,7 @@
v-model="editConfig.infomation.supplierName"
:fetch-suggestions="
(queryString, callback) => {
- querySearchAsync(queryString, callback, 'client');
+ querySearchAsync(queryString, callback, 'supplier');
}
"
value-key="name"
@@ -358,8 +358,12 @@
},
created() {
this.handleGetBomKindDictList();
+ this.$store.dispatch("getSupplier")
},
computed: {
+ supplierList() {
+ return this.$store.state.getSupplierName.supplierList
+ }
},
watch:{
'editCommonConfig.visible':{
@@ -557,8 +561,8 @@
// 閫夋嫨瀹㈡埛鐩稿叧鏂规硶
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))
diff --git a/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue b/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue
index a5dd842..0c11b8c 100644
--- a/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue
+++ b/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue
@@ -27,6 +27,7 @@
:table-list="tableList"
:select-box="false"
@selCommonClick="selNameClick"
+ @selTableCol="selTableCol"
>
</TableCommonView>
<div slot="footer" class="dialog-footer">
@@ -66,34 +67,54 @@
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
@@ -115,7 +136,8 @@
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 = []
}
diff --git a/src/views/purchaseManage/purchase/index.vue b/src/views/purchaseManage/purchase/index.vue
index ae0314a..4a12b42 100644
--- a/src/views/purchaseManage/purchase/index.vue
+++ b/src/views/purchaseManage/purchase/index.vue
@@ -63,6 +63,7 @@
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: {},
@@ -83,7 +84,9 @@
editConfig: {
visible: false,
title: "鍒涘缓",
- infomation: {}
+ infomation: {
+ supplierList:[]
+ }
},
purchaseStatusList: getDataByType("purchaseStatus"),
tableColumn: [
@@ -102,6 +105,7 @@
created() {
this.setTable()
this.getData()
+ this.getSupplierData()
},
methods: {
getpurchaseStatus(val) {
@@ -155,6 +159,20 @@
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 ?? ''
--
Gitblit v1.8.0