From 9b7448cd16743f59aa8148221732daea8c4ce485 Mon Sep 17 00:00:00 2001 From: 王震 <10952869+daywangzhen@user.noreply.gitee.com> Date: 星期一, 22 一月 2024 10:01:27 +0800 Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before --- src/views/quality/rawMaterial/rawMaterial-form.vue | 94 +++++------ src/views/equipment/mouldrecord/index.vue | 83 ++-------- src/api/equipment/mouldRecord.js | 9 + src/api/equipment/moulde.js | 32 ++++ src/views/equipment/mould/index.vue | 218 +++++++++++++++++++------- src/views/quality/Packaging_ledger/index.vue | 2 src/views/common/ztt-table.vue | 2 7 files changed, 264 insertions(+), 176 deletions(-) diff --git a/src/api/equipment/mouldRecord.js b/src/api/equipment/mouldRecord.js new file mode 100644 index 0000000..1792f8d --- /dev/null +++ b/src/api/equipment/mouldRecord.js @@ -0,0 +1,9 @@ +import request from '@/router/axios' + +export function fetchList(query) { + return request({ + url: '/mes/mouldRecord/page', + method: 'get', + params: query + }) +} diff --git a/src/api/equipment/moulde.js b/src/api/equipment/moulde.js new file mode 100644 index 0000000..e4d0614 --- /dev/null +++ b/src/api/equipment/moulde.js @@ -0,0 +1,32 @@ +import request from '@/router/axios' + +export function fetchList(query) { + return request({ + url: '/mes/mould/page', + method: 'get', + params: query + }) +} + +export function addMould(data) { + return request({ + url: '/mes/mould/addMould', + method: 'post', + data: data + }) +} + +export function updateMould(data) { + return request({ + url: '/mes/mould/updateMould', + method: 'post', + data: data + }) +} + +export function delById(id) { + return request({ + url: '/mes/mould/'+id, + method: 'delete', + }) +} diff --git a/src/views/common/ztt-table.vue b/src/views/common/ztt-table.vue index e963067..717635e 100644 --- a/src/views/common/ztt-table.vue +++ b/src/views/common/ztt-table.vue @@ -509,7 +509,7 @@ 鍙兘涓婁紶xlsx/xls鏂囦欢锛屼笖涓嶈秴杩�10M<el-button type="text" style="font-size:14px;text-decoration: underline;" - @click="downDataTemplate(uploadInfo.fileName)" + @click="downDataTemplate(uploadInfo.fileName)" v-if="uploadInfo.download" >涓嬭浇妯℃澘</el-button > diff --git a/src/views/equipment/mould/index.vue b/src/views/equipment/mould/index.vue index 852675f..8f82e7d 100644 --- a/src/views/equipment/mould/index.vue +++ b/src/views/equipment/mould/index.vue @@ -1,33 +1,60 @@ <template> <div class="mod-config"> <basic-container> - <ttable - :table="table" - :isShowHide="true" - :ajaxFun="ajaxFun" - :prelang="prelang" - :options="options" - ref="processconfiguration" - > - <template #toolbar></template> - </ttable> + <ttable + @handleSelectionChange="handleSelectionChange" + :table="table" + :ajaxFun="ajaxFun" + :prelang="prelang" + :options="options" + ref="mouldTable" + class="mouldTable" + > + <template #toolbar></template> + </ttable> </basic-container> - <table-form - v-if="addOrUpdateVisible" - ></table-form> + <el-dialog + :title="editRow==null ? '鏂板':'淇敼'" + :visible.sync="dialogVisible" + width="40%"> + <el-form :model="editRow" label-position="right" label-width="100px" ref="editForm" :rules="editRules"> + <el-form-item prop="code" label="妯″叿缂栫爜"> + <el-input v-model="editRow.code" placeholder="璇疯緭鍏ユā鍏风紪鐮佺О"></el-input> + </el-form-item> + <el-form-item prop="name" label="妯″叿鍚嶇О"> + <el-input v-model="editRow.name" placeholder="璇疯緭鍏ユā鍏峰悕绉�"></el-input> + </el-form-item> + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button @click="dialogVisible = false">鍙� 娑�</el-button> + <el-button type="primary" @click="confirmSaveOrUpdateMould">纭� 瀹�</el-button> + </span> + </el-dialog> </div> </template> <script> import ttable from '@/views/common/ztt-table.vue' -import { page, } from '@/api/equipment/mould' -import TableForm from './mould-from.vue' +import * as fecha from 'element-ui/lib/utils/date' +import { fetchList,addMould,updateMould,delById } from '@/api/equipment/moulde' +import { mapGetters } from 'vuex' export default { data(){ return { - ajaxFun: page, - prelang: 'operation', - addOrUpdateVisible: false, + diaPrintTab: false, + editRules: { + code: [{required:true,message:'璇疯緭鍏ユā鍏风紪鍙�',trigger:'blur'}], + name: [{required:true,message:'璇疯緭鍏ユā鍏峰悕绉�',trigger:'blur'}] + }, + editRow: { + code: null, + name: null, + }, + dialogVisible: false, + ajaxFun: fetchList, + prelang: 'moudle', + multipleSelection: [], + dataListLoading: false, options: { height: 300, // 榛樿楂樺害-涓轰簡琛ㄥご鍥哄畾 stripe: true, // 鏄惁涓烘枒椹汗 table @@ -50,86 +77,155 @@ // 鏍囬 column: [ { - minWidth: '140', - prop: 'packageNo', - label: '璁惧', - isTrue: true, - isSearch: true, - searchInfoType: 'text', - },{ - minWidth: '140', - prop: 'outBatchNo', + minWidth: '140px', + prop: 'code', label: '妯″叿缂栧彿', isTrue: true, isSearch: true, searchInfoType: 'text', - + render: { fun: this.addOrUpdateHandle } }, { - minWidth: '140', - prop: 'partNo', + minWidth: '140px', + prop: 'name', label: '妯″叿鍚嶇О', isTrue: true, isSearch: true, searchInfoType: 'text', }, { - minWidth: '140', - prop: 'partName', - label: '宸ュ簭', + minWidth: '140px', + prop: 'createUser', + label: '璐d换浜�', isTrue: true, isSearch: true, searchInfoType: 'text', }, { - minWidth: '140', - prop: 'specs', - label: '宸ユ', + minWidth: '140px', + prop: 'status', + label: '妯″叿鐘舵��', isTrue: true, isSearch: true, searchInfoType: 'text', }, { - minWidth: '140', - prop: 'unit', - label: '瀵垮懡杞崲绯绘暟', + minWidth: '140px', + prop: 'createTime', + label: '鍒涘缓鏃堕棿', isTrue: true, isSearch: true, - searchInfoType: 'text', + searchInfoType: 'date', + formatter: this.formatDateTime }, ], - toolbar: [{ - text: '鏂板', - type: 'primary', - fun: this.addOrUpdateHandle - }], - operator: [{ - text: '鍒犻櫎', - type: 'text', - size: 'small', - fun: this.deleteHandle - }], + toolbar: [], + operator: null, operatorConfig: { fixed: 'right', label: '鎿嶄綔', width: 100, minWidth: 100 - }, + }, }, } }, - // computed: { - // ...mapGetters(['permissions']) - // }, + computed: { + ...mapGetters(['permissions']) + }, components: { ttable, - TableForm + }, + watch: { + dialogVisible(newVal){ + if(!newVal){ + this.editRow = { + code: null, + name: null, + } + } + } + }, + created(){ + if(this.permissions.equipment_mould_add){ + this.table.toolbar.push({ + text: '鏂板', + type: 'primary', + fun: this.addOrUpdateHandle + }) + } + if(this.permissions.equipment_mould_del){ + this.table.operator = [{ + text: '鍒犻櫎', + type: 'text', + fun: this.deleteHandle + }] + } + }, + mounted(){ + }, methods: { - addOrUpdateHandle() { - this.addOrUpdateVisible = true - console.log(this.addOrUpdateVisible,"--=--"); - }, + handleSelectionChange(val) { + this.multipleSelection = val + }, + deleteHandle(row){ + this.$confirm('鏄惁纭鍒犻櫎妯″叿鍚嶇О涓�' + row.name, '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + closeOnClickModal: false, + type: 'warning' + }) + .then(function() { + return delById(row.id) + }).then((data) => { + this.$message.success('鍒犻櫎鎴愬姛') + this.getData() + }) + }, + confirmSaveOrUpdateMould(){ + this.$refs.editForm.validate(valid=>{ + if(valid){ + if(this.editRow.id){ + updateMould(this.editRow).then(res=>{ + if(res.status===200){ + this.$message.success("淇敼鎴愬姛") + this.getData() + } + }).catch(error=>{ + console.error(error) + }) + }else{ + addMould(this.editRow).then(res=>{ + if(res.status===200){ + this.$message.success("鏂板鎴愬姛") + this.getData() + } + }).catch(error=>{ + console.error(error) + }) + } + this.dialogVisible = false + } + }) + }, + addOrUpdateHandle(row){ + if(row){ + this.editRow = row + } + this.dialogVisible = true + }, + formatDateTime(row, column, cellValue) { + return cellValue ? fecha.format(new Date(cellValue), 'yyyy-MM-dd HH:mm:ss') : '' + }, + getData() { + this.$refs.mouldTable.getDataList() + }, }, } -</script> \ No newline at end of file +</script> +<style scoped> +.mouldTable >>>.el-table__fixed-right .el-table__fixed-body-wrapper { + top: 74px !important; +} +</style> diff --git a/src/views/equipment/mouldrecord/index.vue b/src/views/equipment/mouldrecord/index.vue index 2a03676..cc335db 100644 --- a/src/views/equipment/mouldrecord/index.vue +++ b/src/views/equipment/mouldrecord/index.vue @@ -6,7 +6,7 @@ :isShowHide="true" :ajaxFun="ajaxFun" :prelang="prelang" - :options="options" + :options="options" ref="processconfiguration" > <template #toolbar> @@ -19,8 +19,9 @@ <script> import ttable from '@/views/common/ztt-table.vue' -import { fetchList, } from '@/api/quality/finishedDelivery' - +import * as fecha from 'element-ui/lib/utils/date' +import { fetchList, } from '@/api/equipment/mouldRecord' +import { mapGetters } from 'vuex' export default { data(){ return { @@ -51,45 +52,13 @@ { minWidth: '140', prop: 'packageNo', - label: '璁惧', + label: '鎶ュ伐鍗曞彿', isTrue: true, isSearch: true, searchInfoType: 'text', },{ minWidth: '140', prop: 'outBatchNo', - label: '妯″叿缂栧彿', - isTrue: true, - isSearch: true, - searchInfoType: 'text', - }, - { - minWidth: '140', - prop: 'partNo', - label: '妯″叿鍚嶇О', - isTrue: true, - isSearch: true, - searchInfoType: 'text', - }, - { - minWidth: '140', - prop: 'partName', - label: '宸ュ簭', - isTrue: true, - isSearch: true, - searchInfoType: 'text', - }, - { - minWidth: '140', - prop: 'specs', - label: '宸ユ', - isTrue: true, - isSearch: true, - searchInfoType: 'text', - }, - { - minWidth: '140', - prop: 'unit', label: '鎵瑰彿', isTrue: true, isSearch: true, @@ -97,55 +66,39 @@ }, { minWidth: '140', - prop: 'number', - label: '浜ч噺', + prop: 'partNo', + label: '宸ュ崟缂栧彿', isTrue: true, isSearch: true, searchInfoType: 'text', }, { minWidth: '140', - prop: 'number', - label: '瀵垮懡杞崲绯绘暟', + prop: 'partName', + label: '宸ヤ綔绔欏悕绉�', isTrue: true, isSearch: true, searchInfoType: 'text', }, { minWidth: '140', - prop: 'number', - label: '浣跨敤閲�', + prop: 'specs', + label: '浣跨敤浜虹紪鍙�', isTrue: true, isSearch: true, searchInfoType: 'text', }, - { - minWidth: '140', - prop: 'number', - label: '鎶ュ伐鍗曞彿', - isTrue: true, - isSearch: true, - searchInfoType: 'text', - }, - { - minWidth: '130', - prop: 'createUser', - label: '鐘舵��', - sort: true, - isTrue: true, - isSearch: true, - searchInfoType: 'text', - }, + ], toolbar: [], - // operator: [], - // operatorConfig: {} + operator: null, + operatorConfig: {} }, } }, - // computed: { - // ...mapGetters(['permissions']) - // }, + computed: { + ...mapGetters(['permissions']) + }, components: { ttable }, @@ -155,4 +108,4 @@ }, }, } -</script> \ No newline at end of file +</script> diff --git a/src/views/quality/Packaging_ledger/index.vue b/src/views/quality/Packaging_ledger/index.vue index 26b7977..0804a04 100644 --- a/src/views/quality/Packaging_ledger/index.vue +++ b/src/views/quality/Packaging_ledger/index.vue @@ -395,7 +395,7 @@ }, methods: { //鍖呰璇︽儏 - + //鎵撳嵃鎸夐挳 printFun() { this.diaPrintTab = false; diff --git a/src/views/quality/rawMaterial/rawMaterial-form.vue b/src/views/quality/rawMaterial/rawMaterial-form.vue index 53a8f6a..6c08e7a 100644 --- a/src/views/quality/rawMaterial/rawMaterial-form.vue +++ b/src/views/quality/rawMaterial/rawMaterial-form.vue @@ -3,7 +3,7 @@ <div class="page-header"> <div class="header-left"> <a @click="$router.go(-1)"><i class="icon-btn-back"></i></a> - <h2 v-if="resultVal!=null && dataForm.id!=null">鏌ョ湅-鍘熸潗鏂欐楠�</h2> + <h2 v-if="(resultVal!=null || resultVal!='') && dataForm.id!=null">鏌ョ湅-鍘熸潗鏂欐楠�</h2> <h2 v-else>缂栬緫-鍘熸潗鏂欐楠�</h2> </div> <div class="btn-group header-right"> @@ -32,12 +32,12 @@ <el-button slot="append" icon="el-icon-search" - :disabled="resultVal!=null" + :disabled="(resultVal!=null || resultVal!='')" @click="queryCode"></el-button> <el-button slot="append" icon="el-icon-full-screen" - :disabled="resultVal!=null" + :disabled="(resultVal!=null || resultVal!='')" @click="Turnonthecamera"></el-button> </el-input> </el-form-item> @@ -86,7 +86,7 @@ </el-col> <el-col :span="6"> <el-form-item label="鏁伴噺" prop="number"> - <el-input v-model="dataForm.number" :disabled="resultVal!=null" /> + <el-input v-model="dataForm.number" :disabled="(resultVal!=null || resultVal!='')" /> </el-form-item> </el-col> </el-row> @@ -173,9 +173,9 @@ <template slot-scope="scope"> <div v-if="!scope.row.children"> <el-tooltip :disabled="scope.row.deviceId != null" class="item" effect="dark" content="璇峰厛閫夋嫨璁惧锛�" placement="top-start"> - <!-- <el-autocomplete clearable - :disabled="scope.row.deviceId == null || (dataForm.id!=null&&resultVal!=null)" - @blur="changeState(scope.row,scope.$index)" + <el-autocomplete clearable + :disabled="scope.row.deviceId == null || (dataForm.id!=null&&(resultVal!=null || resultVal!=''))" + @input="changeState(scope.row,scope.$index)" v-model="scope.row.testValueList[index]" :fetch-suggestions="querySearch" placeholder="璇疯緭鍏ユ垨閫夋嫨妫�娴嬪��" > @@ -183,10 +183,10 @@ <template slot-scope="{ item }"> <div>{{ item.value }}</div> </template> - </el-autocomplete> --> + </el-autocomplete> - <el-select style="width:100%" filterable - :disabled="scope.row.deviceId == null || (dataForm.id!=null&&resultVal!=null)" + <!-- <el-select style="width:100%" filterable + :disabled="scope.row.deviceId == null || (dataForm.id!=null&&(resultVal!=null || resultVal!=''))" v-model="scope.row.testValueList[index]" placeholder="璇疯緭鍏ユ垨閫夋嫨妫�娴嬪��" allow-create @@ -196,7 +196,7 @@ > <el-option label="鏄�" value="鏄�"/> <el-option label="鍚�" value="鍚�"/> - </el-select> + </el-select> --> </el-tooltip> </div> </template> @@ -204,7 +204,7 @@ <el-table-column prop="deviceName" label="璇曢獙璁惧" min-width="200"> <template slot-scope="scope"> <div v-if="!scope.row.children"> - <el-select ref="" :disabled="dataForm!=null && resultVal!=null" style="width:60%" + <el-select ref="" :disabled="dataForm!=null && (resultVal!=null || resultVal!='')" style="width:60%" v-model="scope.row.deviceId" filterable @change="updateDevice(scope.row,scope.$index)"> <el-option v-for="(item,index) in deviceList" :key="index" :value="item.id" :label="item.code +'-'+ item.name"></el-option> @@ -213,7 +213,7 @@ size="small" slot="append" icon="el-icon-full-screen" - :disabled="dataForm!=null && resultVal!=null" + :disabled="dataForm!=null && (resultVal!=null || resultVal!='')" @click="codeDevice(scope.row,scope.$index)"></el-button> </div> </template> @@ -221,7 +221,7 @@ <el-table-column prop="note" label="妫�楠屾弿杩�" width="160" > <template slot-scope="scope"> <div v-if="!scope.row.children"> - <el-input @blur="changeState(scope.row, scope.$index)" :disabled="scope.row.deviceId == null || (dataForm.id!=null&&resultVal!=null)" v-model="scope.row.note" placeholder="妫�楠屾弿杩�"></el-input> + <el-input @blur="changeState(scope.row, scope.$index)" :disabled="scope.row.deviceId == null || (dataForm.id!=null&&(resultVal!=null || resultVal!=''))" v-model="scope.row.note" placeholder="妫�楠屾弿杩�"></el-input> </div> </template> </el-table-column> @@ -256,7 +256,7 @@ element-loading-text="璇风◢绛夛紝鏂囦欢涓婁紶涓�" > <el-upload - :disabled="dataForm.rawInsNo==null || resultVal!=null" + :disabled="dataForm.rawInsNo==null || (resultVal!=null || resultVal!='')" drag ref="upload" action="/mes/rawInsProduct/upload" @@ -311,7 +311,7 @@ @click="delProcessConfigFile(scope.row)" type="text" size="small" - :disabled="resultVal!=null" + :disabled="(resultVal!=null || resultVal!='')" >鍒犻櫎</el-button > <el-button @@ -346,7 +346,7 @@ </el-table-column> <el-table-column label="鎿嶄綔"> <template> - <el-button type="text" :disabled="resultVal!=null && dataForm.id!=null" @click="showDialog()" size="small">涓婃姤</el-button> + <el-button type="text" :disabled="(resultVal!=null || resultVal!='') && dataForm.id!=null" @click="showDialog()" size="small">涓婃姤</el-button> </template> </el-table-column> </el-table> @@ -887,43 +887,41 @@ console.log(e.target.value); }, changeState(row, index) { - this.$nextTick(()=>{ - if(row){ - let isTrue = true - for(var i=0;i<row.testValueList.length;i++){ - let val = row.testValueList[i] - let reg = /(^-?[0-9]{1,6}$)|(^-?[0-9]{1,6}[\.]{1}[0-9]{1,3}$)/ - if(!reg.test(val) && !['鏄�','鍚�'].includes(val)){ - row.testValueList[i] = null - this.$message.error("璇疯緭鍏ユ暟瀛楁垨閫夋嫨鏄惁") - isTrue = false - } - } - if(!isTrue){ - return - } - } - if (row.rpId != null && row.rpId != '') { - let val = row.testValueList.join(",") - if (val === undefined || val === '' || val === null) { - return + if(row){ + let isTrue = true + for(var i=0;i<row.testValueList.length;i++){ + let val = row.testValueList[i] + let reg = /(^-?[0-9]{1,6}$)|(^-?[0-9]{1,6}[\.]{1}[0-9]{1,3}$)/ + if(!reg.test(val) && !['鏄�','鍚�'].includes(val)){ + row.testValueList[i] = null + this.$message.error("璇疯緭鍏�6浣嶆暟瀛楁垨閫夋嫨鏄惁") + isTrue = false + } } - let obj = { + if(!isTrue){ + return + } + } + if (row.rpId != null && row.rpId != '') { + let val = row.testValueList.join(",") + if (val === undefined || val === '' || val === null) { + return + } + let obj = { deviceId: row.deviceId, rpId: row.rpId, testValue: val, note: row.note - } - updateRawInsProduct(obj).then(res => { - if (res.data.code == 0) { - this.$message.success("鏇存柊鎴愬姛") - } else { - this.$message.error("鏇存柊澶辫触") - } - this.init(this.dataForm.id) - }) } - }) + updateRawInsProduct(obj).then(res => { + if (res.data.code == 0) { + this.$message.success("鏇存柊鎴愬姛") + } else { + this.$message.error("鏇存柊澶辫触") + } + this.init(this.dataForm.id) + }) + } }, // 鍒犻櫎瀛愰」鐩� delChildren(row,index,isParent) { -- Gitblit v1.9.3