From a169bda5b19db4714d2aa476504e58105228cc40 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 30 五月 2023 18:01:55 +0800
Subject: [PATCH] 1.对接移动端
---
src/views/zzmx/jpgj.vue | 82 +++++++++++++++++++++++++++--------------
1 files changed, 54 insertions(+), 28 deletions(-)
diff --git a/src/views/zzmx/jpgj.vue b/src/views/zzmx/jpgj.vue
index 21bd725..681286f 100644
--- a/src/views/zzmx/jpgj.vue
+++ b/src/views/zzmx/jpgj.vue
@@ -16,21 +16,20 @@
style="display: flex;justify-content: space-between"
>
<div class="elForm">
- <el-form-item label-width="70px" label="浜у搧鍚嶇О" style=" display: flex;">
+ <el-form-item label="浜у搧鍚嶇О/缂栫爜" style=" display: flex;">
<el-select
v-model="form.partcode"
filterable
:popper-append-to-body="false"
style="width: 200px"
placeholder="璇烽�夋嫨"
-
@change="partChange"
>
<!-- @focus="getPartSelect"-->
<el-option
v-for="item in partArr"
:key="item.partcode"
- :label="item.partname"
+ :label="item.partname+' / '+item.partcode"
:value="item.partcode"
/>
</el-select>
@@ -131,8 +130,9 @@
<el-table-column
prop="partname"
label="浜у搧鍚嶇О"
- min-width="160"
+ min-width="300"
sortable="custom"
+ show-tooltip-when-overflow
/>
<el-table-column
prop="partspec"
@@ -256,7 +256,6 @@
style="width: 220px"
placeholder="璇烽�夋嫨"
:popper-append-to-body="false"
-
@change="partDialogChange"
>
<!-- @focus="getPartSelect2"-->
@@ -328,14 +327,15 @@
class="tableFixed"
:data="eqpDialogArr"
:height="tableHeight"
- :style="{width: 100+'%',height:tableHeight-50+'px',}"
+ :style="{width: 100+'%',height:tableHeight-50+'px'}"
border
:row-class-name="tableRowClassName"
- highlight-current-row
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
+ highlight-current-row
@sort-change="dialogSortChange"
>
+ <!-- @row-click="rowClick"-->
<el-table-column
width="50"
label="搴忓彿"
@@ -344,25 +344,29 @@
/>
<el-table-column
prop="eqpcode"
- label="璁惧缂栫爜"
+ :label="eqpTable.steptype==='W'?'渚涘簲鍟嗙紪鐮�':'璁惧缂栫爜'"
sortable="custom"
- min-width="110"
+ show-tooltip-when-overflow
+ min-width="120"
/>
<el-table-column
prop="eqpname"
- label="璁惧鍚嶇О"
- min-width="110"
+ :label="eqpTable.steptype==='W'?'渚涘簲鍟嗗悕绉�':'璁惧鍚嶇О'"
+ min-width="120"
+ show-tooltip-when-overflow
sortable="custom"
/>
<el-table-column
prop="wksp_name"
sortable="custom"
label="鐢熶骇杞﹂棿"
+ show-tooltip-when-overflow
min-width="110"
/>
<el-table-column
sortable="custom"
prop="eqp_value"
+ show-tooltip-when-overflow
label="璁惧鑺傛媿"
width="110"
>
@@ -533,6 +537,7 @@
partcode: '',
routecode: '',
stepcode: '',
+ steptype: '',
page: 1,
rows: 10,
prop: 'eqpcode',
@@ -545,6 +550,7 @@
editStepName: '', // 缂栬緫鏃跺姞宸ュ伐搴忓悕绉�
operation: '',
dialogFormRules: {},
+ radioChangeTempValue: '',
title_value: '鏁版嵁瀵煎叆 / 鑺傛媿宸ヤ环',
code: '24',
@@ -639,15 +645,18 @@
this.routeDialogArr = res
this.stepDialogArr = []
this.eqpDialogArr = []
+ this.dialogForm.routecode = ''
},
async routeDialogChange(val) {
const { data: res } = await RouteSelectStep({ routecode: val })
this.stepDialogArr = res
this.eqpDialogArr = []
+ this.radioChangeTempValue = ''
},
radioChange(val) {
this.isEqpTableEdit = true
+ this.radioChangeTempValue = val
// this.dialogForm.stepcode = this.stepDialogArr.find(item => item.name === val).code
this.getEqpTable(val)
},
@@ -665,15 +674,19 @@
},
async getEqpTable(val) {
if (typeof val === 'string') {
+ this.eqpTable.steptype = this.stepDialogArr.find(item => item.name === val).flag
this.eqpTable.partcode = this.dialogForm.partcode
this.eqpTable.routecode = this.dialogForm.routecode
this.eqpTable.stepcode = this.stepDialogArr.find(item => item.name === val).code
- } else if (typeof val === 'number') {
+ // } else if (typeof val === 'number') {
+ } else {
+ this.eqpTable.steptype = this.stepDialogArr[0].flag
this.eqpTable.partcode = this.dialogForm.partcode
this.eqpTable.routecode = this.dialogForm.routecode
this.eqpTable.stepcode = this.stepDialogArr[0].code
this.dialogForm.stepcode = this.stepDialogArr[0].name
}
+
const res = await StepSelectEqpList(this.eqpTable)
this.eqpDialogArr = res.data
this.eqpTableLength = res.count
@@ -685,6 +698,9 @@
},
// 淇濆瓨琛�
async saveRow(row) {
+ if (parseFloat(row.unprice) <= 0 && this.eqpTable.steptype !== 'W') {
+ return this.$message.info('璁′欢鍗曚环蹇呴』澶т簬闆讹紒')
+ }
const data = {
partcode: this.eqpTable.partcode, // 浜у搧缂栫爜
routecode: this.eqpTable.routecode, // 宸ヨ壓璺嚎缂栫爜
@@ -702,12 +718,14 @@
if (res.code === '200') {
this.isEqpTableEdit = true
this.$message.success('淇濆瓨鎴愬姛锛�')
- await this.getEqpTable()
+ this.radioChange(this.radioChangeTempValue)
}
},
// 鍙栨秷琛�
cancelRow(row) {
this.getEqpTable()
+ this.radioChange(this.radioChangeTempValue)
+ this.dialogForm.stepcode = this.radioChangeTempValue
this.isEqpTableEdit = true
},
// 缂栬緫琛�
@@ -727,8 +745,13 @@
return this.$message.info('鍙兘涓�琛屼竴琛屼慨鏀癸紒')
}
},
+ // rowClick(row, column, event) {
+ // console.log(row, column, event, 3)
+ // console.log(this.dialogForm.stepcode, 4)
+ // this.getEqpTable(this.dialogForm.stepcode)
+ // },
// 澶嶅埗琛�
- async copyRow(row) {
+ async copyRow(row) {
let currentData = {}// 褰撳墠琛屽璞�
let nextData = {}// 涓嬩竴琛屽璞�
if (row.RowNum === this.eqpDialogArr.length) {
@@ -756,7 +779,7 @@
const res = await SaveBeatRate(newData)
if (res.code === '200') {
this.$message.success('澶嶅埗鎴愬姛锛�')
- await this.getEqpTable()
+ this.radioChange(this.radioChangeTempValue)
this.isEqpTableEdit = true
}
},
@@ -783,7 +806,7 @@
this.getPartSelect2()
},
// 淇敼鎸夐挳
- async edit(operation, row) {
+ async edit(operation, row) {
this.operation = operation
this.dialogVisible = true
@@ -791,13 +814,11 @@
this.editRouteName = row.route_name
this.editStepName = row.stepname
- // this.$nextTick(() => {
+ await this.partDialogChange(row.partcode)
+ await this.routeDialogChange(row.route_code)
this.dialogForm.partcode = row.partcode
this.dialogForm.routecode = row.route_code
this.dialogForm.stepcode = row.stepcode
- // })
- await this.partDialogChange(row.partcode)
- await this.routeDialogChange(row.route_code)
await this.radioChange(0)
},
// 鍒犻櫎鎸夐挳
@@ -897,15 +918,17 @@
<!--鍏叡椤甸潰鏍峰紡-->
<style lang="scss" scoped>
$main_color: #42b983;
-.el-button--text{
+.el-button--text {
font-size: 14px;
cursor: pointer;
}
-.el-icon-share ,.el-icon-delete,.el-icon-edit-outline{
+
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
color: $main_color;
cursor: pointer;
}
-.el-icon-edit-outline{
+
+.el-icon-edit-outline {
margin-right: 15px;
}
@@ -966,8 +989,8 @@
background-color: #f8f8fa;
}
-::v-deep .el-table__body .el-table__row.hover-row td{
- background-color: #eaecef ;
+::v-deep .el-table__body .el-table__row.hover-row td {
+ background-color: #eaecef;
}
::v-deep .el-form--inline .el-form-item__label {
@@ -983,14 +1006,17 @@
.body ::v-deep .el-form-item {
margin-bottom: 0;
}
+
.userDialogVisible ::v-deep .el-form-item {
margin-bottom: 0;
}
-.tableFixed{
- ::v-deep .el-table__fixed-right{
+
+.tableFixed {
+ ::v-deep .el-table__fixed-right {
height: 100% !important;
}
- ::v-deep .el-table__fixed{
+
+ ::v-deep .el-table__fixed {
height: 100% !important;
}
}
--
Gitblit v1.9.3