From b64d6db597d332c699f84e4928f6d3e5551851f1 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期二, 04 三月 2025 16:43:16 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- src/views/business/productSamplingInfo/index.vue | 185 +++++++++++++++++++++++---------------------- 1 files changed, 94 insertions(+), 91 deletions(-) diff --git a/src/views/business/productSamplingInfo/index.vue b/src/views/business/productSamplingInfo/index.vue index a7c2831..bebf98a 100644 --- a/src/views/business/productSamplingInfo/index.vue +++ b/src/views/business/productSamplingInfo/index.vue @@ -3,9 +3,8 @@ <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"> + <el-input v-model="entity.quarterNo" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable"> </el-input> </el-form-item> <el-form-item> @@ -20,26 +19,25 @@ <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> @@ -49,174 +47,181 @@ <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 +247,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", // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� - components: {limsTable, AddQuarterItem}, + components: { limsTable, AddQuarterItem }, data() { // 杩欓噷瀛樻斁鏁版嵁 return { @@ -269,10 +274,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 +314,9 @@ } ], page: { - total:0, - size:10, - current:1 + total: 0, + size: 10, + current: 1 }, tableData1: [], tableLoading1: false, @@ -391,10 +396,10 @@ 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 +408,7 @@ this.tableLoading = false }) }, - getSpotCheckYearPageList () { + getSpotCheckYearPageList() { this.tableLoading1 = true getSpotCheckYearPage({ ...this.page1 @@ -420,78 +425,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 +511,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 +532,7 @@ }) }, // 鎻愪氦骞村害璁″垝 - handleSample () { + handleSample() { if (this.operationType === 'add') { this.yearSampleForm.yearItems = JSON.parse(JSON.stringify(this.yearItems)) this.yearSampleForm.yearHead = this.currentYear @@ -543,7 +546,7 @@ } }) } else { - const params = {...this.editYearFormRow} + const params = { ...this.editYearFormRow } if (params.countersignUser != null) { params.countersignUser = params.countersignUser.join(',') } @@ -568,22 +571,22 @@ }) } }, - 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琛ㄦ牸 @@ -594,7 +597,7 @@ } this.refreshTable() }, - closeYearSampleDia () { + closeYearSampleDia() { this.yearSampleForm = { tableRemark: '', remark: '' @@ -602,10 +605,10 @@ this.yearItems = [] this.yearSampleDia = false }, - getStyle(){ - return 'height: calc(100% - '+'44'+'px)' + getStyle() { + return 'height: calc(100% - ' + '44' + 'px)' }, - getUserList(){ + getUserList() { selectUserCondition({ type: 0 }).then((res) => { this.userList = res.data; }) -- Gitblit v1.9.3