From f75c4df0ca8cdee5c15f0ecd4288825f35b19bf1 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 25 三月 2024 15:01:17 +0800
Subject: [PATCH] 完成样品模板回显为table功能
---
src/components/do/b1-inspect-order-plan/Inspection.vue | 109 ++++++++++++++++++++++++++++++++++++
src/components/view/b1-expenses.vue | 68 +++++-----------------
2 files changed, 125 insertions(+), 52 deletions(-)
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 1c57def..e72e9ee 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -43,6 +43,48 @@
.el-drawer__header{
color: #303133;
}
+ .center{
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-wrap: wrap;
+ }
+ .tables{
+ width: 800px;
+ }
+ .tables td{
+ height: 40px;
+ width: 100px;
+ text-align: center;
+ font-size: 14px;
+ }
+ .content{
+ display: flex;
+ width: 100%;
+ height: 100%;
+ align-items: center;
+ justify-content: left;
+ padding: 2px;
+ box-sizing: border-box;
+ }
+ .content-h-0{
+ justify-content: center;
+ }
+ .content-h-1{
+ justify-content: start;
+ }
+ .content-h-2{
+ justify-content: end;
+ }
+ .content-v-0{
+ align-items: center;
+ }
+ .content-v-1{
+ align-items: start;
+ }
+ .content-v-2{
+ align-items: end;
+ }
</style>
<template>
<div>
@@ -83,6 +125,22 @@
</el-form>
</div>
<div class="center">
+ <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index">
+ <tbody>
+ <tr v-for="(m,i) in item.arr" :key="i">
+ <td
+ v-for="(n,j) in m"
+ :key="j"
+ :colspan="n.v.mc&&n.v.mc.cs?n.v.mc.cs:1"
+ :rowspan="n.v.mc&&n.v.mc.rs?n.v.mc.rs:1"
+ :style="`background:${n.v.bg};font-family:${n.v.ff};color:${n.v.fc};font-size:${n.v.fs}px;width:${item.style.columnlen['0']}px;height:${item.style.rowlen[i]}px;font-wight:${n.v.bl?'bold':''};`">
+ <div class="content" :class="`content-h-${n.v.ht} content-v-${n.v.vt}`">
+ <span>{{ n.v.v}}</span>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
</div>
<el-drawer
title="鏍峰搧鍒囨崲"
@@ -169,6 +227,7 @@
typeList:[],
urgentList:[],
currentSample:{},//褰撳墠鏍峰搧淇℃伅
+ tableList:[],
}
},
created() {
@@ -192,12 +251,14 @@
})
this.sampleProduct = res.data.sampleProduct
this.currentSample = this.sampleProduct[0]
+ this.handleTableData()
})
}
},
methods: {
handleChangeSample(row, column, event){
this.currentSample = row;
+ this.handleTableData()
this.sampleVisible = false;
},
handleChangeTask(row){
@@ -243,6 +304,54 @@
},
tableRowClassName({ row, rowIndex }){
row.index = rowIndex + 1;
+ },
+ handleTableData(){
+ const mySet1 = new Set();
+ this.tableList = JSON.parse(JSON.stringify(this.currentSample.insProduct)).filter(m=>{
+ let num0 = mySet1.size;
+ mySet1.add(JSON.stringify({
+ inspectionItem:m.inspectionItem,
+ templateId:m.templateId
+ }))
+ let num1 = mySet1.size;
+ if(num1>num0){
+ return m
+ }
+ })
+ this.tableList.map(item=>{
+ const mySet0 = new Set();
+ let arr = [];
+ let arrItem = [];
+ item.template.forEach((m,i)=>{
+ let num0 = mySet0.size;
+ mySet0.add(m.r)
+ let num1 = mySet0.size;
+ if(num0<num1){
+ if(arrItem.length>0){
+ arr.push(arrItem)
+ arrItem = []
+ }
+ if(m.v.mc){
+ if(m.v.mc.rs||m.v.mc.cs){
+ arrItem.push(m)
+ }
+ }else{
+ arrItem.push(m)
+ }
+ }else{
+ if(m.v.mc){
+ if(m.v.mc.rs||m.v.mc.cs){
+ arrItem.push(m)
+ }
+ }else{
+ arrItem.push(m)
+ }
+ }
+ })
+ arr.push(arrItem)
+ item.arr = arr;
+ return item
+ })
}
}
}
diff --git a/src/components/view/b1-expenses.vue b/src/components/view/b1-expenses.vue
index ebfbe7c..a3e946d 100644
--- a/src/components/view/b1-expenses.vue
+++ b/src/components/view/b1-expenses.vue
@@ -47,11 +47,24 @@
<el-row class="title">
<el-col :span="12" style="padding-left: 20px;">璐圭敤缁熻</el-col>
<el-col :span="12" style="text-align: right;">
- <el-button size="small" type="primary">涓嬪崟</el-button>
+ <el-button size="small" type="primary">OA鎺ㄩ��</el-button>
</el-col>
</el-row>
</div>
<div class="search">
+ <div class="search_thing">
+ <div class="search_label">鏃堕棿鑼冨洿锛�</div>
+ <div class="search_input">
+ <el-date-picker
+ v-model="componentData.entity.sample"
+ type="datetimerange"
+ range-separator="鑷�"
+ format="yyyy-MM-dd HH:mm:ss"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡">
+ </el-date-picker>
+ </div>
+ </div>
<div class="search_thing">
<div class="search_label">鏍峰搧鍚嶇О锛�</div>
<div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
@@ -113,57 +126,8 @@
isIndex: true,
showSelect: false,
select: false,
- do: [{
- id: 'handleWeave',
- font: '鍦ㄧ嚎缂栧埗',
- type: 'text',
- method: 'handleWeave',
- disabFun: (row, index) => {
- return row.state != 1
- }
- }, {
- id: 'download',
- font: '涓嬭浇',
- type: 'text',
- method: 'download',
- disabFun: (row, index) => {
- return row.state != 1
- }
- }, {
- id: 'handleUpload',
- font: '涓婁紶',
- type: 'text',
- method: 'handleUpload',
- disabFun: (row, index) => {
- return row.state != 0
- }
- }, {
- id: 'handlRestore',
- font: '杩樺師',
- type: 'text',
- method: 'handleRestore'
- }, {
- id: 'handleIssued',
- font: '瀹℃牳',
- type: 'text',
- method: 'handleIssued',
- disabFun: (row, index) => {
- return row.state != 1 || row.sendTime != null
- }
- }, {
- id: 'handleApprove',
- font: '鎵瑰噯',
- type: 'text',
- method: 'handleApprove',
- disabFun: (row, index) => {
- return row.state != 1 || row.sendTime != null
- }
- }],
- linkEvent:{
- entrustCode:{
- method:'selectAllByOne'
- }
- },
+ do: [],
+ linkEvent:{},
tagField: {
type: {
select: [{
--
Gitblit v1.9.3