This commit is contained in:
caoqianming 2025-09-24 14:14:27 +08:00
commit d445981929
5 changed files with 62 additions and 139 deletions

View File

@ -60,6 +60,14 @@ export default {
return await http.post(this.url, data); return await http.post(this.url, data);
} }
}, },
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/ofm/mroom/${id}/`,data
);
}
},
delete: { delete: {
url: `${config.API_URL}/ofm/mroom/delete/`, url: `${config.API_URL}/ofm/mroom/delete/`,
name: "批量物理删除", name: "批量物理删除",

View File

@ -93,55 +93,37 @@
type="primary" type="primary"
:loading="isSaving" :loading="isSaving"
@click="submitHandle()" @click="submitHandle()"
> </el-button > </el-button>
>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
// import degraDialog from "../wf/degraD3.vue";
export default { export default {
name: "index", name: "mroom",
// components: {
// degraDialog
// },
data() { data() {
return { return {
workflowName:"", apiObj: this.$API.ofm.mroom.list,
workFlowId:'',
apiObj: this.$API.wf.workflow.list,
selection: [],
checkList: [],
fileList: [],
timeRange: [],
lending_type: "",
query: {}, query: {},
editId: null, editId: null,
isSaving: false, isSaving: false,
limitedVisible: false, limitedVisible: false,
limitedWatch: false,
type: "add", type: "add",
titleMap: { titleMap: {
add: "新增", add: "新增",
edit: "编辑", edit: "编辑",
show: "查看", show: "查看",
}, },
//
addForm: { addForm: {
seal: [], name: "",
seal_other: "", location: "",
filename: "", capacity: "",
contents: "", },
file_count: "", rules: {
is_lending: "", name: [{ required: true, message: "请输入会议室名称", trigger: "blur" }],
contacts: "", location: [{ required: true, message: "请输入地点", trigger: "blur" }],
lending_date: "", capacity: [{ required: true, message: "请输入容纳人数", trigger: "blur" }],
return_date: "",
actual_return_date: "",
reason: "",
}, },
//
}; };
}, },
methods: { methods: {
@ -151,15 +133,12 @@ export default {
this.limitedVisible = true; this.limitedVisible = true;
}, },
handleCancel() { handleCancel() {
this.limitedVisible = false; // this.limitedVisible = false;
this.lending_type = ""; // lending_type
//
// this.addForm = { lending_type: "", ...... };
}, },
submitHandle() { submitHandle() {
let that = this; let that = this;
this.$refs.addForm.validate((valid) => { that.$refs.addForm.validate((valid) => {
if (valid) { if (valid) {
that.isSaving = true; that.isSaving = true;
that.submit(); that.submit();
@ -168,16 +147,14 @@ export default {
}, },
async submit() { async submit() {
let that = this; let that = this,res = null;
let res = null; console.log('that.type',that.type);
console.log('that.addForm',that.addForm);
try { try {
if (that.type === "add") { if (that.type === "add") {
res = await that.$API.ofm.mroom.create.req(that.addForm); res = await that.$API.ofm.mroom.create.req(that.addForm);
} else { } else {
res = await that.$API.ofm.mroom.update.req( res = await that.$API.ofm.mroom.update.req(that.addForm.id,that.addForm);
that.editId,
that.addForm
);
} }
that.isSaving = false; that.isSaving = false;
that.limitedVisible = false; that.limitedVisible = false;
@ -186,77 +163,32 @@ export default {
that.isSaving = false; that.isSaving = false;
} }
}, },
fileUPSuccess(res) {
let that = this;
console.log('res',res);
this.test_file = res.path;
},
mroomEidt(row) { mroomEidt(row) {
this.type = "edit"; let that = this;
this.editId = row.id; that.type = "edit";
this.limitedVisible = true; that.editId = row.id;
this.addForm = Object.assign({}, row); that.limitedVisible = true;
} that.addForm = Object.assign({}, row);
}, },
async mroomDel(row) { async mroomDel(row) {
let that = this;
var id = row.id; var id = row.id;
var res = await this.$API.ofm.mroom.delete.req(id); var res = await that.$API.ofm.mroom.delete.req(id);
if (res.err_msg) { if (res.err_msg) {
this.$message.error(res.err_msg); that.$message.error(res.err_msg);
} else { } else {
this.$refs.table.refresh(); that.$refs.table.refresh();
this.$message.success("删除成功"); that.$message.success("删除成功");
} }
}, },
// //
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query); this.$refs.table.queryData(this.query);
}, },
}; },
}
</script> </script>
<style scoped> <style scoped>
.treeMain {
height: 280px;
overflow: auto;
border: 1px solid #dcdfe6;
margin-bottom: 10px;
}
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.2);
background-color: #fefefe;
border-radius: 5px;
}
::-webkit-scrollbar-thumb {
border-radius: 5px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
background-color: #f5f5f5;
}
.node rect {
stroke: #606266;
fill: #fff;
}
.edgePath path {
stroke: #606266;
fill: #333;
stroke-width: 1.5px;
}
g.conditions > rect {
fill: #00ffd0;
stroke: #000;
}
.el-icon-close {
cursor: pointer;
}
.left-panel-group { .left-panel-group {
display: flex; display: flex;

View File

@ -189,12 +189,8 @@ export default {
querys:[[{field:"data__has_key",compare:"",value:"毛坯检测_日期"}]], querys:[[{field:"data__has_key",compare:"",value:"毛坯检测_日期"}]],
}, },
query:{ query:{
name__contains:'', batch__contains:''
batch__contains:'',
last_time__gte:'',
last_time__lte:'',
}, },
// apiObj: this.$API.wpm.wpr.query,
apiObj: this.$API.wpm.batchstquery, apiObj: this.$API.wpm.batchstquery,
options:[], options:[],
tableData:[], tableData:[],
@ -203,43 +199,17 @@ export default {
methods: { methods: {
handleQuery(){ handleQuery(){
let that = this; let that = this;
let querys = [[{field:"wm",value:0,compare:"isnull"},{field:"data__has_key",compare:"",value:"毛坯检测_批次号"}]]; let querys = [[{field:"data__has_key",compare:"",value:"毛坯检测_日期"}]];
let obj = {},obj1 = {},obj2 = {},obj3 = {}; let obj = {};
obj.field = 'data__毛坯检测_批次号'; obj.field = 'batch';
obj.value = that.query.batch__contains; obj.value = that.query.batch__contains;
obj.compare = ''; obj.compare = '';
obj1.field = 'last_time';
obj1.value = that.query.last_time__gte;
obj1.compare = 'gte';
obj2.field = 'last_time';
obj2.value = that.query.last_time__lte;
obj2.compare = 'lte';
obj3.field = 'data__毛坯检测_物料名';
obj3.value = that.query.name__contains;
obj3.compare = '';
if(that.query.batch__contains!==''&&that.query.batch__contains!==null){ if(that.query.batch__contains!==''&&that.query.batch__contains!==null){
querys[0].push(obj); querys[0].push(obj);
} }
if(that.query.last_time__gte!==''&&that.query.last_time__gte!==null){
querys[0].push(obj1);
}
if(that.query.last_time__lte!==''&&that.query.last_time__lte!==null){
querys[0].push(obj2);
}
if(that.query.name__contains!==''&&that.query.name__contains!==null){
querys[0].push(obj3);
}
that.params.querys = querys; that.params.querys = querys;
this.$refs.table.queryData(that.params); this.$refs.table.queryData(that.params);
}, },
getCountQt(data,type){
let count_qt = 0,count = 0;
}
}, },
}; };
</script> </script>

View File

@ -1,6 +1,6 @@
<template> <template>
<el-dialog <el-dialog
:title="titleMap[mode]" :title="titleMap[mode+type]"
v-model="visible" v-model="visible"
width="1000px" width="1000px"
:size="1000" :size="1000"
@ -191,7 +191,7 @@
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="更改批次"> <el-form-item label="更改批次">
<el-switch v-model="change_batch"></el-switch> <el-switch v-model="change_batch" :disabled="type==50"></el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="type==50"> <el-col :md="12" :sm="24" v-if="type==50">
@ -255,8 +255,14 @@ export default {
loading: false, loading: false,
mode: "add", mode: "add",
titleMap: { titleMap: {
add: "新增交接记录", add10: "新增交接记录",
edit: "编辑交接记录", add20: "新增返工记录",
add40: "新增废品入库",
add50: "新增改版记录",
edit10: "编辑交接记录",
edit20: "编辑返工记录",
edit40: "编辑废品入库",
edit50: "编辑改版记录",
show: "查看交接记录", show: "查看交接记录",
}, },
lists:[],// lists:[],//
@ -354,6 +360,9 @@ export default {
mounted() { mounted() {
let that = this; let that = this;
that.form.type = that.type; that.form.type = that.type;
if(that.type==50){
that.change_batch = true;
}
let materialObj = that.$TOOL.data.get("MATERIAL_OBJECT"); let materialObj = that.$TOOL.data.get("MATERIAL_OBJECT");
that.materialObj = materialObj; that.materialObj = materialObj;
that.form.handle_date =that.form.send_date =this.$TOOL.dateFormat2(new Date()); that.form.handle_date =that.form.send_date =this.$TOOL.dateFormat2(new Date());
@ -384,8 +393,6 @@ export default {
} }
}else if(that.type==40){// }else if(that.type==40){//
that.getMaterialNotok(); that.getMaterialNotok();
}else if(that.type==60){
} }
that.getMgroupOptions(); that.getMgroupOptions();
}, },
@ -589,6 +596,7 @@ export default {
data = that.materialOptions.filter((item) => { data = that.materialOptions.filter((item) => {
return that.selectItems.indexOf(item.id)>-1; return that.selectItems.indexOf(item.id)>-1;
}); });
that.form.new_batch = data[0].batch+'g';
let materialId = data[0].material; let materialId = data[0].material;
if(that.type==50){}else{ if(that.type==50){}else{
let params = { let params = {
@ -765,6 +773,7 @@ export default {
let hasArr = []; let hasArr = [];
that.materialOptions.forEach((item) => { that.materialOptions.forEach((item) => {
if(item.batch == res.batch){ if(item.batch == res.batch){
that.form.new_batch = res.batch+'g';
hasArr.push(item); hasArr.push(item);
let params = {material: item.material,type: that.type}; let params = {material: item.material,type: that.type};
that.$API.wpm.handover.mgroups.req(params).then((res0) => { that.$API.wpm.handover.mgroups.req(params).then((res0) => {
@ -818,6 +827,7 @@ export default {
if(arr2.length>0){ if(arr2.length>0){
that.$message.error("该批次已存在") that.$message.error("该批次已存在")
}else{ }else{
that.form.new_batch = arr[0].batch+'g';
let params = {material: arr[0].material,type: that.type}; let params = {material: arr[0].material,type: that.type};
that.$API.wpm.handover.mgroups.req(params).then((res0) => { that.$API.wpm.handover.mgroups.req(params).then((res0) => {
that.mgroupOptions = res0; that.mgroupOptions = res0;
@ -872,6 +882,7 @@ export default {
}else{//handoverb }else{//handoverb
that.materialOptions.forEach((item) => { that.materialOptions.forEach((item) => {
if(item.id == res[0].wm){ if(item.id == res[0].wm){
that.form.new_batch = item.batch+'g';
let params = {material: item.material,type: that.type}; let params = {material: item.material,type: that.type};
that.$API.wpm.handover.mgroups.req(params).then((res1) => { that.$API.wpm.handover.mgroups.req(params).then((res1) => {
that.mgroupOptions = res1; that.mgroupOptions = res1;

View File

@ -557,6 +557,8 @@ export default {
}, },
mounted() { mounted() {
let that = this; let that = this;
this.paramsIn.mlog = "";
this.paramsOut.mlog = "";
this.route_code = this.$route.path.split("/")[2]; this.route_code = this.$route.path.split("/")[2];
this.paramsIn.mlog = this.mlogId; this.paramsIn.mlog = this.mlogId;
this.paramsOut.mlog = this.mlogId; this.paramsOut.mlog = this.mlogId;