From e82c2f2e26253bd111b29eed22d555ba5b95e4b7 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期五, 08 十二月 2023 17:44:45 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/plan/productionschedul/index.vue | 88 ++++++++++++++++++++++++++--- vue.config.js | 44 +++++++------- src/api/plan/productionschedul.js | 15 +++++ src/page/index/logo.vue | 1 4 files changed, 116 insertions(+), 32 deletions(-) diff --git a/src/api/plan/productionschedul.js b/src/api/plan/productionschedul.js index 5c56f9a..6ab0eeb 100644 --- a/src/api/plan/productionschedul.js +++ b/src/api/plan/productionschedul.js @@ -21,4 +21,19 @@ method: 'put', data: data }) +} + +export function deleteSchedul(mId) { + return request({ + url: '/mes/productionSchedul/'+mId, + method: 'delete', + }) +} + +export function updateSchedul(data) { + return request({ + url: '/mes/productionSchedul/updateByMId', + method: 'post', + data: data + }) } \ No newline at end of file diff --git a/src/page/index/logo.vue b/src/page/index/logo.vue index 8e02347..bb73091 100644 --- a/src/page/index/logo.vue +++ b/src/page/index/logo.vue @@ -71,7 +71,6 @@ }, created() { this.sysTitle = localStorage.getItem('SYSTEM_LOGO_TITLE') - console.log('userInfouserInfo', this.userInfo) // this.getLogoInfo() }, methods: { diff --git a/src/views/plan/productionschedul/index.vue b/src/views/plan/productionschedul/index.vue index 3a03c19..8aae322 100644 --- a/src/views/plan/productionschedul/index.vue +++ b/src/views/plan/productionschedul/index.vue @@ -10,6 +10,7 @@ @selection-change="selectionRow" :table-loading="loading"> <template #menu="{ row, index }"> + <el-button type="text" icon="el-icon-edit" size="small" @click="editHandle(row, index)">缂栬緫</el-button> <el-button type="text" icon="el-icon-delete" size="small" @click="deleteHandle(row, index)">鍒犻櫎</el-button> </template> </avue-crud> @@ -97,6 +98,31 @@ <el-button type="primary" @click="confirmEditSchedul">纭� 瀹�</el-button> </span> </el-dialog> + <el-dialog + title="缂栬緫" + :visible.sync="editDialogVisible" + width="50%"> + <el-form :model="editForm" label-width="120px"> + <el-row> + <el-col :span="24"> + <el-form-item label="鐢熶骇鎯呭喌:"> + <el-input style="width:100%" placeholder="璇疯緭鍏ョ敓浜ф儏鍐�" type="textarea" :row="2" v-model="editForm.productionStatus"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="24"> + <el-form-item label="鐢熶骇绋嬪害:"> + <el-input style="width:100%" placeholder="璇疯緭鍏ョ敓浜х▼搴�" type="textarea" :row="2" v-model="editForm.productionRoutine"></el-input> + </el-form-item> + </el-col> + </el-row> + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button @click="editDialogVisible = false">鍙� 娑�</el-button> + <el-button type="primary" @click="confirmEdit()">纭� 瀹�</el-button> + </span> + </el-dialog> </div> </template> @@ -104,7 +130,9 @@ import { fetchScheduleList, fetchScheduleById, - fillTime + fillTime, + deleteSchedul, + updateSchedul } from '@/api//plan/productionschedul' import TableForm from './template-form' import ttable from '@/views/common/ztt-table.vue' @@ -112,6 +140,12 @@ export default { data() { return { + editForm:{ + id: null, + productionRoutine: null, + productionStatus: null, + }, + editDialogVisible: false, dialogVisible: false, scheduleList: [], scheduleEditList: [], @@ -129,10 +163,12 @@ selection: true, columnBtn: false, index: true, - rowKey: 'product', + indexFixed: false, + selectionFixed: false, + rowKey: 'mid', indexLabel: '搴忓彿', menuAlign: 'center', - menuWidth: 100, + menuWidth: 130, editBtn: false, delBtn: false, addBtn: false, @@ -272,7 +308,15 @@ this.rowCalc() }, watch:{ - + editDialogVisible(newVal){ + if(!newVal){ + this.editForm = { + id: null, + productionRoutine: null, + productionStatus: null, + } + } + } }, mounted() { @@ -280,6 +324,26 @@ beforeDestroy() { }, methods: { + confirmEdit(){ + const _than = this + updateSchedul(this.editForm).then(res=>{ + if(res.status===200){ + _than.$message.success("鏇存柊鎴愬姛") + _than.editDialogVisible = false + _than.getData() + } + }).catch(error=>{ + console.error(error); + }) + }, + editHandle(row,index){ + if(row){ + this.editForm.id = row.mid + this.editForm.productionRoutine = row.productionRoutine + this.editForm.productionStatus = row.productionStatus + this.editDialogVisible = true + } + }, openEditDialog(){ this.scheduleEditList = JSON.parse(JSON.stringify(this.scheduleList)) this.dialogVisible = true @@ -287,8 +351,6 @@ confirmEditSchedul(){ let data = this.scheduleEditList let orderObj = this.multipleSelection[0] - console.log("data---",data) - console.log("orderObj-----",orderObj) let obj = { "documentActualTime": data[0].actualTime, "documentPlanTime": data[0].planTime, @@ -310,7 +372,6 @@ "productType": orderObj.productType, "projectName": orderObj.projectName } - console.log("obj----->>>",obj); fillTime(obj).then(res=>{ if(res.status===200){ this.$message.success("鏇存柊鎴愬姛") @@ -375,6 +436,7 @@ } }, selectionRow(val){ + console.log(val); if (val.length > 1) { const preVal = val.shift(); this.$refs.crud.toggleRowSelection(preVal, false); @@ -414,12 +476,20 @@ }, // 鍒犻櫎 deleteHandle(row,index) { - this.$confirm('鏄惁纭鍒犻櫎', '鎻愮ず', { + const _than = this + _than.$confirm('鏄惁纭鍒犻櫎', '鎻愮ず', { confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning' }).then(function() { - + deleteSchedul(row.mid).then(res=>{ + if(res.status===200){ + _than.$message.success("鍒犻櫎鎴愬姛") + _than.getData() + } + }).catch(error=>{ + console.error(error) + }) }) }, //鍔ㄦ�佸悎骞舵柟娉� diff --git a/vue.config.js b/vue.config.js index abb5a5a..91da851 100644 --- a/vue.config.js +++ b/vue.config.js @@ -2,11 +2,11 @@ * 閰嶇疆鍙傝��: * https://cli.vuejs.org/zh/config/ */ -//const url = 'http://192.168.2.7:9999' +const url = 'http://192.168.2.7:9999' //const url = 'http://192.168.32.45:9999' // const url = 'http://192.168.0.23:9999' -const url = 'http://localhost:9999' +// const url = 'http://localhost:9999' const localUrl = 'http://localhost:8089' @@ -29,26 +29,26 @@ }, // eslint-disable-next-line configureWebpack: (config) => { - // if (process.env.NODE_ENV === 'production') { - // // 浠呭湪鐢熶骇鐜涓嬪惎鐢ㄨ閰嶇疆 - // return { - // plugins: [ - // /*new MonacoWebpackPlugin({ - // languages: ['javascript', 'css', 'html', 'json'] - // }),*/ - // new CompressionWebpackPlugin({ - // filename: '[path].gz[query]', - // algorithm: 'gzip', - // test: new RegExp( - // '\\.(' + productionGzipExtensions.join('|') + ')$' - // ), - // threshold: 1024, // 鍙湁澶у皬澶т簬璇ュ�肩殑璧勬簮浼氳澶勭悊,褰撳墠閰嶇疆涓哄浜庤秴杩�1k鐨勬暟鎹繘琛屽鐞嗭紝涓嶈冻1k鐨勫彲鑳戒細瓒婂帇缂╄秺澶� - // minRatio: 0.99, // 鍙湁鍘嬬缉鐜囧皬浜庤繖涓�肩殑璧勬簮鎵嶄細琚鐞� - // deleteOriginalAssets: true // 鍒犻櫎鍘熸枃浠� - // }) - // ] - // } - // } + if (process.env.NODE_ENV === 'production') { + // 浠呭湪鐢熶骇鐜涓嬪惎鐢ㄨ閰嶇疆 + return { + plugins: [ + /*new MonacoWebpackPlugin({ + languages: ['javascript', 'css', 'html', 'json'] + }),*/ + new CompressionWebpackPlugin({ + filename: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + productionGzipExtensions.join('|') + ')$' + ), + threshold: 1024, // 鍙湁澶у皬澶т簬璇ュ�肩殑璧勬簮浼氳澶勭悊,褰撳墠閰嶇疆涓哄浜庤秴杩�1k鐨勬暟鎹繘琛屽鐞嗭紝涓嶈冻1k鐨勫彲鑳戒細瓒婂帇缂╄秺澶� + minRatio: 0.99, // 鍙湁鍘嬬缉鐜囧皬浜庤繖涓�肩殑璧勬簮鎵嶄細琚鐞� + deleteOriginalAssets: true // 鍒犻櫎鍘熸枃浠� + }) + ] + } + } }, // 閰嶇疆杞彂浠g悊 devServer: { -- Gitblit v1.9.3