From 4a8efc53405efe0d20312694d39fbd8184badb39 Mon Sep 17 00:00:00 2001
From: yuyu <1981343953@qq.com>
Date: 星期二, 15 八月 2023 17:14:23 +0800
Subject: [PATCH] 8.15提交
---
src/views/rawMaterials/reportForInspection/index.vue | 128 ++++++++++++++++++++++++------------------
1 files changed, 74 insertions(+), 54 deletions(-)
diff --git a/src/views/rawMaterials/reportForInspection/index.vue b/src/views/rawMaterials/reportForInspection/index.vue
index 62ec587..e1663e3 100644
--- a/src/views/rawMaterials/reportForInspection/index.vue
+++ b/src/views/rawMaterials/reportForInspection/index.vue
@@ -60,43 +60,49 @@
style="width: 100%"
>
<el-table-column
- prop="applicationOrdernumber"
- label="鐢宠鍗曞彿"
- min-width="200"
- />
- <el-table-column
- prop="typeofInspection"
+ prop="type"
label="妫�楠岀被鍨�"
min-width="200"
- />
+ >
+ <template slot-scope="scope">
+ <span v-if="scope.row.type===0">鍘熸潗鏂欐楠�</span>
+ <span v-else-if="scope.row.type===1">鍗婃垚鍝佹楠�</span>
+ <span v-else-if="scope.row.type===2">鎴愬搧妫�楠�</span>
+ </template>
+ </el-table-column>
<el-table-column
- prop="objectofInspection"
- label="妫�楠屽璞�"
+ prop="createTime"
+ label="鍒涘缓鏃堕棿"
min-width="200"
/>
<el-table-column
- prop="palceofObject"
- label="瀵硅薄浣嶇疆"
+ prop="userName"
+ label="鐢宠浜�"
min-width="200"
/>
<el-table-column
- prop="name"
- label="瀵硅薄鍚嶇О"
+ prop="inspectUserId"
+ label="妫�楠屼汉"
min-width="200"
/>
<el-table-column
- prop="date"
- label="鐧昏鏃ユ湡"
+ prop="inspectionStatus"
+ label="妫�楠岀姸鎬�"
min-width="200"
/>
<el-table-column
- prop="registrant"
- label="鐧昏浜�"
+ prop="qualifiedState"
+ label="鍚堟牸鐘舵��"
min-width="200"
/>
<el-table-column
- prop="applicationTime"
- label="鐢宠鏃堕棿"
+ prop="inspectStartTime"
+ label="妫�楠屽紑濮嬫椂闂�"
+ min-width="200"
+ />
+ <el-table-column
+ prop="inspectEndTime"
+ label="妫�楠岀粨鏉熸椂闂�"
min-width="200"
/>
<el-table-column
@@ -117,7 +123,7 @@
:page-sizes="[100, 200, 300, 400]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
- :total="this.inspectionTable.length"
+ :total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
@@ -131,7 +137,7 @@
width="40%"
>
<div class="check-box">
- <el-radio-group v-model="type">
+ <el-radio-group v-model="addInspectionType">
<el-radio :label="0" border>鍘熸潗鏂欐楠�</el-radio>
<el-radio :label="1" border>鍗婃垚鍝佹楠�</el-radio>
<el-radio :label="2" border>鎴愬搧妫�楠�</el-radio>
@@ -152,6 +158,7 @@
</template>
<script>
+import { getInspectionList, addInspection } from '@/api/rawMaterials/reportForInspection'
export default {
data() {
return {
@@ -160,21 +167,25 @@
keyword: ''
},
inspectionTable: [{
- applicationOrdernumber: 'QC22-09155',
- typeofInspection: '閲囪喘鍏ュ簱',
- objectofInspection: 'MI202207032-1',
- palceofObject: '---',
- name: '杩欐槸涓�鏉℃祴璇曟暟鎹�',
- date: '2022-09-23',
- registrant: '绠$悊鍛�',
- applicationTime: '111'
+ 'id': '1681215775833042945',
+ 'type': 0,
+ 'inspectionStatus': 0,
+ 'qualifiedState': null,
+ 'state': 1,
+ 'createTime': '2023-07-18 16:14:11',
+ 'updateTime': null,
+ 'version': null,
+ 'userName': '娴嬭瘯浜哄憳',
+ 'inspectUserId': null,
+ 'inspectStartTime': null,
+ 'inspectEndTime': null
}],
currentPage: 1,
total: 20, // 鎬绘潯鏁�
- pageSize: 100, // 姣忛〉鐨勬暟鎹潯鏁�
+ pageSize: 10, // 姣忛〉鐨勬暟鎹潯鏁�
radioValue: '鍏ㄩ儴',
checkTypeVisible: false,
- type: 0
+ addInspectionType: 0
}
},
watch: {
@@ -187,35 +198,37 @@
deep: true
}
},
- // beforeRouteEnter(to, from, next) {
- // console.log(to, from)
- // next()
- // // 鍦ㄦ覆鏌撹缁勪欢鐨勫搴旇矾鐢辫 confirm 鍓嶈皟鐢�
- // // 涓嶏紒鑳斤紒鑾峰彇缁勪欢瀹炰緥 `this`
- // // 鍥犱负褰撻挬瀛愭墽琛屽墠锛岀粍浠跺疄渚嬭繕娌¤鍒涘缓
- // },
- // beforeRouteUpdate(to, from, next) {
- // console.log(to, from)
- // if (to.name === 'ForInspectionDetail') this.showDetail = true
- // this.$nextTick(() => {
- // console.log(1)
- // this.showDetail = true
- // })
- // next()
- // // 鍦ㄥ綋鍓嶈矾鐢辨敼鍙橈紝浣嗘槸璇ョ粍浠惰澶嶇敤鏃惰皟鐢�
- // // 涓句緥鏉ヨ锛屽浜庝竴涓甫鏈夊姩鎬佸弬鏁扮殑璺緞 /foo/:id锛屽湪 /foo/1 鍜� /foo/2 涔嬮棿璺宠浆鐨勬椂鍊欙紝
- // // 鐢变簬浼氭覆鏌撳悓鏍风殑 Foo 缁勪欢锛屽洜姝ょ粍浠跺疄渚嬩細琚鐢ㄣ�傝�岃繖涓挬瀛愬氨浼氬湪杩欎釜鎯呭喌涓嬭璋冪敤銆�
- // // 鍙互璁块棶缁勪欢瀹炰緥 `this`
- // },
+ created() {
+ this.getInspectionTableData()
+ },
updated() {
if (this.$route.name === 'ForInspectionDetail') this.showDetail = true
},
methods: {
- goToForInspectionDetail() {
- this.$router.push('/rawMaterials/reportForInspection/forInspectionDetail')
+ async getInspectionTableData() {
+ const res = await getInspectionList({ pageSize: this.currentPage, countSize: this.pageSize })
+ // this.inspectionTable = data
+ console.log(res)
+ this.inspectionTable = res.data
},
+ async goToForInspectionDetail() {
+ try {
+ //
+ const form = new FormData()
+ form.append('type', this.addInspectionType)
+ let { data: inspectionDetail } = await addInspection(form)
+ // console.log(res)
+ inspectionDetail = JSON.stringify(inspectionDetail)
+ this.$message.success('娣诲姞鎴愬姛')
+ this.$router.push({ path: '/rawMaterials/reportForInspection/forInspectionDetail', query: { inspectionDetail }})
+ } catch (error) {
+ this.$message.error('娣诲姞澶辫触')
+ }
+ },
+ // 鏌ョ湅瀵瑰簲鐢宠鍗曡鎯�
handleClick(row) {
- console.log(row)
+ const inspectionDetail = JSON.stringify(row)
+ this.$router.push({ path: '/rawMaterials/reportForInspection/forInspectionDetail', query: { inspectionDetail }})
},
// 姣忛〉鏉℃暟鏀瑰彉鏃惰Е鍙� 閫夋嫨涓�椤垫樉绀哄灏戣
handleSizeChange(val) {
@@ -268,6 +281,8 @@
height: 100%;
display: flex;
flex-direction: column;
+ min-height: calc(100vh - 88px);
+ padding: 15px;
}
.top-bar{
margin: -25px;
@@ -320,6 +335,11 @@
flex-direction: column;
.el-table {
flex: 1;
+ display: flex;
+ flex-direction: column;
+ ::v-deep .el-table__body-wrapper{
+ flex: 1;
+ }
}
>div:nth-child(2){
display: flex;
--
Gitblit v1.9.3