From 7bdc84b5844d2a481e2f17cdd2c8204fd4a403ee Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 29 九月 2025 16:48:31 +0800
Subject: [PATCH] 业务管理相关页面添加`批号`查询条件
---
src/views/business/productSamplingInfo/index.vue | 235 ++++++++++++++++++++++++++++++++--------------------------
1 files changed, 128 insertions(+), 107 deletions(-)
diff --git a/src/views/business/productSamplingInfo/index.vue b/src/views/business/productSamplingInfo/index.vue
index a7c2831..9cf3667 100644
--- a/src/views/business/productSamplingInfo/index.vue
+++ b/src/views/business/productSamplingInfo/index.vue
@@ -1,18 +1,18 @@
<template>
<div class="capacity-scope">
<div style="display: flex;justify-content: space-between">
- <el-form :model="entity" ref="entity" size="small" :inline="true">
- <el-form-item label="缂栧彿" prop="quarterNo" v-show="tabIndex === 0">
- <el-input v-model="entity.quarterNo" clearable placeholder="璇疯緭鍏�"
- size="small"
- @keyup.enter.native="refreshTable">
+ <div class="search_box">
+ <div class="search_item">
+ <span class="search_label">缂栧彿</span>
+ <el-input v-model="entity.quarterNo" clearable placeholder="璇疯緭鍏�" size="small"
+ @keyup.enter.native="refreshTable()">
</el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">鏌� 璇�</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="refresh">閲� 缃�</el-button>
- </el-form-item>
- </el-form>
+ </div>
+ <div class="search_button">
+ <el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</el-button>
+ <el-button size="mini" @click="refresh">閲嶇疆</el-button>
+ </div>
+ </div>
<div>
<el-button v-if="tabIndex === 1" size="small" type="primary" @click="yearSample('add')">骞村害鎶芥牱</el-button>
</div>
@@ -20,203 +20,210 @@
<div>
<div class="table">
<ul class="tab">
- <li v-for="(m,i) in tabList" :key="i" :class="{active:i===tabIndex}" @click="handleTab(m,i)">{{m.label}}</li>
+ <li v-for="(m, i) in tabList" :key="i" :class="{ active: i === tabIndex }" @click="handleTab(m, i)">{{ m.label }}</li>
</ul>
<!--瀛e害-->
- <lims-table :tableData="tableData" :column="column" v-if="tabIndex === 0"
- @pagination="pagination" :height="'calc(100vh - 290px)'"
- :page="page" :tableLoading="tableLoading"></lims-table>
+ <lims-table :tableData="tableData" :column="column" v-if="tabIndex === 0" @pagination="pagination"
+ :height="'calc(100vh - 290px)'" :page="page" :tableLoading="tableLoading"></lims-table>
<!--骞村害-->
- <lims-table :tableData="tableData1" :column="column1" v-if="tabIndex === 1"
- @pagination="pagination1" :height="'calc(100vh - 290px)'"
- key="tableData1" :page="page1" :tableLoading="tableLoading1"></lims-table>
+ <lims-table :tableData="tableData1" :column="column1" v-if="tabIndex === 1" @pagination="pagination1"
+ :height="'calc(100vh - 290px)'" key="tableData1" :page="page1" :tableLoading="tableLoading1"></lims-table>
</div>
</div>
- <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="yearSampleDia" title="骞村害鎶芥牱" width="70%"
- @close="closeYearSampleDia">
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="yearSampleDia" title="骞村害鎶芥牱"
+ width="70%" @close="closeYearSampleDia">
<div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px">
- <div style="width: 30%;display: flex;align-items: center;" >
- <el-input v-if="operationType !=='view'" v-model="currentYear" size="small"/>
- <span v-if="operationType ==='view'" style="width: 160px;font-size: 18px;font-weight: 600">{{currentYear}}</span>
+ <div style="width: 30%;display: flex;align-items: center;">
+ <el-input v-if="operationType !== 'view'" v-model="currentYear" size="small" />
+ <span v-if="operationType === 'view'"
+ style="width: 160px;font-size: 18px;font-weight: 600">{{ currentYear }}</span>
</div>
- <div v-if="operationType !== 'view'">
+ <div v-if="operationType !== 'view'">
<el-button size="small" type="primary" @click="addQuarter">娣诲姞</el-button>
<el-button size="small" type="danger" @click="clearTable">娓呯┖</el-button>
</div>
</div>
<div>
- <el-table :data="yearItems" border height="450" style="width: 100%">
+ <el-table :data="yearItems" border height="450" style="width: 100%"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }">
<el-table-column label="绫诲埆" prop="yearType" width="240">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.yearType" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.yearType" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.yearType}}</span>
+ <span size="small">{{ row.yearType }}</span>
</template>
</template>
</el-table-column>
<el-table-column header-align="center" label="1" prop="january" width="160">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.january" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.january" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.january}}</span>
+ <span size="small">{{ row.january }}</span>
</template>
</template>
</el-table-column>
<el-table-column header-align="center" label="2" prop="february" width="160">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.february" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.february" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.february}}</span>
+ <span size="small">{{ row.february }}</span>
</template>
</template>
</el-table-column>
<el-table-column header-align="center" label="3" prop="march" width="160">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.march" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.march" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.march}}</span>
+ <span size="small">{{ row.march }}</span>
</template>
</template>
</el-table-column>
<el-table-column header-align="center" label="4" prop="april" width="160">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.april" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.april" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.april}}</span>
+ <span size="small">{{ row.april }}</span>
</template>
</template>
</el-table-column>
<el-table-column header-align="center" label="5" prop="may" width="160">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.may" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.may" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.may}}</span>
+ <span size="small">{{ row.may }}</span>
</template>
</template>
</el-table-column>
<el-table-column header-align="center" label="6" prop="june" width="160">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.june" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.june" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.june}}</span>
+ <span size="small">{{ row.june }}</span>
</template>
</template>
</el-table-column>
<el-table-column header-align="center" label="7" prop="july" width="160">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.july" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.july" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.july}}</span>
+ <span size="small">{{ row.july }}</span>
</template>
</template>
</el-table-column>
<el-table-column header-align="center" label="8" prop="august" width="160">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.august" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.august" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.august}}</span>
+ <span size="small">{{ row.august }}</span>
</template>
</template>
</el-table-column>
<el-table-column header-align="center" label="9" prop="september" width="160">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.september" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.september" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.september}}</span>
+ <span size="small">{{ row.september }}</span>
</template>
</template>
</el-table-column>
<el-table-column header-align="center" label="10" prop="october" width="160">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.october" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.october" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.october}}</span>
+ <span size="small">{{ row.october }}</span>
</template>
</template>
</el-table-column>
<el-table-column header-align="center" label="11" prop="november" width="160">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.november" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.november" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.november}}</span>
+ <span size="small">{{ row.november }}</span>
</template>
</template>
</el-table-column>
<el-table-column header-align="center" label="12" prop="december" width="160">
<template slot-scope="{row}">
<template v-if="operationType !== 'view'">
- <el-input v-model="row.december" size="small" type="textarea" :rows="4"/>
+ <el-input v-model="row.december" size="small" type="textarea" :rows="4" />
</template>
<template v-else>
- <span size="small">{{row.december}}</span>
+ <span size="small">{{ row.december }}</span>
</template>
</template>
</el-table-column>
- <el-table-column v-if="operationType !== 'view'" fixed="right" label="鎿嶄綔" width="100">
+ <el-table-column v-if="operationType !== 'view'" fixed="right" label="鎿嶄綔" width="100">
<template slot-scope="scope">
- <el-button size="small" style="color: #f56c6c" type="text" @click="deleteScope(scope.$index)">鍒犻櫎</el-button>
+ <el-button size="small" style="color: #f56c6c" type="text"
+ @click="deleteScope(scope.$index)">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div style="display: flex;align-items: center;margin-top: 10px">
<span style="width: 70px">娉ㄦ剰浜嬮」锛�</span>
- <el-input v-model="yearSampleForm.tableRemark" :disabled="operationType === 'view'" size="small" style="width: 50%" type="textarea"></el-input>
+ <el-input v-model="yearSampleForm.tableRemark" :disabled="operationType === 'view'" size="small"
+ style="width: 50%" type="textarea"></el-input>
</div>
<div style="display: flex;align-items: center;margin-top: 10px">
<span style="width: 70px">澶囨敞锛�</span>
- <el-input v-model="yearSampleForm.remark" :disabled="operationType === 'view'" size="small" style="width: 50%" type="textarea"></el-input>
+ <el-input v-model="yearSampleForm.remark" :disabled="operationType === 'view'" size="small" style="width: 50%"
+ type="textarea"></el-input>
</div>
<div v-if="operationType !== 'add'">
<el-form ref="form" :model="editYearFormRow" label-width="70px">
<el-col :span="12">
<el-form-item label="缂栧埗浜猴細">
- <el-select v-model="editYearFormRow.writeUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+ <el-select v-model="editYearFormRow.writeUser" :disabled="operationType !== 'edit'" placeholder="璇烽�夋嫨"
+ size="small" style="width: 100%">
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="浼氱浜猴細">
- <el-select v-model="editYearFormRow.countersignUser" :disabled="operationType !=='edit'" multiple placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+ <el-select v-model="editYearFormRow.countersignUser" :disabled="operationType !== 'edit'" multiple
+ placeholder="璇烽�夋嫨" size="small" style="width: 100%">
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="瀹℃牳浜猴細">
- <el-select v-model="editYearFormRow.examineUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+ <el-select v-model="editYearFormRow.examineUser" :disabled="operationType !== 'edit'" placeholder="璇烽�夋嫨"
+ size="small" style="width: 100%">
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="鎵瑰噯浜猴細">
- <el-select v-model="editYearFormRow.ratifyUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+ <el-select v-model="editYearFormRow.ratifyUser" :disabled="operationType !== 'edit'" placeholder="璇烽�夋嫨"
+ size="small" style="width: 100%">
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
@@ -242,12 +249,12 @@
finalReportSpotCheckYear,
getQuarterPage, getSpotCheckYear, getSpotCheckYearPage, updateSpotCheckYear
} from "@/api/business/productSamplingInfo";
-import {selectUserCondition} from "@/api/performance/class";
+import { selectUserCondition } from "@/api/performance/class";
export default {
- name: "b1-product-sampling-info",
+ name: "ProductSamplingInfo",
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
- components: {limsTable, AddQuarterItem},
+ components: { limsTable, AddQuarterItem },
data() {
// 杩欓噷瀛樻斁鏁版嵁
return {
@@ -269,10 +276,10 @@
tableData: [],
tableLoading: false,
column: [
- {label: '缂栧彿', prop: 'quarterNo'},
- {label: '澶囨敞', prop: 'remark'},
- {label: '鍒涘缓浜�', prop: 'createUserName'},
- {label: '鍒涘缓鏃堕棿', prop: 'createTime'},
+ { label: '缂栧彿', prop: 'quarterNo' },
+ { label: '澶囨敞', prop: 'remark' },
+ { label: '鍒涘缓浜�', prop: 'createUserName' },
+ { label: '鍒涘缓鏃堕棿', prop: 'createTime' },
{
dataType: 'action',
label: '鎿嶄綔',
@@ -309,9 +316,9 @@
}
],
page: {
- total:0,
- size:10,
- current:1
+ total: 0,
+ size: 20,
+ current: 1
},
tableData1: [],
tableLoading1: false,
@@ -356,7 +363,7 @@
],
page1: {
total: 0,
- size: 10,
+ size: 20,
current: 1
},
yearSampleDia: false, // 骞村害鎶芥牱
@@ -384,17 +391,17 @@
// 鏂规硶闆嗗悎
methods: {
// 鏌ヨ鍥炶皟
- refreshTable(e) {
+ refreshTable() {
if (this.tabIndex === 0) {
this.getQuarterPageList()
} else if (this.tabIndex === 1) {
this.getSpotCheckYearPageList()
}
},
- getQuarterPageList () {
+ getQuarterPageList() {
this.tableLoading = true
getQuarterPage({
- ...this.page,...this.entity
+ ...this.page, ...this.entity
}).then(res => {
this.tableLoading = false
this.page.total = res.data.total
@@ -403,7 +410,7 @@
this.tableLoading = false
})
},
- getSpotCheckYearPageList () {
+ getSpotCheckYearPageList() {
this.tableLoading1 = true
getSpotCheckYearPage({
...this.page1
@@ -420,78 +427,76 @@
this.resetForm('entity')
this.refreshTable()
},
- pagination (page) {
+ pagination(page) {
this.page.size = page.limit
this.refreshTable()
},
- pagination1 (page) {
+ pagination1(page) {
this.page1.size = page.limit
this.refreshTable()
},
// 缂栬緫瀛e害鎶芥牱
- editForm (row) {
+ editForm(row) {
this.$refs.addQuarterItem.openDia(row, 'edit')
},
// 鏌ョ湅瀛e害鎶芥牱
- viewQuarterInfo (row) {
+ viewQuarterInfo(row) {
this.$refs.addQuarterItem.openDia(row, 'view')
},
// 鍒犻櫎瀛e害鎶芥牱
- deleteQuarterInfo (row) {
+ deleteQuarterInfo(row) {
this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", {
confirmButtonText: "纭畾",
cancelButtonText: "鍙栨秷",
type: "warning"
}).then(() => {
- deleteQuarter({quarterId: row.quarterId}).then(res => {
+ deleteQuarter({ quarterId: row.quarterId }).then(res => {
if (res.code === 200) {
this.$message.success('鍒犻櫎鎴愬姛')
this.refreshTable()
}
})
- }).catch(() => {})
+ }).catch(() => { })
},
// 瀵煎嚭
- handleDown (row) {
+ handleDown(row) {
let randomNum = Math.random();
- finalReportQuarter({quarterId: row.quarterId, random: randomNum}).then(res => {
+ finalReportQuarter({ quarterId: row.quarterId, random: randomNum }).then(res => {
this.outLoading = false
const blob = new Blob([res], { type: 'application/octet-stream' });
this.$download.saveAs(blob, '瀛e害鎶芥牱淇℃伅瀵煎嚭.docx')
- this.$message.success('瀵煎嚭鎴愬姛')
})
},
// 骞村害涓嬭浇
download(row) {
- finalReportSpotCheckYear({yearId: row.yearId}).then(res => {
+ finalReportSpotCheckYear({ yearId: row.yearId }).then(res => {
this.outLoading = false
const blob = new Blob([res], { type: 'application/octet-stream' });
this.$download.saveAs(blob, row.yearHead + '.docx')
- this.$message.success('瀵煎嚭鎴愬姛')
})
},
// 鍒犻櫎骞村害鎶芥牱
- deleteYearInfo (row) {
+ deleteYearInfo(row) {
this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", {
confirmButtonText: "纭畾",
cancelButtonText: "鍙栨秷",
type: "warning"
}).then(() => {
- deleteSpotCheckYear({yearId: row.yearId}).then(res => {
+ deleteSpotCheckYear({ yearId: row.yearId }).then(res => {
if (res.code === 200) {
this.$message.success('鍒犻櫎鎴愬姛')
this.refreshTable()
}
})
- }).catch(() => {})
+ }).catch(() => { })
},
// 鏌ョ湅骞村害璇︽儏
- viewYearInfo (row) {
+ viewYearInfo(row) {
this.operationType = 'view'
this.getUserList()
this.yearSampleDia = true
this.yearRow = row
- getSpotCheckYear({yearId: row.yearId}).then(res => {
+ getSpotCheckYear({ yearId: row.yearId }).then(res => {
if (res.code === 200) {
this.currentYear = res.data.yearHead
this.yearItems = res.data.yearItems
@@ -508,11 +513,11 @@
})
},
// 缂栬緫骞村害鎶芥牱
- editYearForm (row) {
+ editYearForm(row) {
this.operationType = 'edit'
this.getUserList()
this.yearSampleDia = true
- getSpotCheckYear({yearId: row.yearId}).then(res => {
+ getSpotCheckYear({ yearId: row.yearId }).then(res => {
if (res.code === 200) {
this.currentYear = res.data.yearHead
this.yearItems = res.data.yearItems
@@ -529,7 +534,7 @@
})
},
// 鎻愪氦骞村害璁″垝
- handleSample () {
+ handleSample() {
if (this.operationType === 'add') {
this.yearSampleForm.yearItems = JSON.parse(JSON.stringify(this.yearItems))
this.yearSampleForm.yearHead = this.currentYear
@@ -543,7 +548,7 @@
}
})
} else {
- const params = {...this.editYearFormRow}
+ const params = { ...this.editYearFormRow }
if (params.countersignUser != null) {
params.countersignUser = params.countersignUser.join(',')
}
@@ -568,33 +573,30 @@
})
}
},
- yearSample (type) {
+ yearSample(type) {
this.operationType = type
const currentDate = new Date();
this.yearSampleDia = true
this.currentYear = currentDate.getFullYear() + '骞村勾搴︽娊妫�璁″垝'
},
// 娣诲姞骞村害璁″垝
- addQuarter () {
+ addQuarter() {
this.yearItems.push({})
},
// 娓呯┖鎶芥牱璁″垝
- clearTable () {
+ clearTable() {
this.yearItems = []
},
// 鎵嬪姩鍒犻櫎
- deleteScope (index) {
+ deleteScope(index) {
this.yearItems.splice(index, 1)
},
// 鍒囨崲涓嬪崟tab琛ㄦ牸
handleTab(m, i) {
this.tabIndex = i;
- if (this.tabIndex === 0) {
- this.componentData.entity.quarterNo = this.entity.quarterNo
- }
this.refreshTable()
},
- closeYearSampleDia () {
+ closeYearSampleDia() {
this.yearSampleForm = {
tableRemark: '',
remark: ''
@@ -602,11 +604,11 @@
this.yearItems = []
this.yearSampleDia = false
},
- getStyle(){
- return 'height: calc(100% - '+'44'+'px)'
+ getStyle() {
+ return 'height: calc(100% - ' + '44' + 'px)'
},
- getUserList(){
- selectUserCondition({ type: 0 }).then((res) => {
+ getUserList() {
+ selectUserCondition().then((res) => {
this.userList = res.data;
})
},
@@ -644,4 +646,23 @@
border-color: #3A7BFA;
color: #3A7BFA;
}
+.search_box {
+ display: flex;
+}
+.search_item {
+ margin-bottom: 18px;
+ margin-right: 10px;
+ display: flex;
+ align-items: center;
+ line-height: 32px;
+}
+.search_label {
+ width: 52px;
+ font-size: 14px;
+ font-weight: 700;
+ color: #606266;
+}
+.search_button {
+ line-height: 30px;
+}
</style>
--
Gitblit v1.9.3