From b012ab3a1e5495be068c543eb8f0482124db13b5 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期六, 31 十二月 2022 16:48:22 +0800
Subject: [PATCH] 1.登录页文字跟随系统变化
---
src/views/zzmx/chda.vue | 234 ++++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 163 insertions(+), 71 deletions(-)
diff --git a/src/views/zzmx/chda.vue b/src/views/zzmx/chda.vue
index aec95f5..a75b867 100644
--- a/src/views/zzmx/chda.vue
+++ b/src/views/zzmx/chda.vue
@@ -30,12 +30,12 @@
<el-form
ref="form"
:model="form"
- label-width="80px"
+ label-width="100px"
inline
style="display: flex;justify-content: space-between"
>
<div class="elForm">
- <el-form-item label="鐗╂枡缂栫爜" style=" display: flex;">
+ <el-form-item label-width="70px" label="鐗╂枡缂栫爜" style=" display: flex;">
<el-input v-model="form.partcode" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item label="鐗╂枡鍚嶇О" style=" display: flex;">
@@ -78,7 +78,7 @@
/>
</el-select>
</el-form-item>
- <el-form-item label="鎵�灞炰粨搴�" style=" display: flex;">
+ <el-form-item v-show="isExpandForm" label-width="70px" label="鎵�灞炰粨搴�" style=" display: flex;">
<el-select
v-model="form.storehousecode"
filterable
@@ -96,11 +96,28 @@
</el-select>
</el-form-item>
</div>
- <div class="bodySearchReset">
+ <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}">
<el-button type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
<el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
</div>
</el-form>
+ <div
+ class="bodyTopFormExpand"
+ >
+ <svg-icon
+ v-show="mouseHoverType==='mouseout'"
+ style="cursor: pointer"
+ :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
+ @mouseenter="mouseHoverType=$event.type"
+ />
+ <svg-icon
+ v-show="mouseHoverType==='mouseenter'"
+ style="cursor: pointer"
+ :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
+ @click="isExpandForm=!isExpandForm"
+ @mouseout="mouseHoverType=$event.type"
+ />
+ </div>
</div>
<div class="elTableDiv">
@@ -109,8 +126,9 @@
class="tableFixed"
:data="tableData"
border
- :height="tableHeight"
+ :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
width="100%"
+ :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
:row-class-name="tableRowClassName"
highlight-current-row
:header-cell-style="this.$headerCellStyle"
@@ -129,6 +147,7 @@
/>
<el-table-column
prop="partcode"
+ show-tooltip-when-overflow
label="鐗╂枡缂栫爜"
min-width="160"
sortable="custom"
@@ -136,6 +155,7 @@
<el-table-column
prop="partname"
min-width="160"
+ show-tooltip-when-overflow
label="鐗╂枡鍚嶇О"
sortable="custom"
/>
@@ -143,6 +163,7 @@
prop="partspec"
label="鐗╂枡瑙勬牸"
width="110"
+ show-tooltip-when-overflow
sortable="custom"
>
<template slot-scope="{row}">
@@ -154,12 +175,14 @@
prop="uom_name"
label="鍗曚綅"
width="75"
+ show-tooltip-when-overflow
sortable="custom"
/>
<el-table-column
prop="stocktypename"
label="瀛樿揣绫诲瀷"
sortable="custom"
+ show-tooltip-when-overflow
min-width="110"
/>
<!-- <el-table-column-->
@@ -170,6 +193,7 @@
<el-table-column
prop="stck_name"
label="浠撳簱鍚嶇О"
+ show-tooltip-when-overflow
sortable="custom"
min-width="110"
>
@@ -182,6 +206,7 @@
prop="maxqty"
label="搴撳瓨涓婇檺"
width="110"
+ show-tooltip-when-overflow
sortable="custom"
>
<template slot-scope="{row}">
@@ -193,6 +218,7 @@
prop="minqty"
label="搴撳瓨涓嬮檺"
width="110"
+ show-tooltip-when-overflow
sortable="custom"
>
<template slot-scope="{row}">
@@ -202,6 +228,7 @@
</el-table-column>
<el-table-column
prop="lm_user"
+ show-tooltip-when-overflow
label="鍒涘缓浜哄憳"
sortable="custom"
width="110"
@@ -209,17 +236,19 @@
<el-table-column
prop="lm_date"
label="鍒涘缓鏃堕棿"
+ show-tooltip-when-overflow
sortable="custom"
width="160"
/>
<el-table-column
label="宸ヨ壓璺嚎"
width="80"
+ show-tooltip-when-overflow
prop="proute_id"
>
<template slot-scope="{row}">
<div class="operationClass">
- <i v-if="row.proute_id==='Y'" class="el-icon-share" @click="routeClick(row)" />
+ <i v-if="row.proute_id==='Y'" :style="{color:$store.state.settings.theme}" class="el-icon-share" @click="routeClick(row)" />
<i v-if="row.proute_id==='N'" style="color:rgb(180 ,181, 185)" class="el-icon-share" @click="routeClick(row)" />
</div>
</template>
@@ -232,10 +261,10 @@
<template slot-scope="{row}">
<div class="operationClass">
<el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
- <i class="el-icon-edit-outline" @click="edit('edit',row)" />
+ <i :style="{color:$store.state.settings.theme}" class="el-icon-edit-outline" @click="edit('edit',row)" />
</el-tooltip>
<el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
- <i class="el-icon-delete" @click="del(row)" />
+ <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" />
</el-tooltip>
</div>
</template>
@@ -354,7 +383,12 @@
<span slot="footer" class="dialog-footer">
<div class="footerButton">
<el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
- <el-button type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>
+ <el-button
+ type="primary"
+ :loading="$store.state.app.buttonIsDisabled"
+ :disabled="$store.state.app.buttonIsDisabled"
+ @click="dialogVisibleConfirm"
+ >纭� 瀹�</el-button>
</div>
</span>
</el-dialog>
@@ -393,6 +427,7 @@
/>
<el-table-column
prop="code"
+ show-tooltip-when-overflow
label="绫诲瀷缂栫爜"
sortable="custom"
>
@@ -404,6 +439,7 @@
<el-table-column
prop="name"
label="绫诲瀷鍚嶇О"
+ show-tooltip-when-overflow
sortable="custom"
>
<template slot-scope="{row}">
@@ -414,6 +450,7 @@
<el-table-column
prop="digdect"
label="灏忔暟浣嶆暟"
+ show-tooltip-when-overflow
sortable="custom"
>
<template slot-scope="{row}">
@@ -430,6 +467,7 @@
<el-table-column
prop="r_ule"
label="鍙栨暣瑙勫垯"
+ show-tooltip-when-overflow
sortable="custom"
>
@@ -489,44 +527,56 @@
title="鍏宠仈宸ヨ壓璺嚎"
:visible.sync="dialogVisibleRoute"
width="800px"
- top="10vh"
+ top="5vh"
:fullscreen="isIpad"
class="dialogVisibleRoute"
@closed="handleCloseRoute"
@close="handleCloseRoute"
>
<div>
- <i class="el-icon-s-comment" style="color:#42b983;" /> 浜у搧鍚嶇О锛歿{ dialogFormRoute.projectName }}
+ <i class="el-icon-s-comment" :style="{color:$store.state.settings.theme}" /> 浜у搧鍚嶇О锛歿{ dialogFormRoute.projectName }}
</div>
<el-divider />
<div style="margin-bottom: 10px">
- <i class="el-icon-s-operation" style="color:#42b983;" /> 宸ヨ壓璺嚎闆嗗悎
+ <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 宸ヨ壓璺嚎闆嗗悎
</div>
<div class="myCheckboxGroup">
<div
v-for="item in dialogFormRoute.routeOperationArr"
:key="item.code"
- :style="{border:item.isSelected1?'1px solid #42b983':'1px solid #eee'}"
+ :style="{border:item.isSelected1?'1px solid '+$store.state.settings.theme:'1px solid #eee'}"
class="myCheckbox"
@click="myCheckboxClick(item)"
>
- <input
- class="myCheckboxInput"
- type="checkbox"
- :value="item.code"
- :name="item.name"
- :style="{color:item.isSelected2?'#42b983':'#fff'}"
- @click="myCheckboxInputClick(item)"
- >{{ item.name }}
+ <!-- <input-->
+ <!-- class="myCheckboxInput"-->
+ <!-- type="checkbox"-->
+ <!-- :value="item.code"-->
+ <!-- :name="item.name"-->
+ <!-- :style="{color:item.isSelected2?'#42b983':'#fff'}"-->
+ <!-- @click="myCheckboxInputClick(item)"-->
+ <!-- >{{ item.name }}-->
<!-- 鐖跺瓙鐐瑰嚮浜嬩欢涓嶅奖鍝�-->
<!-- onClick="event.cancelBubble = true"-->
+ <el-checkbox
+ :key="item.code"
+ v-model="item.isSelected2"
+ class="myCheckboxInput"
+ :value="item.code"
+ :name="item.name"
+ :label="item.name"
+ :checked="item.isSelected2"
+ @change="myCheckboxInputClick(item)"
+ />
+ <div class="myCheckboxInputLabel">{{ item.name }}</div>
+
</div>
</div>
<el-divider />
<div>
- <i class="el-icon-s-operation" style="color:#42b983;" /> 榛樿宸ヨ壓璺嚎
+ <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 榛樿宸ヨ壓璺嚎
</div>
<div style="margin-top: 20px">
<el-select
@@ -546,7 +596,7 @@
</div>
<el-divider />
<div style="margin-bottom: 10px">
- <i class="el-icon-s-operation" style="color:#42b983;" /> 宸ュ簭鍒楄〃
+ <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 宸ュ簭鍒楄〃
</div>
<div style="overflow-y: scroll">
<el-table
@@ -567,20 +617,27 @@
/>
<el-table-column
prop="stepcode"
+ show-tooltip-when-overflow
label="宸ュ簭缂栫爜"
/>
<el-table-column
prop="stepname"
label="宸ュ簭鍚嶇О"
+ show-tooltip-when-overflow
/>
<el-table-column
prop="enable"
label="鍚敤鐘舵��"
+ show-tooltip-when-overflow
fixed="right"
>
<template slot-scope="{row}">
- <div v-if="row.enable==='Y'"><svg-icon icon-class="circleYes" style="margin-right: 2px" />鏄�</div>
- <div v-if="row.enable==='N'"><svg-icon icon-class="circleNo" style="margin-right: 2px" />鍚�</div>
+ <div v-if="row.enable==='Y'">
+ <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+ 鏄�</div>
+ <div v-if="row.enable==='N'">
+ <i class="el-icon-info" style="margin-right: 2px" />
+ 鍚�</div>
</template>
</el-table-column>
</el-table>
@@ -588,7 +645,12 @@
<span slot="footer" class="dialog-footer">
<div class="footerButton">
<el-button @click="routeDialogVisibleCancel">鍙� 娑�</el-button>
- <el-button type="primary" @click="routeDialogVisibleConfirm">纭� 瀹�</el-button>
+ <el-button
+ type="primary"
+ :loading="$store.state.app.buttonIsDisabled"
+ :disabled="$store.state.app.buttonIsDisabled"
+ @click="routeDialogVisibleConfirm"
+ >纭� 瀹�</el-button>
</div>
</span>
</el-dialog>
@@ -619,6 +681,8 @@
},
data() {
return {
+ mouseHoverType: 'mouseout',
+ isExpandForm: false,
isIpad: false,
mainHeight: 0,
tableHeight: 0,
@@ -927,12 +991,9 @@
},
// 瀵硅瘽妗嗙‘璁�
dialogVisibleConfirm() {
- if (this.defaultroute_codeArr.length > 0 && this.defaultroute_code === '') {
- return this.$message.info('榛樿宸ヨ壓璺嚎涓嶈兘涓虹┖锛�')
- }
-
this.$refs.dialogForm.validate(valid => {
if (valid) {
+ this.$store.state.app.buttonIsDisabled = true
const data = {
id: this.dialogForm.id,
materialcode: this.dialogForm.materialcode,
@@ -948,9 +1009,10 @@
}
AddUpdateInventoryFile(data).then(res => {
if (res.code === '200') {
- this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
this.dialogVisible = false
+ this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
this.getInventoryFileSelect()
+ this.$store.state.app.buttonIsDisabled = false
} else {
this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
}
@@ -962,7 +1024,7 @@
getHeight() {
this.$nextTick(() => {
this.mainHeight = window.innerHeight - 85
- this.tableHeight = this.mainHeight - 200
+ this.tableHeight = this.mainHeight - 255
if (window.innerHeight < 769) {
this.tableHeight = this.tableHeight - 40
}
@@ -972,46 +1034,60 @@
},
/* 鐐瑰嚮鍏宠仈宸ヨ壓璺嚎妯″潡*/
// 宸ヨ壓璺嚎鐐瑰嚮
- async routeClick(row) {
- console.log(row)
+ routeClick(row) {
+ const loading = this.$loading({
+ lock: true,
+ text: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...',
+ spinner: 'el-icon-loading',
+ customClass: 'osloading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ })
+
this.defaultroute_code = row.default_route
this.dialogFormRoute.projectCode = row.partcode
this.dialogFormRoute.projectName = row.partname
- this.dialogVisibleRoute = true
- const { data: res } = await InventoryFileAssociationRoute({ partcode: this.dialogFormRoute.projectCode })
- this.dialogFormRoute.routeOperationArr = res
- // let waitFlag = false// 鍥炴樉绛夊緟鏄惁鏀捐
- this.dialogFormRoute.routeOperationArr.forEach((item, index) => {
- item.isSelected1 = false
- item.isSelected2 = false
- if (index === 0) {
- item.isSelected1 = true
- this.projectTableData = item.Data
- }
- if (item.flag === 'Y') {
- item.isSelected2 = true
- this.$nextTick(() => {
- $('input:checkbox').eq(index).prop('checked', true)
- })
+ InventoryFileAssociationRoute({ partcode: this.dialogFormRoute.projectCode }).then(res => {
+ if (res.code === '200') {
+ setTimeout(() => {
+ loading.close()
+ this.dialogVisibleRoute = true
+ this.dialogFormRoute.routeOperationArr = res.data
+ // let waitFlag = false// 鍥炴樉绛夊緟鏄惁鏀捐
- // const interval = setInterval(() => {
- // if ($('input:checkbox').length > 0) {
- // waitFlag = true
- // }
- // if (waitFlag) {
- // clearInterval(interval)
- // this.$nextTick(() => {
- // $('input:checkbox').eq(index).prop('checked', true)
- // })
- // }
- // }, 100)
+ this.dialogFormRoute.routeOperationArr.forEach((item, index) => {
+ item.isSelected1 = false
+ item.isSelected2 = false
+ if (index === 0) {
+ item.isSelected1 = true
+ this.projectTableData = item.Data
+ }
+ if (item.flag === 'Y') {
+ item.isSelected2 = true
+ this.$nextTick(() => {
+ $('input:checkbox').eq(index).prop('checked', true)
+ })
+
+ // const interval = setInterval(() => {
+ // if ($('input:checkbox').length > 0) {
+ // waitFlag = true
+ // }
+ // if (waitFlag) {
+ // clearInterval(interval)
+ // this.$nextTick(() => {
+ // $('input:checkbox').eq(index).prop('checked', true)
+ // })
+ // }
+ // }, 100)
+ }
+ })
+
+ this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.flag === 'Y')
+ }, 1000)
+ } else {
+ loading.close()
}
})
-
- this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.flag === 'Y')
-
- console.log(this.defaultroute_codeArr, 123)
},
// 瀵硅瘽妗嗗叧闂�
handleCloseRoute() {
@@ -1024,8 +1100,8 @@
},
// 纭畾
async routeDialogVisibleConfirm() {
- const temp = this.dialogFormRoute.routeOperationArr.filter(item => item.isSelected2)
- if (this.defaultroute_code === '' && temp.length > 0) {
+ console.log(this.defaultroute_code)
+ if (this.defaultroute_code === null || this.defaultroute_code === 'null') {
return this.$message.info('榛樿宸ヨ壓璺嚎涓嶈兘涓虹┖锛�')
}
@@ -1036,12 +1112,13 @@
data.push({ code: item.code, name: item.name })
}
})
-
+ this.$store.state.app.buttonIsDisabled = true
const res = await SaveInventoryFile(this.dialogFormRoute.projectCode, this.defaultroute_code, data)
if (res.code === '200') {
+ this.dialogVisibleRoute = false
this.$message.success('淇濆瓨鎴愬姛锛�')
await this.getInventoryFileSelect()
- this.dialogVisibleRoute = false
+ this.$store.state.app.buttonIsDisabled = false
}
},
// 澶х洅瀛愮偣鍑讳簨浠�
@@ -1055,8 +1132,8 @@
},
// 灏忕洅瀛愮偣鍑讳簨浠�
myCheckboxInputClick(val) {
- console.log(val, 2)
- val.isSelected2 = !val.isSelected2
+ // console.log(val, 2)
+ val.isSelected2 = !!val.isSelected2
this.dialogFormRoute.routeOperationArr.forEach((item, index) => {
if (val.code === item.code) {
@@ -1202,10 +1279,19 @@
margin: 10px 30px 0 0;
border-radius: 5px;
cursor: default;
+ position: relative;
.myCheckboxInput {
margin: 1px 5px 0 0;
cursor: pointer;
+ }
+
+ .myCheckboxInputLabel {
+ position: absolute;
+ left: 29px;
+ padding: 5px;
+ top: 6px;
+ color: transparent;
}
}
@@ -1354,7 +1440,13 @@
}
</style>
<style>
+.osloading{
+ font-size: 26px !important;
+}
+.el-loading-text{
+ font-size: 26px !important;
+}
.el-table .custom-row {
background: #f8f8fa;
}
--
Gitblit v1.9.3