From 25bfdf783be9c8e34afcec8106c39e17aa66a1e2 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期一, 29 四月 2024 15:56:43 +0800
Subject: [PATCH] 纤度检验表的 车间显示问题处理

---
 src/views/systemSetting/silkPriceStandard/index.vue |  235 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 228 insertions(+), 7 deletions(-)

diff --git a/src/views/systemSetting/silkPriceStandard/index.vue b/src/views/systemSetting/silkPriceStandard/index.vue
index da4f3d5..c739e6e 100644
--- a/src/views/systemSetting/silkPriceStandard/index.vue
+++ b/src/views/systemSetting/silkPriceStandard/index.vue
@@ -1,21 +1,242 @@
 <template>
-  <div class="container"></div>
+  <div class="silkStandardSetting-container">
+    <div class="filter-card">
+      <CommonSearch ref="searchRef" :show-add="false" :amount-view="false" placeholder="璇疯緭鍏ュ叧閿瘝" @searchClick="onFilterSearch">
+        <template slot="leftButton">
+          <el-button size="small" type="primary" @click="addBtnClick" >鏂板</el-button>
+          <el-button size="small" type="primary" @click="refreshClick">鍒锋柊</el-button>
+          <el-button size="small" type="primary" @click="printClick">鎵撳嵃</el-button>
+        </template>
+      </CommonSearch>
+    </div>
+    <div class="body-card">
+      <div  class="list-view">
+        <TableCommonView
+          :table-list="tableList"
+          @selTableCol="selTableCol"
+          @tableRowClick="tableRowClick"
+        >
+          <template slot="tableButton">
+            <el-table-column label="鎿嶄綔" width="180">
+              <template slot-scope="scope">
+                <el-button @click.stop="handleClick(scope.row, '鏌ョ湅')" type="text" size="small">鏌ョ湅</el-button>
+                <el-button @click.stop="handleClick(scope.row, '淇敼')" type="text" size="small">淇敼</el-button>
+                <el-button @click.stop="handleClick(scope.row, '鍒犻櫎')" type="text" size="small">鍒犻櫎</el-button>
+                
+              </template>
+            </el-table-column>
+          </template>
+        </TableCommonView>
+      </div>
+      <div class="btn-pager">
+        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+      </div>
+    </div>
+    
+    <AddDialog 
+      :editDiaConfig="editConfig"
+    />
+  </div>
 </template>
 
 <script>
+import AddDialog from "@/views/systemSetting/silkPriceStandard/components/addDialog"
+import {getPriceStandardList,deletePriceStandard} from "@/api/systemSetting/silkPriceStandard"
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 export default {
   name: "silkPriceStandard",
   props: {},
-  components: {},
-  mixins: [],
+  components: { AddDialog },
+  mixins: [pageMixin],
   computed: {},
   data() {
-    return {}
+    return {
+      tableList: {},
+      showCol: ["搴勫彛", "鐢熶笣绛夌骇", "钖叕鏍囧噯", "鍗曚綅", "澶囨敞"],
+      tableColumn: [
+        { label: "搴勫彛", prop: "marketName",},
+        { label: "鐢熶笣绛夌骇", prop: "rawSilkGrade", },
+        { label: "钖叕鏍囧噯", prop: "payStandard" },
+        { label: "鍗曚綅", prop: "unit" },
+        { label: "澶囨敞", prop: "notes", },
+      ],
+      editConfig:{
+        visible:false,
+        infomitton:{
+
+        }
+      },
+      getDataParams:{
+        keyWord:"",
+        // page: this.pagerOptions.currPage,
+        // pageSize: this.pagerOptions.pageSize
+      }
+    }
   },
-  created() {},
-  methods: {}
+  created() {
+    this.setTable()
+    this.getData()
+  },
+  methods: {
+    // 鎼滅储
+    onFilterSearch(searchText) {
+      this.getDataParams.keyWord = searchText
+      this.pagerOptions.currPage = 1
+      this.getData()
+    },
+    // 鏂板
+    addBtnClick() {
+      this.editConfig.infomitton={}
+      this.editConfig.dialogTitle="鏂板"
+      this.editConfig.visible=true
+    },
+    // 淇濆瓨
+    saveBtnClick(){
+    },
+    // 鍒锋柊
+    refreshClick() {
+      this.getDataParams.keyWord = ""
+      this.pagerOptions.currPage = 1
+      this.pagerOptions.pageSize = 15
+      this.$refs.searchRef.searchInput=""
+      this.getData()
+
+    },
+    // 鎵撳嵃
+    printClick() {},
+    // 鍒楄〃杈撳叆鍥炶皟
+    inputContent(val, prop, row) {
+      console.log(val, prop, row,"鍒楄〃鎵撳嵃鍥炶皟")
+    },
+    setTable() {
+      // top 鏄庣粏鍗曞垪琛�
+      this.tableList = {
+        selectIndex: true,
+        tableInfomation: [],
+        allcol: [],
+        showcol: this.showCol,
+        tableColumn: this.setColumnVisible(this.showCol, this.tableColumn)
+      }
+      this.setTableList(this.tableList)
+    },
+    setColumnVisible(showCol, tableColumn) {
+      return tableColumn.map((ele) => {
+        return {
+          ...ele,
+          isShowColumn: showCol.includes(ele.label)
+        }
+      })
+    },
+    setTableList(tableList) {
+      tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
+      this.searchOptions = []
+      for (let i = 0; i < tableList.tableColumn.length; i++) {
+        const label = tableList.tableColumn[i].label
+        const value = tableList.tableColumn[i].prop
+        this.searchOptions.push({ value: value, label: label })
+      }
+    },
+    selTableCol(val) {
+      this.showcol = val
+      this.tableList.tableColumn = this.setColumnVisible(val, this.tableColumn)
+    },
+    // 琛ㄦ牸琛岀偣鍑�
+    tableRowClick(row){
+      console.log(row,"row")
+    },
+    async getData(){
+      await getPriceStandardList({
+        keyWord:this.getDataParams.keyWord,
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize
+      }).then((res)=>{
+        if(res&&res.code===200){
+          this.tableList.tableInfomation=res.data
+          this.pagerOptions.totalCount = res.total
+        }
+      })
+    },
+    handleClick(row,type){
+      if(type!=="鍒犻櫎"){
+        this.editConfig.infomitton={
+            ...row,
+            market:{
+            ID:row.marketId,
+            name:row.marketName,
+          }
+        }
+        this.editConfig.dialogTitle=type
+        this.editConfig.visible=true
+      }else if(type==="鍒犻櫎"){
+        this.$confirm(`纭鍒犻櫎鍚�?`, '鎻愮ず', {
+          confirmButtonText: '纭畾',
+          cancelButtonText: '鍙栨秷',
+          type: 'warning'
+        }).then(() => {
+          deletePriceStandard({id:row.ID}).then((res)=>{
+            if(res&&res.code===200){
+              this.pagerOptions.currPage = 1;
+              this.getData()
+              this.$message({
+                type: 'success',
+                message: '鍒犻櫎鎴愬姛!'
+              });
+            }
+          })
+        }).catch(() => {
+          console.log("鍙栨秷鍒犻櫎")
+        });
+      }
+    }
+  }
 }
 </script>
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.silkStandardSetting-container {
+  height: 100%;
+  .filter-card {
+    margin: 20px 30px;
+    height: 80px;
+    display: flex;
+    align-items: center;
+    padding: 0 20px 0 20px;
+    border-radius: 4px;
+    background-color: #fff;
+  }
+  .body-card {
+    margin: 0 30px;
+    background-color: #fff;
+    padding: 10px 15px;
+    height: calc(100% - 180px);
+    border-radius: 4px;
+    .edit-save {
+      display: flex;
+      align-items: center;
+      margin-bottom: 10px;
+      .edit-save-icon {
+        font-size: 24px;
+        color: #5582f3;
+        cursor: pointer;
+      }
+      .edit-sace-label {
+        margin-left: 10px;
+        font-size: 14px;
+        color: #000000d8;
+      }
+    }
+  }
+}
+.list-view {
+  height: calc(100% - 60px);
+  overflow: hidden;
+}
+.btn-pager {
+  display: flex;
+  margin-top: 10px;
+  .page {
+    margin-left: auto;
+  }
+}
+</style>

--
Gitblit v1.8.0