添加修改按钮

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>
</template>
<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"
@click="lookProcessRoute(row)">查看工艺路线
</el-button> -->
</template>
</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>
<script>
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 {
components: {
// lookProcess
},
data() {
return {
editForm:{},
isEdit:false,
isOpen: false,
rowItem: {},
poId: null,
@ -118,7 +110,7 @@ export default {
viewBtn: false,
delBtn: false,
addBtn: false,
editBtn: true,
editBtn: false,
editBtnText: '修改',
labelWidth: 120,
// searchLabelWidth: 120,
@ -491,6 +483,18 @@ export default {
},
methods: {
editData(row){
this.isEdit = true
},
editData1(row){
updateData(row).then(res =>{
if(res.data.code == 200){
this.$message.success('修改成功')
this.onLoad()
done()
}
})
},
//
claseOrder() {
//
@ -509,9 +513,7 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
}) .then(() => {
const ids = this.selectionList.map(item => item.id).join(',');
closeBatchs({ ...{ ids } }).then(res => {
if (res.data.code === 200) {
@ -531,22 +533,17 @@ export default {
},
searchReset() {
this.query = {};
this.onLoad(this.page);
this.onLoad();
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
this.onLoad();
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
@ -554,65 +551,54 @@ export default {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
handleChange(file, fileList) {
// proxy.$Export.xlsx(file.raw).then((data) => {
// data.value = data.results;
// });
this.$message({
type: 'success',
message: '操作成功!',
});
this.onLoad();
},
async onLoad(page, params = {}) {
onLoad() {
this.loading = true;
this.query.partCode = this.query.partCode1
if(this.query.partCode1){
delete this.query.partCode1
}
try {
const res = await getList({
current:this.page.currentPage,
size:this.page.pageSize,
validationResult: '16002',
...this.query,
});
// if (res.data.code) {
getList({
current:this.page.currentPage,
size:this.page.pageSize,
validationResult: '16002',
...this.query,
}).then(res =>{
if (res.data.code) {
this.data = res.data.data.records;
this.page.total = res.data.data.total;
this.selectionClear();
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(
// () => {
// this.onLoad(this.page);
// this.$message({
// type: 'success',
// message: '!',
// });
// done();
// },
// error => {
// window.console.log(error);
// loading();
// }
// );
// try {
// const res = await getList({
// current:this.page.currentPage,
// size:this.page.pageSize,
// validationResult: '16002',
// ...this.query,
// });
// // if (res.data.code) {
// this.data = res.data.data.records;
// this.page.total = res.data.data.total;
// this.selectionClear();
// 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() {
// this.option.column = orderCol['exceptionOrder']

Loading…
Cancel
Save