From 52594553248e87dd391c9d061256b7076b73d67c Mon Sep 17 00:00:00 2001 From: 王震 <10952869+daywangzhen@user.noreply.gitee.com> Date: 星期五, 19 一月 2024 14:32:59 +0800 Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before --- src/views/quality/rawMaterial/rawMaterial-form.vue | 32 ++++--- src/views/basic/template/index.vue | 2 src/views/technology/routing/routing-form.vue | 15 +++ src/views/plan/manufacturingorder/productorder-form.vue | 134 ++++++++++++++++++++++++++++----- 4 files changed, 145 insertions(+), 38 deletions(-) diff --git a/src/views/basic/template/index.vue b/src/views/basic/template/index.vue index 4e04c9b..5f9d185 100644 --- a/src/views/basic/template/index.vue +++ b/src/views/basic/template/index.vue @@ -111,7 +111,7 @@ <el-table-column label="鍗曚綅" prop="unit" align="center"> </el-table-column> - <el-table-column label="鎿嶄綔" align="center" + <el-table-column label="鎿嶄綔" align="center" v-if="permissions.technology_operationtemplate_param_edit"> <template slot-scope="scope"> <el-button diff --git a/src/views/plan/manufacturingorder/productorder-form.vue b/src/views/plan/manufacturingorder/productorder-form.vue index 50a0c0c..ef8922c 100644 --- a/src/views/plan/manufacturingorder/productorder-form.vue +++ b/src/views/plan/manufacturingorder/productorder-form.vue @@ -268,7 +268,7 @@ <el-row> <el-col :span="24" class="productorder-operates-col"> <el-card class="productorder-operates" > - <el-row> + <!-- <el-row> <el-col :span="2" class="frame1">搴忓彿 </el-col> <el-col :span="4" class="frame1">宸ュ簭鍙� @@ -279,44 +279,57 @@ </el-col> <el-col :span="3" class="frame1">鎿嶄綔 </el-col> - </el-row> - <!-- <el-table + </el-row> --> + <el-table + id="operationTable" ref="operationTable" + class="basic-template-table" :data="operations" - style="width: 100%;" height="593px" + border highlight-current-row :default-sort="{ prop: 'operationOrder' }" @row-click="operationRowClick" > <el-table-column prop="operationOrder" + min-width="50" label="搴忓彿" - ></el-table-column> + > + <template slot-scope="scope"> + <div style="display:flex"> + <span style="width:20px;"> + <i class="icon aufontAll h-icon-all-drag"></i + ></span> + <span>{{ scope.row.operationOrder }}</span> + </div> + </template> + </el-table-column> <el-table-column prop="operationNo" header-align="center" align="center" + min-width="100" label="宸ュ簭鍙�" ></el-table-column> <el-table-column prop="operationName" header-align="center" align="center" + min-width="100" label="宸ュ簭鎻忚堪" ></el-table-column> - <el-table-column prop="partName" header-align="center" - align="center" + min-width="100px" label="闆朵欢" ></el-table-column> - <el-table-column prop="remark" header-align="center" align="center" + min-width="50" label="鎿嶄綔" > <template slot-scope="scope"> @@ -328,8 +341,8 @@ </el-button> </template> </el-table-column> - </el-table> --> - <zttdraggable + </el-table> + <!-- <zttdraggable :forceFallback="true" :list="operations" :animation="200" @@ -363,14 +376,10 @@ </el-col> </el-row> </div> - </zttdraggable> + </zttdraggable> --> </el-card> </el-col> </el-row> - - - - </el-col> <el-col :span="16"> <el-tabs type="card" ref="paramTabs"> @@ -1064,12 +1073,40 @@ .productorder-operates-col { margin-bottom: 0px; } +.basic-template-table .el-table__body .el-table__row td:first-child .cell { + padding-left: 0px; + padding-right: 0px; +} + +.basic-template-table .el-table__body .el-table__row:hover { + cursor: move; +} + +.basic-template-table .el-table__body .el-table__row:hover .icon { + display: inline-block; +} + +.basic-template-table .el-table__body .el-table__row .icon { + color: rgba(0, 0, 0, 0.45); + font-size: 12px; + line-height: 18px; + display: none; +} + +.aufontAll { + font-family: aufontAll !important; + font-size: 14px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} </style> <style scoped> /deep/ .el-input-number.is-without-controls .el-input__inner { text-align: start; } + </style> <script> import { @@ -1246,6 +1283,7 @@ } }, mounted() { + this.rowDrop() window.addEventListener( 'hashchange', () => { @@ -1405,6 +1443,50 @@ } }, methods: { + rowDrop() { + const that = this + const tbody = document.querySelector( + '#operationTable .el-table__body-wrapper tbody' + ) + Sortable.create(tbody, { + // 缁撴潫鎷栨嫿 + onEnd({ newIndex, oldIndex }) { + if (newIndex > oldIndex) { + // 涓嬬Щ + that.operations + .filter((e) => e.operationOrder == oldIndex + 1) + .forEach((e) => (e.operationOrder = 'x')) + that.operations + .filter((e) => e.operationOrder > oldIndex + 1 && e.operationOrder <= newIndex + 1) + .forEach((e) => (e.operationOrder = e.operationOrder - 1)) + that.operations + .filter((e) => e.operationOrder == 'x') + .forEach((e) => (e.operationOrder = newIndex + 1)) + } else if (oldIndex > newIndex) { + // 涓婄Щ + that.operations + .filter((e) => e.operationOrder == oldIndex + 1) + .forEach((e) => (e.operationOrder = 'x')) + that.operations + .filter((e) => e.operationOrder < oldIndex + 1 && e.operationOrder >= newIndex + 1) + .forEach((e) => (e.operationOrder = e.operationOrder + 1)) + that.operations + .filter((e) => e.operationOrder == 'x') + .forEach((e) => (e.operationOrder = newIndex + 1)) + } + // 鎷栨嫿缁撴潫鍚庯紝淇濆瓨鏂扮殑鎺掑簭 + let data = that.operations.map(el =>{ + return { + id:el.id, + operationOrder:el.operationOrder, + } + }) + changeOrder(data).then().catch(error => { + console.error(error) + }); + } + }) + }, dragEnd(e){ this.operations.forEach((e, i) => { e.index = i + 1 @@ -1422,8 +1504,8 @@ }) changeOrder(data).then((res) =>{ }).catch(error => { - console.error(error) - }); + console.error(error) + }); }, getSysParam(paramKey) { getSysParam(paramKey).then((response) => { @@ -1689,7 +1771,7 @@ }, // 2.tabs-宸ヨ壓璺嚎 //宸ヨ壓鏂囦欢閫夋嫨 - + // 宸ヨ壓璺嚎閫夋嫨 routingSelectChanged(routingId) { this.currentRouting = this.dataForm.routingList.find( @@ -1762,8 +1844,9 @@ this.dataForm.bomId = null }, // 鐐瑰嚮宸ヨ壓宸ュ簭琛岃Е鍙戞牎楠屽伐鑹烘槸鍚︿慨鏀癸紝鑻ヤ慨鏀瑰垯涓嶅彲鎿嶄綔锛岄渶鍏堜繚瀛橈紝鑻ユ湭淇敼锛屽垯鍙煡璇㈠嚭瀵瑰簲鐨勫弬鏁伴泦 - operationRowClick(event) { - const row = this.operations[event.oldIndex] + operationRowClick(row) { + // const row = this.operations[event.oldIndex] + console.log(row); if (this.dataForm.id != null && this.dataForm.id !== 0) { this.routingOperationId = row.technologyRoutingOperationId this.moRoutingOperationId = row.id @@ -2018,6 +2101,17 @@ // 淇濆瓨鎵�鏈夊弬鏁扮殑淇敼 saveAllParamChange() { const paramJson = { routingOperationParam: this.templateParamList } + let num = 0 + this.templateParamList.forEach(e=>{ + var regex=/^[^\(\)|^,]+$/; + if(!regex.test(e.paramValue)){ + num+=1 + } + }) + if(num>0){ + this.$message.error("鍙傛暟鍊间笉鑳藉寘鍚嫳鏂囨嫭鍙锋垨閫楀彿,璇锋鏌�") + return + } putRoutingTemplateParamForOrder(paramJson).then((response) => { const data = response.data if (data.code === 0) { diff --git a/src/views/quality/rawMaterial/rawMaterial-form.vue b/src/views/quality/rawMaterial/rawMaterial-form.vue index 2f1fe2b..53a8f6a 100644 --- a/src/views/quality/rawMaterial/rawMaterial-form.vue +++ b/src/views/quality/rawMaterial/rawMaterial-form.vue @@ -497,7 +497,7 @@ let val = sessionStorage.getItem("raw-resultVal-"+this.dataForm.id) val == undefined ? null : this.resultVal=val } - this.init() + this.init(this.dataForm.id) this.getDeviceList() }, watch:{ @@ -770,7 +770,7 @@ } updateRawInsProduct(obj).then(res=>{ if(res.data.code === 0){ - this.init() + this.init(this.dataForm.id) } }) } @@ -794,9 +794,9 @@ } } }, - init(){ - if(this.dataForm.id){ - getObj(this.dataForm.id).then(res=>{ + init(id){ + if(id){ + getObj(id).then(res=>{ let data = res.data.data this.dataForm.rawInsNo = data.rawInsNo this.dataForm.name = data.name @@ -883,12 +883,10 @@ } }, selectBlur(e){ - console.log(e,"-----"); + console.log(e,e.target.tabIndex); console.log(e.target.value); }, changeState(row, index) { - console.log(row.testValueList); - return this.$nextTick(()=>{ if(row){ let isTrue = true @@ -910,23 +908,19 @@ if (val === undefined || val === '' || val === null) { return } - console.log(val); - console.log(...row.testValueList); let obj = { deviceId: row.deviceId, rpId: row.rpId, testValue: val, note: row.note } - console.log(obj); - return updateRawInsProduct(obj).then(res => { if (res.data.code == 0) { this.$message.success("鏇存柊鎴愬姛") } else { this.$message.error("鏇存柊澶辫触") } - this.init() + this.init(this.dataForm.id) }) } }) @@ -945,7 +939,11 @@ let childrenIndex = this.list[i].children.findIndex(el =>{ return el.iid == row.iid }) - this.list[i].children.splice(childrenIndex,1) + if(this.list[i].children.length<2){ + this.list.splice(i,1) + }else{ + this.list[i].children.splice(childrenIndex,1) + } } }, //娣诲姞瀛愰」鐩� @@ -967,6 +965,7 @@ row.children.push(obj) }, save(){ + const _than = this let data = this.dataForm this.list.forEach(item=>{ item.children.forEach(c=>{ @@ -976,10 +975,13 @@ data.rawInsProducts = this.list addRawInspects(data).then(res=>{ this.$message.success("淇濆瓨鎴愬姛") - this.$router.go(-1) + // this.$router.go(-1) }).catch(error=>{ this.$message.error(error) }) + _than.$nextTick(()=>{ + _than.init(Number(res.data.msg)) + }) }, getDeviceList(){ selectDevice().then(res=>{ diff --git a/src/views/technology/routing/routing-form.vue b/src/views/technology/routing/routing-form.vue index f467d9f..9b71564 100644 --- a/src/views/technology/routing/routing-form.vue +++ b/src/views/technology/routing/routing-form.vue @@ -445,7 +445,7 @@ effect="dark" > {{ item.label }} - </el-tag> + </el-tag> </div> --> <el-divider content-position="left">澶囨敞</el-divider> <div class="node-content-remark"> @@ -695,7 +695,7 @@ dataRule: { partNo: [ { required: true, message: '闆朵欢涓嶈兘涓虹┖', trigger: 'blur' } - ], + ], bomTypeDb: [ { required: true, message: '宸ヨ壓绫诲瀷涓嶈兘涓虹┖', trigger: 'change' } ], @@ -1397,6 +1397,17 @@ // 淇濆瓨鎵�鏈夊弬鏁扮殑淇敼 saveAllParamChange() { const paramJson = { routingOperationParam: this.paramData } + let num = 0 + this.paramData.forEach(e=>{ + var regex=/^[^\(\)|^,]+$/; + if(!regex.test(e.paramValue)){ + num+=1 + } + }) + if(num>0){ + this.$message.error("鍙傛暟鍊间笉鑳藉寘鍚嫳鏂囨嫭鍙锋垨閫楀彿,璇锋鏌�") + return + } putRoutingTemplateParam(paramJson).then((response) => { const data = response.data if (data.code == 0) { -- Gitblit v1.9.3