From 1ccee4c44055c977374a7675063cd241ccfcfe5b Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 07 五月 2024 18:23:51 +0800
Subject: [PATCH] 纤度检验表 车间不显示的问题修改
---
src/views/systemSetting/dataDictionary/index.vue | 352 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 345 insertions(+), 7 deletions(-)
diff --git a/src/views/systemSetting/dataDictionary/index.vue b/src/views/systemSetting/dataDictionary/index.vue
index 43c4ab0..a1c12dc 100644
--- a/src/views/systemSetting/dataDictionary/index.vue
+++ b/src/views/systemSetting/dataDictionary/index.vue
@@ -1,21 +1,359 @@
<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>
+ </template>
+ </CommonSearch>
+ </div>
+ <div class="body-card">
+ <div class="list-view">
+ <div class="bottom-tabs" >
+ <div class="tab-pane" @click="getTab(0)" :style="{
+ background: TabsIndex == 0 ? '#2a78fb' : '#F1F3F8',
+ color: TabsIndex == 0 ? '#fff' : '#666'
+ }">
+ 搴勫彛绠$悊
+ </div>
+ <div class="tab-pane" @click="getTab(1)" :style="{
+ background: TabsIndex == 1 ? '#2a78fb' : '#F1F3F8',
+ color: TabsIndex == 1 ? '#fff' : '#666'
+ }">
+ 杞﹂棿绠$悊
+ </div>
+ <div class="tab-pane" @click="getTab(2)" :style="{
+ background: TabsIndex == 2 ? '#2a78fb' : '#F1F3F8',
+ color: TabsIndex == 2 ? '#fff' : '#666'
+ }">
+ 甯﹀彿棰滆壊
+ </div>
+ <div class="tab-pane" @click="getTab(3)" :style="{
+ background: TabsIndex == 3 ? '#2a78fb' : '#F1F3F8',
+ color: TabsIndex == 3 ? '#fff' : '#666'
+ }">
+ 瑙勬牸
+ </div>
+ </div>
+ <div >
+ <TableCommonView :loading="loading" :table-list="productTableList" @selTableCol="selBottomTableCol">
+ <template slot="tableButton">
+ <el-table-column label="鎿嶄綔" width="160" fixed="right">
+ <template slot-scope="scope">
+ <!-- <el-button>{{ scope.row }}</el-button> -->
+ <el-button @click="rowClick(scope.row,'鏌ョ湅')" type="text" size="small">鏌ョ湅</el-button>
+ <el-button @click="rowClick(scope.row,'淇敼')" type="text" size="small">淇敼</el-button>
+ <el-button @click="rowClick(scope.row,'鍒犻櫎')" type="text" size="small">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </template>
+ </TableCommonView>
+ </div>
+ </div>
+ <div class="btn-pager">
+ <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+ </div>
+ </div>
+ <AddDataDictionaries
+ :editDiaConfig="editConfig"
+ />
+ </div>
</template>
<script>
+import AddDataDictionaries from "@/views/systemSetting/dataDictionary/components/addDataDictionaries.vue"
+import {getDict,deleteDict} from "@/api/systemSetting/dataDictionary"
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
export default {
name: "dataDictionary",
props: {},
- components: {},
- mixins: [],
+ components: {AddDataDictionaries},
+ mixins: [pageMixin],
computed: {},
data() {
- return {}
+ return {
+ TabsIndex:0,
+ loading: false,
+ productTableList: {},
+ editConfig:{
+ visible:false,
+ dialogTitleType:"搴勫彛",
+ infomitton:{
+ TabsIndex:0,
+ }
+ },
+ tableColumn: [
+ { label: "搴忓彿", prop: "number",},
+ { label: "搴勫彛鍚嶇О", prop: "name",},
+ { label: "鎻忚堪", prop: "remark" },
+ ],
+ showCol: ["搴忓彿","搴勫彛鍚嶇О", "鎻忚堪",],
+ workshopTableColumn:[
+ { label: "缂栫爜", prop: "number" },
+ { label: "杞﹂棿鍚嶇О", prop: "name" },
+ { label: "鎻忚堪", prop: "remark" },
+ ],
+ showWorkshopCol: ["缂栫爜","杞﹂棿鍚嶇О", "鎻忚堪",],
+ colorTableColumn:[
+ { label: "甯﹀彿棰滆壊", prop: "name" },
+ { label: "鎻忚堪", prop: "remark" },
+ ],
+ showColorCol: ["甯﹀彿棰滆壊", "鎻忚堪",],
+ specsTableColumn:[
+ { label: "瑙勬牸", prop: "name" },
+ { label: "鎻忚堪", prop: "remark" },
+ ],
+ showSpecsCol: ["瑙勬牸", "鎻忚堪",],
+ getDataParams:{
+ page: 1,
+ pageSize:10,
+ dictType:0,
+ keyword:""
+ },
+ }
},
- created() {},
- methods: {}
+ created() {
+ this.getProductOrderInfo()
+ // this.setTable()
+ this.getData()
+ },
+ methods: {
+ // 鎼滅储
+ onFilterSearch(searchText) {
+ this.getDataParams.keyword=searchText,
+ this.pagerOptions.currPage = 1;
+ this.getData()
+ },
+ // 鏂板
+ addBtnClick() {
+ this.editConfig.dialogTitle="鏂板"
+ this.editConfig.infomitton={}
+ this.editConfig.infomitton.TabsIndex=this.TabsIndex
+ this.editConfig.visible=true
+ },
+ // 鍒锋柊
+ refreshClick() {
+ this.getDataParams.keyword = ""
+ this.pagerOptions.currPage = 1
+ this.pagerOptions.pageSize = 15
+ this.$refs.searchRef.searchInput=""
+ this.TabsIndex=0,
+ this.getData()
+ },
+ // 鎵撳嵃
+ printClick() {
+ console.log("a")},
+ //tabs鍒囨崲
+ getTab(tab) {
+ this.TabsIndex = tab
+ this.editConfig.infomitton.TabsIndex=tab
+ // if (this.TabsIndex == 1) {
+ // this.isRequest = true;
+ // } else {
+ // this.isRequest = false;
+ // }
+ this.getProductOrderInfo()
+ },
+ // setTable() {
+ // this.tableBottomColumn = this.tableColumn
+ // this.showBottomCol = this.showCol
+ // this.setBottomList()
+ // },
+ selTableCol(val) {
+ this.showcol = val
+ this.tableList.tableColumn = this.setColumnVisible(val, this.tableColumn)
+ },
+ async getProductOrderInfo() {
+ this.getData()
+ if (this.TabsIndex == 0) {
+ // 搴勫彛绠$悊
+ this.editConfig.dialogTitleType="搴勫彛"
+ this.tableBottomColumn = this.tableColumn // 琛ㄥご
+ this.showBottomCol = this.showCol // 鍔ㄦ�佽〃澶�
+ this.setBottomList()
+ }else if (this.TabsIndex == 1) {
+ // 杞﹂棿绠$悊
+ this.editConfig.dialogTitleType="杞﹂棿"
+ this.tableBottomColumn = this.workshopTableColumn
+ this.showBottomCol = this.showWorkshopCol
+ this.setBottomList()
+ } else if (this.TabsIndex == 2) {
+ // 甯﹀彿棰滆壊
+ this.editConfig.dialogTitleType="甯﹀彿棰滆壊"
+ this.tableBottomColumn = this.colorTableColumn
+ this.showBottomCol = this.showColorCol
+ this.setBottomList()
+
+ } else if (this.TabsIndex == 3) {
+ // 瑙勬牸
+ this.editConfig.dialogTitleType="瑙勬牸"
+ this.tableBottomColumn = this.specsTableColumn
+ this.showBottomCol = this.showSpecsCol
+ this.setBottomList()
+ }
+
+ this.loading = true
+ // this.getProductInventoryInfo(number)
+ // await getProductOrderInfo(number)
+ // .then((res) => {
+ // this.productDataBottom = res;
+ // this.getListValue(this.productDataBottom)
+ // })
+ // .catch(() => {
+ // this.productTableList.tableInfomation = []
+ // })
+ this.loading = false
+ },
+ setBottomList() {
+ this.productTableList = {
+ selectIndex: true,
+ tableInfomation: [],
+ allcol: [],
+ showcol: this.showBottomCol,
+ tableColumn: this.setColumnVisible(this.showBottomCol, this.tableBottomColumn)
+ }
+ this.setTableList(this.productTableList)
+ },
+ selBottomTableCol(val) {
+ this.showcol = val
+ this.productTableList.tableColumn = this.setColumnVisible(val, this.tableBottomColumn)
+ },
+ 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 })
+ }
+ },
+ setColumnVisible(showCol, tableColumn) {
+ return tableColumn.map((ele) => {
+ return {
+ ...ele,
+ isShowColumn: showCol.includes(ele.label)
+ }
+ })
+ },
+ getData(){
+ getDict({
+ dictType:this.TabsIndex,
+ page: this.pagerOptions.currPage,
+ pageSize: this.pagerOptions.pageSize,
+ keyword:this.getDataParams.keyword,
+ }).then((res)=>{
+ this.productTableList.tableInfomation=res.data
+ this.pagerOptions.totalCount = res.total
+ })
+ },
+ rowClick(row,type){
+ if(type!=="鍒犻櫎"){
+ this.editConfig.dialogTitle=type
+ this.editConfig.visible=true
+ this.editConfig.infomitton={...row,TabsIndex:this.TabsIndex}
+ }else if(type==="鍒犻櫎"){
+ this.$confirm('纭鍒犻櫎鍚�?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteDict({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;
+ }
+ }
+ }
+}
+
+.bottom-tabs {
+ height: 40px;
+ line-height: 40px;
+ // background: #e6ecf2;
+ display: flex;
+
+ .tab-pane {
+ width: 100px;
+ margin-right: 20px;
+ font-size: 14px !important;
+ text-align: center;
+ cursor: pointer;
+ background: #2a78fb;
+ border-top-left-radius: 20px;
+ border-top-right-radius: 20px;
+ }
+}
+
+.bgcGrey {
+ background: #fff;
+}
+
+.bgcWhite {
+ background: #fff !important;
+}
+
+.list-view {
+ height: calc(100% - 60px);
+ overflow: hidden;
+}
+.btn-pager {
+ display: flex;
+ margin-top: 10px;
+ .page {
+ margin-left: auto;
+ }
+}
+</style>
--
Gitblit v1.8.0