From caeb71b06d19a8ffd854c19e5e4b58f7180cdce8 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期一, 29 四月 2024 18:55:14 +0800 Subject: [PATCH] 纤度检验表的保存接口参数修改 --- src/views/systemSetting/workshopManage/index.vue | 154 +++++++++++++++++++++++++++++---------------------- 1 files changed, 87 insertions(+), 67 deletions(-) diff --git a/src/views/systemSetting/workshopManage/index.vue b/src/views/systemSetting/workshopManage/index.vue index 2864e5a..5d500cf 100644 --- a/src/views/systemSetting/workshopManage/index.vue +++ b/src/views/systemSetting/workshopManage/index.vue @@ -1,57 +1,51 @@ <template> <div class="silkStandardSetting-container"> <div class="filter-card"> - <CommonSearch :show-add="false" :amount-view="false" placeholder="璇疯緭鍏ュ叧閿瘝" @searchClick="onFilterSearch"> + <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="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> - <TableCommonView - :table-list="tableList" - @selTableCol="selTableCol" - @handleShow="handleShow" - @tableRowClick="tableRowClick" - > + <div class="list-view"> + <TableCommonView :table-list="tableList" @selTableCol="selTableCol" @handleShow="handleShow" + @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> - <AddWorkshop - ref="bomTypeDialog" - @handleConfirmSave="handleConfirmSave" - :workList="workList" - title="娣诲姞鑺傜偣绫诲瀷" - /> - <AddDataDictionaries - :editDiaConfig="editConfig" - /> + <AddWorkshop ref="bomTypeDialog" @handleConfirmSave="handleConfirmSave" :workList="workList" title="娣诲姞鑺傜偣绫诲瀷" /> + <AddDataDictionaries :editDiaConfig="editConfig" /> </div> </template> <script> import AddDataDictionaries from "@/views/systemSetting/workshopManage/components/addDialog.vue" -import { getWorkshopManageList,deleteWorkshopManage } from "@/api/systemSetting/workshopManage" +import { getWorkshopManageList, deleteWorkshopManage } from "@/api/systemSetting/workshopManage" import TableCommonView from '@/components/makepager/TableCommonView.vue' import AddWorkshop from '@/views/systemSetting/workshopManage/components/addWorkshop.vue' +import pageMixin from "@/components/makepager/pager/mixin/pageMixin" export default { name: "workshopManage", props: {}, - components: { TableCommonView,AddWorkshop,AddDataDictionaries }, - mixins: [], + components: { TableCommonView, AddWorkshop, AddDataDictionaries }, + mixins: [pageMixin], computed: {}, data() { return { @@ -59,25 +53,23 @@ showCol: ["杞﹂棿", "缁勫埆", "寮�濮嬭溅鍙�", "缁撴潫杞﹀彿", "鍗婅溅鏍囧織", "澶囨敞"], tableColumn: [ // { label: "杞﹂棿", prop: "workshopNumber",iconRight:"el-icon-setting"}, - { label: "杞﹂棿", prop: "workshopNumber",}, + { label: "杞﹂棿", prop: "workshopName", }, { label: "缁勫埆", prop: "groupNumber", }, { label: "寮�濮嬭溅鍙�", prop: "startCarNumber" }, { label: "缁撴潫杞﹀彿", prop: "endCarNumber" }, - { label: "鍗婅溅鏍囧織", prop: "carFlag",isCallMethod: true, getCallMethod: this.getStatusCarFlag }, + { label: "鍗婅溅鏍囧織", prop: "carFlag", isCallMethod: true, getCallMethod: this.getStatusCarFlag }, { label: "澶囨敞", prop: "notes", }, ], // 绫诲瀷 workList: [], getDataParams: { - page: 1, - pageSize: 10, keyWord: '', }, - editConfig:{ - visible:false, - infomitton:{ - TabsIndex:0, - workshopId:null, + editConfig: { + visible: false, + infomitton: { + TabsIndex: 0, + workshopId: null, } }, } @@ -88,7 +80,6 @@ }, methods: { setTable() { - console.log(this.tableColumn,"鐪嬬湅") // top 鏄庣粏鍗曞垪琛� this.tableList = { selectIndex: true, @@ -121,34 +112,39 @@ this.tableList.tableColumn = this.setColumnVisible(val, this.tableColumn) }, // 琛ㄦ牸琛岀偣鍑� - tableRowClick(row){ - console.log(row,"row") + tableRowClick(row) { + console.log(row, "row") }, // 鎼滅储 onFilterSearch(searchText) { - console.log(searchText,"鏄暐") - this.getDataParams.keyWord=searchText, - this.getData() + this.getDataParams.keyWord = searchText, + this.pagerOptions.currPage = 1; + this.getData() }, // 鏂板 addBtnClick() { - this.editConfig.infomitton=[] - this.editConfig.dialogTitle="鏂板" - this.editConfig.visible=true + this.editConfig.infomitton = {} + this.editConfig.dialogTitle = "鏂板" + this.editConfig.visible = true }, // 淇濆瓨 - saveBtnClick(){ + saveBtnClick() { }, // 鍒锋柊 - refreshClick() {}, + refreshClick() { + this.getDataParams.keyWord = "" + this.pagerOptions.currPage = 1 + this.pagerOptions.pageSize = 15 + this.$refs.searchRef.searchInput = "" + this.getData() + }, // 鎵撳嵃 - printClick() {}, + printClick() { }, // 鍒犻櫎 - delBtnClick(){}, + delBtnClick() { }, // 缁勫埆 - handleShow(item){ - console.log(item,"item") + handleShow() { this.$refs.bomTypeDialog.editDialogVisible = true; }, handleGetBomKindDictList() { @@ -157,7 +153,7 @@ // }); }, handleConfirmSave(data) { - console.log(data,"data") + console.log(data) // postSaveBomKindDict({ data: data }).then((res) => { // if (res.code == 200) { // this.$message({ @@ -173,10 +169,11 @@ async getData() { await getWorkshopManageList({ keyWord: this.getDataParams.keyWord, - page: this.getDataParams.page, - pageSize: this.getDataParams.pageSize, + page: this.pagerOptions.currPage, + pageSize: this.pagerOptions.pageSize }).then((res) => { this.tableList.tableInfomation = res.data + this.pagerOptions.totalCount = res.total }) }, getStatusCarFlag(val) { @@ -186,34 +183,38 @@ return "--"; } }, - handleClick(row,type){ - console.log(row,"row") - if(type==="鏌ョ湅"){ - this.editConfig.infomitton=row - this.editConfig.infomitton.workshopId=row.ID - this.editConfig.dialogTitle=type - this.editConfig.visible=true - }else if(type==="淇敼"){ - this.editConfig.infomitton=row - this.editConfig.infomitton.workshopId=row.ID - this.editConfig.dialogTitle=type - this.editConfig.visible=true - }else if(type==="鍒犻櫎"){ - this.$confirm(`纭鍒犻櫎${row.name}鍚�?`, '鎻愮ず', { + handleClick(row, type) { + if (type !== "鍒犻櫎") { + this.editConfig.infomitton = { + ...row, + workshop:{ + number:row.workshopNumber, + name:row.workshopName + } + } + this.editConfig.infomitton.workshopId = row.ID + this.editConfig.infomitton.workshopNumber = Number(this.editConfig.infomitton.workshopNumber) + this.editConfig.dialogTitle = type + this.editConfig.visible = true + } else if (type === "鍒犻櫎") { + this.$confirm(`纭鍒犻櫎鍚�?`, '鎻愮ず', { confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - deleteWorkshopManage({id:row.ID}).then((res)=>{ - if(res&&res.code===200){ - this.getData() + deleteWorkshopManage({ id: row.ID }).then((res) => { + if (res && res.code === 200) { this.$message({ type: 'success', message: '鍒犻櫎鎴愬姛!' }); + this.pagerOptions.currPage = 1; + this.getData() } }) - }) + }).catch(() => { + console.log("鍙栨秷鍒犻櫎") + }); } } } @@ -224,6 +225,7 @@ <style lang="scss" scoped> .silkStandardSetting-container { height: 100%; + .filter-card { margin: 20px 30px; height: 80px; @@ -233,21 +235,25 @@ 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; @@ -256,5 +262,19 @@ } } } + +.list-view { + height: calc(100% - 60px); + overflow: hidden; +} + +.btn-pager { + display: flex; + margin-top: 10px; + + .page { + margin-left: auto; + } +} </style> -- Gitblit v1.8.0