From c93c13d1cfe288d431109ae1eafd7a9fc6d58746 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 13 六月 2023 10:23:17 +0800
Subject: [PATCH] 1.递交
---
src/views/qualityManager/qualityPlaning.vue | 344 ++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 268 insertions(+), 76 deletions(-)
diff --git a/src/views/qualityManager/qualityPlaning.vue b/src/views/qualityManager/qualityPlaning.vue
index 3bcabd8..25f7b9e 100644
--- a/src/views/qualityManager/qualityPlaning.vue
+++ b/src/views/qualityManager/qualityPlaning.vue
@@ -89,7 +89,12 @@
</div>
<div class="elTableDiv">
+ <TableColumnSettings
+ :list1="tableColumnSettingsArray"
+ @tableColumnUpdate="tableColumnUpdate"
+ />
<el-table
+ :key="tableTimeStampKey"
ref="tableDataRef"
class="tableFixed"
:data="tableData"
@@ -102,80 +107,119 @@
:cell-style="this.$cellStyle"
@sort-change="sortChange"
>
+ <!-- <el-table-column-->
+ <!-- prop="RowNum"-->
+ <!-- width="50"-->
+ <!-- fixed-->
+ <!-- label="搴忓彿"-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="code"-->
+ <!-- label="璐ㄦ鏂规缂栫爜"-->
+ <!-- sortable="custom"-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="name"-->
+ <!-- label="璐ㄦ鏂规鍚嶇О"-->
+ <!-- sortable="custom"-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="status"-->
+ <!-- label="鏈夋晥鐘舵��"-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.status==='Y'"><i-->
+ <!-- class="el-icon-success"-->
+ <!-- :style="{color:$store.state.settings.theme}"-->
+ <!-- style="margin-right:5px"-->
+ <!-- />鏄�-->
+ <!-- </div>-->
+ <!-- <div v-else-if="row.status==='N'"><i class="el-icon-info" style="margin-right: 5px" />鍚�</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="checktype"-->
+ <!-- label="璐ㄦ绫诲瀷"-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.checktype">{{ checktypeArr.find(i => i.code === row.checktype).name }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="sampmethod"-->
+ <!-- label="鎶芥牱鏂瑰紡"-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.sampmethod">{{ sampltypeArr.find(i => i.code === row.sampmethod).name }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="suitobject"-->
+ <!-- label="閫傜敤瀵硅薄"-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.suitobject">{{ suitobjectArr.find(i => i.code === row.suitobject).name }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+
+ <!-- <el-table-column-->
+ <!-- prop="username"-->
+ <!-- label="鍒涘缓浜哄憳"-->
+ <!-- sortable="custom"-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="lm_date"-->
+ <!-- label="鍒涘缓鏃堕棿"-->
+ <!-- width="160"-->
+ <!-- sortable="custom"-->
+ <!-- />-->
+
<el-table-column
- prop="RowNum"
- width="50"
- fixed
- label="搴忓彿"
- />
- <el-table-column
- prop="code"
- label="璐ㄦ鏂规缂栫爜"
- sortable="custom"
- />
- <el-table-column
- prop="name"
- label="璐ㄦ鏂规鍚嶇О"
- sortable="custom"
- />
- <el-table-column
- prop="status"
- label="鏈夋晥鐘舵��"
- sortable="custom"
+ v-for="item in tableColumnSettingsArray"
+ v-if="item.show"
+ :key="item.id"
+ :sortable="item.sortable"
+ :prop="item.prop"
+ :min-width="item.minWidth"
+ :label="item.label"
+ :width="item.width"
+ show-tooltip-when-overflow
+ :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
>
<template slot-scope="{row}">
- <div v-if="row.status==='Y'"><i
- class="el-icon-success"
- :style="{color:$store.state.settings.theme}"
- style="margin-right:5px"
- />鏄�
+ <div v-if="!row[item.prop]">/</div>
+ <div v-else-if="item.prop==='checktype'">
+ {{ checktypeArr.find(i => i.code === row[item.prop]).name }}
</div>
- <div v-else-if="row.status==='N'"><i class="el-icon-info" style="margin-right: 5px" />鍚�</div>
- <div v-else>/</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="checktype"
- label="璐ㄦ绫诲瀷"
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.checktype">{{ checktypeArr.find(i => i.code === row.checktype).name }}</div>
- <div v-else>/</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="sampmethod"
- label="鎶芥牱鏂瑰紡"
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.sampmethod">{{ sampltypeArr.find(i => i.code === row.sampmethod).name }}</div>
- <div v-else>/</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="suitobject"
- label="閫傜敤瀵硅薄"
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.suitobject">{{ suitobjectArr.find(i => i.code === row.suitobject).name }}</div>
- <div v-else>/</div>
+ <div v-else-if="item.prop==='sampmethod'">
+ {{ sampltypeArr.find(i => i.code === row[item.prop]).name }}
+ </div>
+ <!-- 閫傜敤瀵硅薄-->
+ <div v-else-if="item.prop==='suitobject'">
+ {{ suitobjectArr.find(i => i.code === row.suitobject).name }}
+ </div>
+ <div v-else-if="item.prop==='status'">
+ <div v-if="row.status==='Y'"><i
+ class="el-icon-success"
+ :style="{color:$store.state.settings.theme}"
+ style="margin-right:5px"
+ />鏄�
+ </div>
+ <div v-else-if="row.status==='N'"><i class="el-icon-info" style="margin-right: 5px" />鍚�</div>
+ <div v-else>/</div>
+ </div>
+ <div v-else>{{ row[item.prop] }}</div>
</template>
</el-table-column>
- <el-table-column
- prop="username"
- label="鍒涘缓浜哄憳"
- sortable="custom"
- />
- <el-table-column
- prop="lm_date"
- label="鍒涘缓鏃堕棿"
- width="160"
- sortable="custom"
- />
<el-table-column
label="鎿嶄綔"
width="120"
@@ -273,7 +317,7 @@
<el-input v-model="dialogForm.sampnum" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 200px" />
</el-form-item>
<el-form-item v-if="dialogForm.sampmethod==='SCARE'" label="鎶芥姣斾緥" prop="sampscale">
- <el-input v-model="dialogForm.sampscale" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 180px" />
+ <el-input v-model="dialogForm.sampscale" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 180px" />
%
</el-form-item>
<br>
@@ -285,7 +329,7 @@
</el-form-item>
<el-form-item
prop="suitpart"
- :label="dialogForm.suitobject==='Y'?'閫傜敤鐗╂枡':'閫傜敤鐗╂枡绫诲埆'"
+ :label="dialogForm.suitobject==='P'?'閫傜敤鐗╂枡':'閫傜敤鐗╂枡绫诲埆'"
>
<el-select
v-model="dialogForm.suitpart"
@@ -314,6 +358,27 @@
</el-select>
</el-form-item>
<br>
+ <el-form-item
+ v-if="dialogForm.checktype==='FirstCheck'||dialogForm.checktype==='PatroCheck'||dialogForm.checktype==='EndCheck'"
+ label="宸ュ簭鍚嶇О"
+ prop="stepcode"
+ >
+ <el-select
+ v-model="dialogForm.stepcode"
+ style="width: 200px"
+ filterable
+ placeholder="璇烽�夋嫨"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in StepSelectArr"
+ :key="item.stepcode"
+ :label="item.stepname"
+ :value="item.stepcode"
+ />
+ </el-select>
+ </el-form-item>
+
<el-form-item label="妫�楠屾柟妗堟弿杩�">
<el-input v-model="dialogForm.descr" type="textarea" :autosize="{ minRows: 2 }" />
</el-form-item>
@@ -506,7 +571,7 @@
placeholder="璇烽�夋嫨"
:disabled="row.numberjudge==='N'"
/>
- <div v-else>{{ row.unit?row.unit:'/' }}</div>
+ <div v-else>{{ row.unit ? row.unit : '/' }}</div>
</template>
</el-table-column>
<el-table-column
@@ -586,6 +651,7 @@
<el-table-column
prop="stepcheckitem_desc"
label="鎻忚堪"
+ show-tooltip-when-overflow
>
<template slot-scope="{row}">
<el-input
@@ -605,7 +671,8 @@
<template slot-scope="{row}">
<div class="operationClass">
<el-button v-if="row.isVisible===1" v-waves type="text" @click="saveZjlbRow(row)">纭</el-button>
- <el-button v-if="row.isVisible===1&&isCancel" v-waves type="text" @click="cancelZjlbRow(row)">鍙栨秷</el-button>
+ <el-button v-if="row.isVisible===1&&isCancel" v-waves type="text" @click="cancelZjlbRow(row)">鍙栨秷
+ </el-button>
<el-button v-if="row.isVisible!==1" v-waves type="text" @click="editZjlbRow(row)">缂栬緫</el-button>
<el-button v-if="row.isVisible!==1" v-waves type="text" @click="delZjlbRow(row)">鍒犻櫎</el-button>
</div>
@@ -637,18 +704,19 @@
import { validateCode } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
-import { PartSelect, StockTypeSelect, UomSelect } from '@/api/zzmx'
+import { PartSelect, StepSelect, StockTypeSelect, UomSelect } from '@/api/makeModel'
import {
QualityInspectionAddEditSave,
QualityInspectionDelete,
QualityInspectionSearch, QualityInspectionSeeEdit,
StepCheckItemSelect
-} from '@/api/zlgl'
+} from '@/api/qualityManager'
+import TableColumnSettings from '@/components/TableColumnSettings'
export default {
name: 'Zzjg',
components: {
- Pagination
+ Pagination, TableColumnSettings
},
directives: { elDragDialog, waves },
data() {
@@ -686,6 +754,109 @@
],
total: 10,
tableData: [],
+ tableColumnSettingsArray: [
+ // { minWidth: 50, width: false, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 闅愯棌鍒� show: false闅愯棌锛宼rue鏄剧ず
+ { minWidth: 25, width: 50, prop: 'RowNum', label: '搴忓彿', id: 2, show: true, fixed: 'left', sortable: false }, // custom
+ {
+ minWidth: 130,
+ width: false,
+ prop: 'code',
+ label: '璐ㄦ鏂规缂栫爜',
+ id: 3,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 130,
+ width: false,
+ prop: 'name',
+ label: '璐ㄦ鏂规鍚嶇О',
+ id: 4,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'status',
+ label: '鏈夋晥鐘舵��',
+ id: 5,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: 110,
+ width: false,
+ prop: 'checktype',
+ label: '璐ㄦ绫诲瀷',
+ id: 6,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: 110,
+ width: false,
+ prop: 'sampmethod',
+ label: '鎶芥牱鏂瑰紡',
+ id: 7,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'suitobject',
+ label: '閫傜敤瀵硅薄',
+ id: 8,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'stepcode',
+ label: '宸ュ簭缂栫爜',
+ id: 9,
+ show: false,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: 110,
+ width: false,
+ prop: 'stepname',
+ label: '宸ュ簭鍚嶇О',
+ id: 10,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'username',
+ label: '鍒涘缓浜哄憳',
+ id: 11,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 160,
+ prop: 'lm_date',
+ label: '鍒涘缓鏃堕棿',
+ id: 12,
+ show: true,
+ fixed: false,
+ sortable: true
+ }
+ ],
+ tableTimeStampKey: new Date().getTime(), // 琛ㄦ牸key
dialogVisible: false,
dialogForm: {
qualityinsptcode: '', // 璐ㄦ鏂规缂栫爜
@@ -697,6 +868,7 @@
sampscale: '', // 鎶芥姣斾緥
suitobject: 'P', // 閫傜敤瀵硅薄
suitpart: [], // 閫傜敤鐗╂枡
+ stepcode: '', // 宸ュ簭
descr: '' // /鎻忚堪
},
operation: '',
@@ -727,6 +899,9 @@
],
suitpart: [
{ required: true, message: '璇烽�夋嫨鐗╂枡鎴栫墿鏂欑被鍒�', trigger: ['blur', 'change'] }
+ ],
+ stepcode: [
+ { required: true, message: '璇烽�夋嫨宸ュ簭鍚嶇О', trigger: ['blur', 'change'] }
]
},
checkitem: [],
@@ -741,6 +916,7 @@
UomSelectArr: [], // 鍗曚綅涓嬫媺鏁扮粍
CheckItemSelectAllArr: [], // 妫�楠岄」鐩�(鎵�鏈�)
CheckItemSelectArr: [], // 妫�楠岄」鐩�
+ StepSelectArr: [], // 宸ュ簭鍚嶇О涓嬫媺鎵�鏈�
isCancel: true// 鏄惁鍙彇娑�
@@ -755,6 +931,13 @@
this.getHeight()
},
methods: {
+ tableColumnUpdate(val, isCopyTrue) {
+ if (isCopyTrue) {
+ this.tableColumnSettingsArray = val
+ }
+ this.tableTimeStampKey = new Date().getTime()
+ this.$refs.tableDataRef.doLayout()
+ },
handleRequest() {
this.getQualityInspectionSearch().then(res => {
if (res.code === '200') {
@@ -762,8 +945,13 @@
this.getStepCheckItemSelect()
this.getPartSelect()
this.getStockTypeSelect()
+ this.getStepSelect()
}
})
+ },
+ async getStepSelect() {
+ const { data: res } = await StepSelect()
+ this.StepSelectArr = res
},
async getQualityInspectionSearch() {
const res = await QualityInspectionSearch(this.form)
@@ -817,6 +1005,7 @@
this.dialogForm.qualityinsptcode = row.code
this.dialogForm.qualityinsptname = row.name
this.dialogForm.status = row.status
+ this.dialogForm.stepcode = row.stepcode
this.dialogForm.checktype = row.checktype
this.dialogForm.sampmethod = row.sampmethod
// this.dialogForm.sampscare = row.sampscare
@@ -834,7 +1023,7 @@
})
},
// 淇敼鎸夐挳
- async edit(operation, row) {
+ async edit(operation, row) {
this.operation = operation
this.dialogVisible = true
@@ -860,6 +1049,7 @@
this.dialogForm.qualityinsptcode = row.code
this.dialogForm.qualityinsptname = row.name
this.dialogForm.status = row.status
+ this.dialogForm.stepcode = row.stepcode
this.dialogForm.checktype = row.checktype
this.dialogForm.sampmethod = row.sampmethod
if (this.dialogForm.sampmethod === 'FIXED') {
@@ -1016,6 +1206,7 @@
checktype: '',
sampmethod: 'FIXED',
sampnum: '',
+ stepcode: '',
sampscale: '',
suitobject: 'P',
suitpart: [],
@@ -1024,9 +1215,9 @@
this.isCancel = true
this.checkitem = []
+ this.CheckItemSelectArr = JSON.parse(JSON.stringify(this.CheckItemSelectAllArr))
this.$refs.dialogForm.clearValidate()
},
-
// 瀵硅瘽妗嗗彇娑�
dialogVisibleCancel() {
this.dialogVisible = false
@@ -1058,6 +1249,7 @@
qualityinsptcode: this.dialogForm.qualityinsptcode,
qualityinsptname: this.dialogForm.qualityinsptname,
status: this.dialogForm.status,
+ stepcode: this.dialogForm.checktype === 'InCheck' || this.dialogForm.checktype === 'OutCheck' ? '' : this.dialogForm.stepcode,
checktype: this.dialogForm.checktype,
sampmethod: this.dialogForm.sampmethod,
sampscare: this.dialogForm.sampnum ? this.dialogForm.sampnum : this.dialogForm.sampscale,
--
Gitblit v1.9.3