From a235a309cbb0290b2d929abe85d645cbfcd39f74 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期五, 28 三月 2025 14:12:09 +0800 Subject: [PATCH] 全局修改-按回车搜索 --- src/views/business/productOrder/components/add.vue | 74 +++++++++++++++++-------------------- 1 files changed, 34 insertions(+), 40 deletions(-) diff --git a/src/views/business/productOrder/components/add.vue b/src/views/business/productOrder/components/add.vue index 909003a..307633f 100644 --- a/src/views/business/productOrder/components/add.vue +++ b/src/views/business/productOrder/components/add.vue @@ -232,6 +232,7 @@ </div> </div> <el-table ref="sampleTable" :data="sampleList" border class="el-table sampleTable" highlight-current-row + :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" max-height="400px" tooltip-effect="dark" @selection-change="selectSample" @row-click="rowClick"> <el-table-column v-if="active==1" :selectable="selectable" type="selection" width="60"></el-table-column> <el-table-column align="center" label="搴忓彿" type="index" width="65"></el-table-column> @@ -295,8 +296,9 @@ </template> </el-table-column> </el-table> - <el-table ref="productTable" v-loading="getProductLoad" :data="productList" :row-class-name="tableRowClassName" border class="el-table" - :key="upIndex" + <el-table ref="productTable" v-loading="getProductLoad" :data="productList" + :row-class-name="tableRowClassName" border class="el-table" + :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" max-height="400px" style="margin-bottom: 10px;" tooltip-effect="dark" @select="selectOne" @selection-change="selectProduct" @select-all="handleAll"> <el-table-column v-if="active==1" :selectable="selectable0" type="selection" width="65"></el-table-column> @@ -354,11 +356,6 @@ size="small" type="textarea" @change="e=>requestChange(e,scope.row,'radius')"> </el-input> -<!-- <el-select v-else-if="scope.row.inspectionItem.includes('楂樻俯鍘嬪姏璇曢獙') && (active==1||tabIndex==4)" v-model="scope.row.radius" clearable--> -<!-- placeholder="鏉′欢"--> -<!-- size="small" @change="e=>requestChange(e,scope.row,'radius')">--> -<!-- <el-option v-for="(a,i) in JSON.parse(scope.row.radiusList)" :key="i" :label="a" :value="a"></el-option>--> -<!-- </el-select>--> <span v-else>{{scope.row.radius}}</span> </template> </el-table-column> @@ -377,16 +374,10 @@ </el-table-column> <el-table-column label="璁¢噺鍗曚綅" prop="unit" show-overflow-tooltip width="100"></el-table-column> <el-table-column label="鍗曚环" prop="price" show-overflow-tooltip width="100"></el-table-column> - <!-- <el-table-column prop="manDay" label="棰勮鏃堕棿(澶�)" width="120" show-overflow-tooltip></el-table-column> - <el-table-column prop="manHour" label="宸ユ椂绯绘暟" width="100" show-overflow-tooltip></el-table-column> --> - <!-- <el-table-column prop="deviceGroup" label="璁惧缁�" width="120" show-overflow-tooltip></el-table-column> --> <el-table-column label="鍖洪棿" min-width="120" prop="section" show-overflow-tooltip></el-table-column> <el-table-column :filter-method="filterHandler" :filters="filters" label="瀛愬疄楠屽" min-width="130" prop="sonLaboratory" show-overflow-tooltip></el-table-column> - <el-table-column v-if="isSpecial&&active==1" - fixed="right" - label="鎿嶄綔" - width="100"> + <el-table-column v-if="isSpecial&&active==1" label="鎿嶄綔" width="100"> <template slot-scope="scope"> <el-button v-if="!scope.row.repetitionTag" size="small" type="text" @click="addProductList(productList,scope.row,scope.$index)">鎻掑叆琛�</el-button> <el-button v-if="!!scope.row.repetitionTag&&scope.row.delete" size="small" type="text" @click="deleteProductList(scope.$index,productList)">鍒犻櫎</el-button> @@ -596,7 +587,7 @@ } from "@/api/business/rawMaterialOrder"; import { addInsOrder, addInsOrderTemplate, delInsOrderTemplate, - getQuarterOnOrder, + getQuarterOnOrder, selectInsOrderTemplateById, selectOrderManDay, updateInsOrder, upInsOrder, @@ -606,6 +597,7 @@ import {selectsStandardMethodByFLSSM} from "@/api/standard/standardLibrary"; import limsTable from "@/components/Table/lims-table.vue"; import {selectCustomPageList} from "@/api/system/customer"; +import {mapGetters} from "vuex"; export default { name: 'Add', @@ -613,6 +605,9 @@ limsTable, cableConfig, AuxiliaryWireCore + }, + computed:{ + ...mapGetters(["nickName"]), }, dicts: ['check_type1', 'urgency_level', 'form_type', 'sample_status_list'], data() { @@ -845,6 +840,7 @@ this.active = this.$route.query.active this.tabIndex = this.$route.query.tabIndex this.currentId = this.$route.query.currentId + this.getUserNowData() this.getInfo() }, activated() { @@ -855,7 +851,6 @@ }, methods: { getInfo() { - this.getUserNowData() this.selectStandardTreeList() this.getAuthorizedPerson(); this.selectStandardMethods() @@ -899,7 +894,6 @@ this.isSpecial = true this.$nextTick(() => { this.$refs.productTable.doLayout(); - this.upIndex++ }); }, getQuarterOnOrderList () { @@ -980,7 +974,7 @@ }, // 鑾峰彇鐢ㄦ埛鍒楄〃 getAuthorizedPerson() { - selectUserCondition().then(res => { + selectUserCondition({ type: 1 }).then(res => { let data = [] res.data.forEach(a => { data.push({ @@ -1125,7 +1119,9 @@ sampleList.forEach(a => { if (a.insProduct.length > 0) { a.insProduct.forEach(c => { - delete c.id + if (this.tabIndex != 4) { + delete c.id + } }) } if (a.endModels) { @@ -1163,7 +1159,9 @@ sampleList.forEach(a => { if (a.insProduct.length > 0) { a.insProduct.forEach(c => { - delete c.id + if (this.tabIndex != 4) { + delete c.id + } }) } if (a.endModels) { @@ -1262,14 +1260,16 @@ } }, saveMethod(sampleList){ - console.log('sampleList----', sampleList) this.saveLoad = true if (this.addObj.quarterItemId) { this.addObj.quarterItemId = this.addObj.quarterItemId[1] } if(this.tabIndex==4&&this.active==2){ + if (this.addObj.createTime) { + delete this.addObj.createTime + } // 閫�鍥炲悗鎻愪氦 - updateInsOrder({insOrder: this.addObj, sampleList: sampleList}).then(res => { + updateInsOrder({insOrder: this.addObj, sampleProduct: sampleList}).then(res => { this.saveLoad = false this.$message.success('宸叉彁浜�') this.bsm3Dia = false; @@ -1301,7 +1301,6 @@ company: this.addObj.company }).then(res => { this.saveLoad = false - if (res.code == 201) return this.$message.success('鎻愪氦鎴愬姛') selectOrderManDay({ id: this.currentId @@ -1339,10 +1338,6 @@ userId: this.distributeData.userId, sonLaboratory:this.distributeData.sonLaboratory }).then(res => { - if (res.code === 201) { - this.upLoad = false - return - } this.$message.success('鎻愪氦鎴愬姛') this.upLoad = false this.issuedDialogVisible = false @@ -1408,7 +1403,6 @@ if (node.data.code === '[3]') { this.sampleViewEn = val.sampleTypeEn } else if (node.data.code === '[4]') { - console.log('node.data---', node.data) if (node.data.children!==null && node.data.children.length>0) { this.sampleViewEn = val.sampleEn } @@ -1652,14 +1646,12 @@ backtrack([], nums); return result; }, - tableRowClassName({ - row, - rowIndex - }) { - if (row.state === 0) { + tableRowClassName({row, rowIndex}) { + if (row.state == 1) { + return 'warning-row'; + } else { return ''; } - return 'warning-row'; }, selectInsOrderTemplate() { selectInsOrderTemplate({company: this.addObj.company}).then(res => { @@ -1676,9 +1668,6 @@ delInsOrderTemplate({ id: row.id }).then(res => { - if (res.code === 201) { - return - } this.$message.success('鍒犻櫎鎴愬姛') this.selectInsOrderTemplate() }).catch(e => { @@ -1715,12 +1704,13 @@ selectInsOrderTemplateById({id: e}).then(res => { let obj = JSON.parse(res.data) //鍒跺崟浜鸿缃负褰撳墠鐧诲綍鐢ㄦ埛 - let user = JSON.parse(localStorage.getItem('user')) + let user = this.nickName obj.addObj.custom = user.name obj.addObj.userId = user.userId this.addObj = obj.addObj; this.sampleList = obj.sampleList; this.selectTree = obj.selectTree + this.rowClick(this.sampleList[0]) }) }, delSampleAndProduct() { @@ -2221,7 +2211,11 @@ </script> <style scoped> -.el-table .warning-row .cell { - color: #3A7BFA; +>>>.warning-row { + color: #1890FF; +} +.node_i { + color: orange; + font-size: 18px; } </style> -- Gitblit v1.9.3