From 02b7655966b254a1c2b9f59006d52deb71aff3f4 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期二, 14 十一月 2023 11:30:49 +0800
Subject: [PATCH] 选择供应商组件优化、列表公共组件优化、创建采购单

---
 src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue |   59 +++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 35 insertions(+), 24 deletions(-)

diff --git a/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue b/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue
index 0c11b8c..9e553ad 100644
--- a/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue
+++ b/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue
@@ -31,7 +31,9 @@
         >
         </TableCommonView>
         <div slot="footer" class="dialog-footer">
-          <div class="remark">璇存槑锛氭敮鎸佸瀛楁妯$硦鏌ヨ锛屼粎鏄剧ず绗﹀悎鏉′欢鐨勫墠5鏉℃暟鎹�</div>
+          <div class="btn-pager">
+            <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+          </div>
         </div>
       </div>
     </el-dialog>
@@ -40,8 +42,11 @@
 
 <script>
 import { getSupplierList } from "@/api/supplierManage/supplier"
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+
 export default {
   name: "EditSelClientDialog",
+  mixins: [pageMixin],
   props: {
     editCommonConfig: {
       type: Object,
@@ -58,7 +63,7 @@
   computed: {},
   data() {
     return {
-      dialogWidth: "50%",
+      dialogWidth: "40%",
       editConfig: this.editCommonConfig,
       queryInput: "",
       select: "1",
@@ -69,8 +74,8 @@
       tableList: {},
       search_map: {},
       tableColumn: [
-        { label: "渚涘簲鍟嗙紪鍙�", prop: "number", min: 190, isCommonClick: true },
-        { label: "渚涘簲鍟嗗悕绉�", prop: "name", min: 130 },
+        { label: "渚涘簲鍟嗙紪鍙�", prop: "number", min: 190 },
+        { label: "渚涘簲鍟嗗悕绉�", prop: "name", min: 130, isCommonClick: true },
         { label: "渚涘簲鍟嗙被鍨�", prop: "supplierType", min: 130 },
         { label: "鎵�灞炶涓�", prop: "industry", min: 130 },
         { label: "鑱旂郴浜�", prop: "contact", min: 130 },
@@ -78,25 +83,23 @@
         { label: "鐘舵��", prop: "status_name", min: 130 },
         { label: "鍒涘缓鏃堕棿", prop: "member_name", min: 130 }
       ],
-      showCol: ['渚涘簲鍟嗙紪鍙�', '渚涘簲鍟嗗悕绉�', '渚涘簲鍟嗙被鍨�', '鎵�灞炶涓�', '鑱旂郴浜�', '鑱旂郴鐢佃瘽','鐘舵��','鍒涘缓鏃堕棿']
-
+      showCol: ["渚涘簲鍟嗙紪鍙�", "渚涘簲鍟嗗悕绉�", "渚涘簲鍟嗙被鍨�", "鑱旂郴浜�", "鑱旂郴鐢佃瘽", "鐘舵��"]
     }
   },
   created() {
     this.setTable()
     this.getData()
   },
-  mounted(){
-  },
+  mounted() {},
   methods: {
     setTable() {
       this.tableList = {
         tableInfomation: [],
-        tableColumn:this.setColumnVisible(this.showCol),
+        tableColumn: this.setColumnVisible(this.showCol),
         showcol: this.showCol,
-        allcol:[]
+        allcol: []
       }
-      this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
+      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
@@ -105,14 +108,14 @@
       }
     },
     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=>{
+    setColumnVisible(showCol) {
+      return this.tableColumn.map((ele) => {
         return {
           ...ele,
-          isShowColumn:showCol.includes(ele.label)
+          isShowColumn: showCol.includes(ele.label)
         }
       })
     },
@@ -122,22 +125,23 @@
     // 璇锋眰鏁版嵁
     async getData(val, content) {
       this.loading = true
+
       await getSupplierList({
         [val]: content,
-        page:1,
-        pageSize: 10
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize
       })
         .then((res) => {
-          if (res.data.code == 200) {
-            if (res.data.data.list && res.data.data.list.length > 0) {
-              const list = res.data.data.list.map((item) => {
+          if (res.code == 200) {
+            if (res.data.list && res.data.list.length > 0) {
+              const list = res.data.list.map((item) => {
                 return {
                   ...item,
                   status_name: item.status === 0 ? "鏈惎鐢�" : "鍚敤"
                 }
               })
-              // this.tableList.tableInfomation = list.slice(0, 5) || []
               this.tableList.tableInfomation = list
+              this.pagerOptions.totalCount = res.data.total
             } else {
               this.tableList.tableInfomation = []
             }
@@ -192,9 +196,16 @@
   cursor: pointer;
 }
 .dialog-footer {
-  height: 40px;
-  line-height: 40px;
+  height: 50px;
+  line-height: 50px;
   color: red;
+  .btn-pager {
+    display: flex;
+    margin-top: 0px;
+    .page {
+      margin-left: auto;
+    }
+  }
 }
 ::v-deep {
   .input-with-select .el-input-group__prepend {

--
Gitblit v1.8.0