From 0bbc9152a6c00898593df13a57d26523b2210148 Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期五, 08 十二月 2023 17:40:26 +0800 Subject: [PATCH] modified: src/api/plan/productionschedul.js modified: src/views/plan/productionschedul/index.vue modified: vue.config.js --- src/views/plan/productionschedul/index.vue | 88 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 79 insertions(+), 9 deletions(-) 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) + }) }) }, //鍔ㄦ�佸悎骞舵柟娉� -- Gitblit v1.9.3