From a65112ecf7580c7d5a2ae60d05150cac34e59f5d Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 26 九月 2022 16:30:33 +0800
Subject: [PATCH] 1.工艺路线工艺设置下拉选中之后自动回车2.工序定义检验人员选中默认当前登录人员
---
src/views/zlgl/gxjybz.vue | 88 ++++++++++++++++----------------------------
1 files changed, 32 insertions(+), 56 deletions(-)
diff --git a/src/views/zlgl/gxjybz.vue b/src/views/zlgl/gxjybz.vue
index 59176f3..9409aff 100644
--- a/src/views/zlgl/gxjybz.vue
+++ b/src/views/zlgl/gxjybz.vue
@@ -25,7 +25,7 @@
<el-input v-model="form.staneddescr" style="width: 200px" placeholder="璇疯緭鍏�" />
</el-form-item>
</div>
- <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
+ <div class="bodySearchReset">
<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>
@@ -33,6 +33,8 @@
</div>
<div class="elTableDiv">
<el-table
+ ref="tableDataRef"
+ class="tableFixed"
:data="tableData"
:height="tableHeight+'px'"
border
@@ -127,8 +129,8 @@
:top="isIpad?'5vh':'15vh'"
:close-on-click-modal="false"
@closed="handleClose"
- @close="handleClose"
>
+ <!-- @close="handleClose"-->
<div style="margin-bottom: 10px">
<i class="el-icon-s-comment" style="color:#42b983;" /> 鏍囧噯淇℃伅锛�
</div>
@@ -159,7 +161,7 @@
<i class="el-icon-s-comment" style="color:#42b983;" /> 妫�楠岄」淇℃伅锛�
</div>
<div style="margin-bottom: 10px">
- <el-button v-if="operation==='add'" type="primary" @click="JYadd">鏂板</el-button>
+ <el-button v-if="operation==='add'||operation==='edit'" type="primary" @click="JYadd">鏂板</el-button>
</div>
<div>
<el-table
@@ -179,33 +181,6 @@
width="100"
fixed
/>
- <!-- <el-table-column-->
- <!-- prop="code"-->
- <!-- label="妫�楠屾爣鍑嗙紪鐮�(鍚嶇О)"-->
- <!-- >-->
- <!-- <template slot-scope="{row}">-->
- <!-- <div v-if="row.isVisible===0" style="display: flex;">-->
- <!-- <div>{{ row.code }}</div>-->
- <!-- <div style="margin-left: 10px">{{ row.name }}</div>-->
- <!-- </div>-->
- <!-- <el-select-->
- <!-- v-if="row.isVisible===1"-->
- <!-- v-model="row.code"-->
- <!-- filterable-->
- <!-- :popper-append-to-body="false"-->
- <!-- style="width: 400px;"-->
- <!-- placeholder="璇烽�夋嫨"-->
- <!-- @change="val=>changeCode(val,row)"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="item in JYSelectArr"-->
- <!-- :key="item.code"-->
- <!-- :label="item.code+''+item.name"-->
- <!-- :value="item.code"-->
- <!-- />-->
- <!-- </el-select>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
<el-table-column
prop="code"
label="妫�楠屾爣鍑嗙紪鐮�"
@@ -295,32 +270,14 @@
StepCheckItemSelect,
StepCheckStanedSearch
} from '@/api/zlgl'
+import { validateCode } from '@/utils/global'
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
name: 'ZJBZ',
components: {
Pagination
},
data() {
- const validateName = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('璇疯緭鍏ョ紪鐮�'))
- } else {
- if (SER_HZ.test(value)) {
- return callback(new Error('缂栫爜涓嶈兘涓轰腑鏂�'))
- } else {
- callback()
- }
- }
- }
- const validateTypeCode = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('璇烽�夋嫨涓婄骇'))
- } else {
- callback()
- }
- }
return {
isIpad: false,
mainHeight: 0,
@@ -346,7 +303,7 @@
operation: '',
dialogFormRules: {
code: [
- { required: true, validator: validateName, trigger: ['blur', 'change'] }
+ { required: true, validator: validateCode, trigger: ['blur', 'change'] }
],
name: [
{ required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
@@ -445,6 +402,8 @@
this.$nextTick(() => {
this.$refs.JYTableData.doLayout()
})
+
+ this.JYSelectArr = [...this.JYSelectArr].filter(x => [...this.JYTableData].every(y => y.code !== x.code))
},
// 鍒犻櫎鎸夐挳
async del(row) {
@@ -456,6 +415,9 @@
DeleteStepCheckStaned({ stanedcode: row.code }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
this.getStepCheckStanedSearch()
}
})
@@ -482,6 +444,7 @@
this.$refs.dialogForm.validate(valid => {
if (valid) {
const tableData = []
+ this.JYTableData = this.JYTableData.filter(item => item.code !== '')
this.JYTableData.forEach((item, index) => {
tableData.push({
STEPCHECKITEM_SEQ: (index + 1),
@@ -514,6 +477,7 @@
this.mainHeight = window.innerHeight - 85
this.tableHeight = this.mainHeight - 200
this.isIpad = window.innerHeight < 769
+ this.$refs.tableDataRef.doLayout()
// if (window.innerHeight < 769) {
// this.tableHeight = this.tableHeight - 50
// }
@@ -524,11 +488,6 @@
const { data: res } = await StepCheckItemSelect()
this.JYSelectArr = res
},
- // 妫�楠屾爣鍑嗙紪鐮佸�兼敼鍙�
- // changeCode(val, row) {
- // row.name = this.JYSelectArr.find(it => it.code === val).name
- // row.descr = this.JYSelectArr.find(it => it.code === val).descr
- // },
// 妫�楠屾爣鍑嗗悕绉板�兼敼鍙�
changeName(val, row) {
const res = this.JYSelectArr.find(item => {
@@ -551,6 +510,16 @@
this.JYIsCancel = false
},
JYedit(row) {
+ let flag = false
+ this.JYTableData.forEach((item, index) => {
+ if (item.isVisible === 1) {
+ flag = true
+ }
+ })
+ if (flag) {
+ return this.$message.info('璇峰厛纭鎴栧彇娑堝叾瀹冭锛�')
+ }
+
this.JYIsCancel = false
this.JYSelectArr.splice(0, 0, {
code: row.code,
@@ -731,7 +700,14 @@
.userDialogVisible ::v-deep .el-form-item {
margin-bottom: 0;
}
-
+.tableFixed{
+ ::v-deep .el-table__fixed-right{
+ height: 100% !important;
+ }
+ ::v-deep .el-table__fixed{
+ height: 100% !important;
+ }
+}
</style>
<style>
--
Gitblit v1.9.3