Merge branch 'master' of http://gitea.xxhhcty.xyz:8080/zcdsj/factory_web
This commit is contained in:
commit
d445981929
|
@ -60,6 +60,14 @@ export default {
|
|||
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: {
|
||||
url: `${config.API_URL}/ofm/mroom/delete/`,
|
||||
name: "批量物理删除",
|
||||
|
|
|
@ -93,55 +93,37 @@
|
|||
type="primary"
|
||||
:loading="isSaving"
|
||||
@click="submitHandle()"
|
||||
>保 存</el-button
|
||||
>
|
||||
>保 存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import degraDialog from "../wf/degraD3.vue";
|
||||
export default {
|
||||
name: "index",
|
||||
// components: {
|
||||
// degraDialog
|
||||
// },
|
||||
name: "mroom",
|
||||
data() {
|
||||
return {
|
||||
workflowName:"",
|
||||
workFlowId:'',
|
||||
apiObj: this.$API.wf.workflow.list,
|
||||
selection: [],
|
||||
checkList: [],
|
||||
fileList: [],
|
||||
timeRange: [],
|
||||
lending_type: "",
|
||||
apiObj: this.$API.ofm.mroom.list,
|
||||
query: {},
|
||||
editId: null,
|
||||
isSaving: false,
|
||||
limitedVisible: false,
|
||||
limitedWatch: false,
|
||||
type: "add",
|
||||
titleMap: {
|
||||
add: "新增",
|
||||
edit: "编辑",
|
||||
show: "查看",
|
||||
},
|
||||
//表单数据
|
||||
addForm: {
|
||||
seal: [],
|
||||
seal_other: "",
|
||||
filename: "",
|
||||
contents: "",
|
||||
file_count: "",
|
||||
is_lending: "",
|
||||
contacts: "",
|
||||
lending_date: "",
|
||||
return_date: "",
|
||||
actual_return_date: "",
|
||||
reason: "",
|
||||
name: "",
|
||||
location: "",
|
||||
capacity: "",
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入会议室名称", trigger: "blur" }],
|
||||
location: [{ required: true, message: "请输入地点", trigger: "blur" }],
|
||||
capacity: [{ required: true, message: "请输入容纳人数", trigger: "blur" }],
|
||||
},
|
||||
//验证规则
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -151,15 +133,12 @@ export default {
|
|||
this.limitedVisible = true;
|
||||
},
|
||||
handleCancel() {
|
||||
this.limitedVisible = false; // 关闭弹窗
|
||||
this.lending_type = ""; // 重置 lending_type
|
||||
// 如果需要,也可以重置整个表单:
|
||||
// this.addForm = { lending_type: "", ...其他字段... };
|
||||
},
|
||||
this.limitedVisible = false;
|
||||
},
|
||||
|
||||
submitHandle() {
|
||||
let that = this;
|
||||
this.$refs.addForm.validate((valid) => {
|
||||
that.$refs.addForm.validate((valid) => {
|
||||
if (valid) {
|
||||
that.isSaving = true;
|
||||
that.submit();
|
||||
|
@ -168,16 +147,14 @@ export default {
|
|||
},
|
||||
|
||||
async submit() {
|
||||
let that = this;
|
||||
let res = null;
|
||||
let that = this,res = null;
|
||||
console.log('that.type',that.type);
|
||||
console.log('that.addForm',that.addForm);
|
||||
try {
|
||||
if (that.type === "add") {
|
||||
res = await that.$API.ofm.mroom.create.req(that.addForm);
|
||||
} else {
|
||||
res = await that.$API.ofm.mroom.update.req(
|
||||
that.editId,
|
||||
that.addForm
|
||||
);
|
||||
res = await that.$API.ofm.mroom.update.req(that.addForm.id,that.addForm);
|
||||
}
|
||||
that.isSaving = false;
|
||||
that.limitedVisible = false;
|
||||
|
@ -186,77 +163,32 @@ export default {
|
|||
that.isSaving = false;
|
||||
}
|
||||
},
|
||||
fileUPSuccess(res) {
|
||||
let that = this;
|
||||
console.log('res',res);
|
||||
this.test_file = res.path;
|
||||
},
|
||||
mroomEidt(row) {
|
||||
this.type = "edit";
|
||||
this.editId = row.id;
|
||||
this.limitedVisible = true;
|
||||
this.addForm = Object.assign({}, row);
|
||||
}
|
||||
let that = this;
|
||||
that.type = "edit";
|
||||
that.editId = row.id;
|
||||
that.limitedVisible = true;
|
||||
that.addForm = Object.assign({}, row);
|
||||
},
|
||||
async mroomDel(row) {
|
||||
let that = this;
|
||||
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) {
|
||||
this.$message.error(res.err_msg);
|
||||
that.$message.error(res.err_msg);
|
||||
} else {
|
||||
this.$refs.table.refresh();
|
||||
this.$message.success("删除成功");
|
||||
that.$refs.table.refresh();
|
||||
that.$message.success("删除成功");
|
||||
}
|
||||
},
|
||||
|
||||
//搜索
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
};
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<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 {
|
||||
display: flex;
|
||||
|
|
|
@ -189,12 +189,8 @@ export default {
|
|||
querys:[[{field:"data__has_key",compare:"",value:"毛坯检测_日期"}]],
|
||||
},
|
||||
query:{
|
||||
name__contains:'',
|
||||
batch__contains:'',
|
||||
last_time__gte:'',
|
||||
last_time__lte:'',
|
||||
batch__contains:''
|
||||
},
|
||||
// apiObj: this.$API.wpm.wpr.query,
|
||||
apiObj: this.$API.wpm.batchstquery,
|
||||
options:[],
|
||||
tableData:[],
|
||||
|
@ -203,43 +199,17 @@ export default {
|
|||
methods: {
|
||||
handleQuery(){
|
||||
let that = this;
|
||||
let querys = [[{field:"wm",value:0,compare:"isnull"},{field:"data__has_key",compare:"",value:"毛坯检测_批次号"}]];
|
||||
let obj = {},obj1 = {},obj2 = {},obj3 = {};
|
||||
obj.field = 'data__毛坯检测_批次号';
|
||||
let querys = [[{field:"data__has_key",compare:"",value:"毛坯检测_日期"}]];
|
||||
let obj = {};
|
||||
obj.field = 'batch';
|
||||
obj.value = that.query.batch__contains;
|
||||
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){
|
||||
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;
|
||||
this.$refs.table.queryData(that.params);
|
||||
},
|
||||
getCountQt(data,type){
|
||||
let count_qt = 0,count = 0;
|
||||
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="titleMap[mode]"
|
||||
:title="titleMap[mode+type]"
|
||||
v-model="visible"
|
||||
width="1000px"
|
||||
:size="1000"
|
||||
|
@ -191,7 +191,7 @@
|
|||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<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-col>
|
||||
<el-col :md="12" :sm="24" v-if="type==50">
|
||||
|
@ -255,8 +255,14 @@ export default {
|
|||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: "新增交接记录",
|
||||
edit: "编辑交接记录",
|
||||
add10: "新增交接记录",
|
||||
add20: "新增返工记录",
|
||||
add40: "新增废品入库",
|
||||
add50: "新增改版记录",
|
||||
edit10: "编辑交接记录",
|
||||
edit20: "编辑返工记录",
|
||||
edit40: "编辑废品入库",
|
||||
edit50: "编辑改版记录",
|
||||
show: "查看交接记录",
|
||||
},
|
||||
lists:[],//交接数组
|
||||
|
@ -354,6 +360,9 @@ export default {
|
|||
mounted() {
|
||||
let that = this;
|
||||
that.form.type = that.type;
|
||||
if(that.type==50){
|
||||
that.change_batch = true;
|
||||
}
|
||||
let materialObj = that.$TOOL.data.get("MATERIAL_OBJECT");
|
||||
that.materialObj = materialObj;
|
||||
that.form.handle_date =that.form.send_date =this.$TOOL.dateFormat2(new Date());
|
||||
|
@ -384,8 +393,6 @@ export default {
|
|||
}
|
||||
}else if(that.type==40){//废品入库
|
||||
that.getMaterialNotok();
|
||||
}else if(that.type==60){
|
||||
|
||||
}
|
||||
that.getMgroupOptions();
|
||||
},
|
||||
|
@ -579,7 +586,7 @@ export default {
|
|||
},
|
||||
clearSelect(){
|
||||
let that = this;
|
||||
that.totalCount = 0;
|
||||
that.totalCount = 0;
|
||||
that.form.handoverb = [];
|
||||
},
|
||||
materialChange() {
|
||||
|
@ -589,6 +596,7 @@ export default {
|
|||
data = that.materialOptions.filter((item) => {
|
||||
return that.selectItems.indexOf(item.id)>-1;
|
||||
});
|
||||
that.form.new_batch = data[0].batch+'g';
|
||||
let materialId = data[0].material;
|
||||
if(that.type==50){}else{
|
||||
let params = {
|
||||
|
@ -765,6 +773,7 @@ export default {
|
|||
let hasArr = [];
|
||||
that.materialOptions.forEach((item) => {
|
||||
if(item.batch == res.batch){
|
||||
that.form.new_batch = res.batch+'g';
|
||||
hasArr.push(item);
|
||||
let params = {material: item.material,type: that.type};
|
||||
that.$API.wpm.handover.mgroups.req(params).then((res0) => {
|
||||
|
@ -818,6 +827,7 @@ export default {
|
|||
if(arr2.length>0){
|
||||
that.$message.error("该批次已存在")
|
||||
}else{
|
||||
that.form.new_batch = arr[0].batch+'g';
|
||||
let params = {material: arr[0].material,type: that.type};
|
||||
that.$API.wpm.handover.mgroups.req(params).then((res0) => {
|
||||
that.mgroupOptions = res0;
|
||||
|
@ -872,6 +882,7 @@ export default {
|
|||
}else{//handoverb里没有有这个物料批次
|
||||
that.materialOptions.forEach((item) => {
|
||||
if(item.id == res[0].wm){
|
||||
that.form.new_batch = item.batch+'g';
|
||||
let params = {material: item.material,type: that.type};
|
||||
that.$API.wpm.handover.mgroups.req(params).then((res1) => {
|
||||
that.mgroupOptions = res1;
|
||||
|
|
|
@ -557,6 +557,8 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
this.paramsIn.mlog = "";
|
||||
this.paramsOut.mlog = "";
|
||||
this.route_code = this.$route.path.split("/")[2];
|
||||
this.paramsIn.mlog = this.mlogId;
|
||||
this.paramsOut.mlog = this.mlogId;
|
||||
|
|
Loading…
Reference in New Issue