添加修改按钮

dev-scheduling
jinna 3 weeks ago
parent 85597fd604
commit 87f4026966
  1. 138
      src/views/orderManagement/components/exception/dataMissing.vue

@ -46,37 +46,29 @@
}}</el-tag> }}</el-tag>
</template> </template>
<template #menu="{ row }"> <template #menu="{ row }">
<el-button text @click="editData(row)">修改</el-button>
<el-button text @click="editData1(row)">修改1</el-button>
<!-- <el-button type="primary" text plain style="border: 0; background-color: transparent !important" <!-- <el-button type="primary" text plain style="border: 0; background-color: transparent !important"
@click="lookProcessRoute(row)">查看工艺路线 @click="lookProcessRoute(row)">查看工艺路线
</el-button> --> </el-button> -->
</template> </template>
</avue-crud> </avue-crud>
<!-- <el-dialog v-model="isEdit" width="60%" title="修改">
<el-form :model="editForm">
<el-form-item label="计划单号">
<el-input></el-input>
</el-form-item>
</el-form>
</el-dialog> -->
</template> </template>
<script> <script>
import { getList, closeBatchs,updateData } from '@/api/orderManagement/exceptionOrder'; import { getList, closeBatchs,updateData } from '@/api/orderManagement/exceptionOrder';
// import {
// add,
// getRole,
// getRoleAlias,
// getRoleTreeById,
// grant,
// grantTree,
// remove,
// update,
// } from '@/api/system/role';
import { mapGetters } from 'vuex';
import website from '@/config/website';
import { validatenull } from '@/utils/validate';
// import { getList } from '@/api/base/region';
import { templateDic } from '@/const/tool/model';
// import orderCol from './orderCol.js'
export default { export default {
components: {
// lookProcess
},
data() { data() {
return { return {
editForm:{},
isEdit:false,
isOpen: false, isOpen: false,
rowItem: {}, rowItem: {},
poId: null, poId: null,
@ -118,7 +110,7 @@ export default {
viewBtn: false, viewBtn: false,
delBtn: false, delBtn: false,
addBtn: false, addBtn: false,
editBtn: true, editBtn: false,
editBtnText: '修改', editBtnText: '修改',
labelWidth: 120, labelWidth: 120,
// searchLabelWidth: 120, // searchLabelWidth: 120,
@ -491,6 +483,18 @@ export default {
}, },
methods: { methods: {
editData(row){
this.isEdit = true
},
editData1(row){
updateData(row).then(res =>{
if(res.data.code == 200){
this.$message.success('修改成功')
this.onLoad()
done()
}
})
},
// //
claseOrder() { claseOrder() {
// //
@ -509,9 +513,7 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) }) .then(() => {
.then(() => {
const ids = this.selectionList.map(item => item.id).join(','); const ids = this.selectionList.map(item => item.id).join(',');
closeBatchs({ ...{ ids } }).then(res => { closeBatchs({ ...{ ids } }).then(res => {
if (res.data.code === 200) { if (res.data.code === 200) {
@ -531,22 +533,17 @@ export default {
}, },
searchReset() { searchReset() {
this.query = {}; this.query = {};
this.onLoad(this.page); this.onLoad();
}, },
searchChange(params, done) { searchChange(params, done) {
this.query = params; this.query = params;
this.page.currentPage = 1; this.page.currentPage = 1;
this.onLoad(this.page, params); this.onLoad();
done(); done();
}, },
selectionChange(list) { selectionChange(list) {
this.selectionList = list; this.selectionList = list;
}, },
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage) { currentChange(currentPage) {
this.page.currentPage = currentPage; this.page.currentPage = currentPage;
}, },
@ -554,65 +551,54 @@ export default {
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
refreshChange() { refreshChange() {
this.onLoad(this.page, this.query); this.onLoad();
},
handleChange(file, fileList) {
// proxy.$Export.xlsx(file.raw).then((data) => {
// data.value = data.results;
// });
this.$message({
type: 'success',
message: '操作成功!',
});
}, },
async onLoad(page, params = {}) { onLoad() {
this.loading = true; this.loading = true;
this.query.partCode = this.query.partCode1 this.query.partCode = this.query.partCode1
if(this.query.partCode1){ if(this.query.partCode1){
delete this.query.partCode1 delete this.query.partCode1
} }
try { getList({
const res = await getList({ current:this.page.currentPage,
current:this.page.currentPage, size:this.page.pageSize,
size:this.page.pageSize, validationResult: '16002',
validationResult: '16002', ...this.query,
...this.query, }).then(res =>{
}); if (res.data.code) {
// if (res.data.code) {
this.data = res.data.data.records; this.data = res.data.data.records;
this.page.total = res.data.data.total; this.page.total = res.data.data.total;
this.selectionClear();
this.loading = false; this.loading = false;
// }
} catch (err) {
console.log(err);
}
},
rowUpdate( row, index, done, loading) {
updateData(row).then(res =>{
if(res.data.code == 200){
this.$message.success('修改成功')
this.onLoad()
done()
} }
}) })
// edit(row).then( // try {
// () => { // const res = await getList({
// this.onLoad(this.page); // current:this.page.currentPage,
// this.$message({ // size:this.page.pageSize,
// type: 'success', // validationResult: '16002',
// message: '!', // ...this.query,
// }); // });
// done(); // // if (res.data.code) {
// }, // this.data = res.data.data.records;
// error => { // this.page.total = res.data.data.total;
// window.console.log(error); // this.selectionClear();
// loading(); // this.loading = false;
// } // // }
// ); // } catch (err) {
// console.log(err);
// }
}, },
// rowUpdate( row, index, done, loading) {
// updateData(row).then(res =>{
// if(res.data.code == 200){
// this.$message.success('')
// this.onLoad()
// done()
// }
// })
// },
}, },
mounted() { mounted() {
// this.option.column = orderCol['exceptionOrder'] // this.option.column = orderCol['exceptionOrder']

Loading…
Cancel
Save