fix:mlog中添加操作项
This commit is contained in:
parent
29c5eeb514
commit
3de4874cf4
|
|
@ -119,6 +119,61 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24" v-for="item in testitems" :key="item.id">
|
||||||
|
<el-form-item :label="item.name">
|
||||||
|
<el-input-number
|
||||||
|
v-if="item.field_type=='input-number'"
|
||||||
|
v-model="item.value"
|
||||||
|
:min="0"
|
||||||
|
class="width-100"
|
||||||
|
controls-position="right"
|
||||||
|
>
|
||||||
|
</el-input-number>
|
||||||
|
<el-input-number
|
||||||
|
v-if="item.field_type=='input-int'"
|
||||||
|
v-model="item.value"
|
||||||
|
:min="0"
|
||||||
|
class="width-100"
|
||||||
|
controls-position="right"
|
||||||
|
>
|
||||||
|
</el-input-number>
|
||||||
|
<el-input
|
||||||
|
v-if="item.field_type=='input-text'"
|
||||||
|
v-model="item.value"
|
||||||
|
class="width-100"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
<el-select
|
||||||
|
v-if="item.field_type=='select-text'"
|
||||||
|
v-model="item.value"
|
||||||
|
clearable
|
||||||
|
class="width-100"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item0 in item.choices"
|
||||||
|
:key="item0"
|
||||||
|
:label="item0"
|
||||||
|
:value="item0"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-select
|
||||||
|
v-if="item.field_type=='selects-text'"
|
||||||
|
v-model="item.value"
|
||||||
|
clearable
|
||||||
|
multiple
|
||||||
|
class="width-100"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item1 in item.choices"
|
||||||
|
:key="item1"
|
||||||
|
:label="item1"
|
||||||
|
:value="item1"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="开始时间"
|
label="开始时间"
|
||||||
|
|
@ -188,6 +243,7 @@ const defaultForm = {
|
||||||
note:'',
|
note:'',
|
||||||
mgroup:'',
|
mgroup:'',
|
||||||
mtask:'',
|
mtask:'',
|
||||||
|
oinfo_json:{},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -267,6 +323,7 @@ export default {
|
||||||
visible: false,
|
visible: false,
|
||||||
isSaveing: false,
|
isSaveing: false,
|
||||||
options: [],
|
options: [],
|
||||||
|
testitems:[],
|
||||||
routeOptions: [],
|
routeOptions: [],
|
||||||
userOptions: [],
|
userOptions: [],
|
||||||
mtaskOptions:[],
|
mtaskOptions:[],
|
||||||
|
|
@ -280,12 +337,23 @@ export default {
|
||||||
this.getSupplier();
|
this.getSupplier();
|
||||||
this.getEquipment();
|
this.getEquipment();
|
||||||
this.getMtask();
|
this.getMtask();
|
||||||
|
this.gettestitem();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
disabledDateFn(time) {
|
disabledDateFn(time) {
|
||||||
return time.getTime() > new Date().getTime();
|
return time.getTime() > new Date().getTime();
|
||||||
},
|
},
|
||||||
|
gettestitem(){
|
||||||
|
let that = this;
|
||||||
|
that.$API.qm.testitem.list.req({ process: that.process,type:20 }).then((res) => {
|
||||||
|
res.results.forEach((item) => {
|
||||||
|
let obj = {};
|
||||||
|
Object.assign(obj, item);
|
||||||
|
obj.value = '';
|
||||||
|
that.testitems.push(obj);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
},
|
||||||
//获取
|
//获取
|
||||||
getUser() {
|
getUser() {
|
||||||
this.$API.system.user.list.req({ depts: this.dept }).then((res) => {
|
this.$API.system.user.list.req({ depts: this.dept }).then((res) => {
|
||||||
|
|
@ -337,12 +405,26 @@ export default {
|
||||||
},
|
},
|
||||||
//表单注入数据
|
//表单注入数据
|
||||||
setData(data) {
|
setData(data) {
|
||||||
|
let that = this;
|
||||||
console.log("data", data);
|
console.log("data", data);
|
||||||
Object.assign(this.form, data);
|
Object.assign(this.form, data);
|
||||||
if(data.test_file!==null){
|
if(data.test_file!==null){
|
||||||
this.form.test_file = data.test_file;
|
this.form.test_file = data.test_file;
|
||||||
this.fileList = [{name:data.test_file,url:data.test_file}];
|
this.fileList = [{name:data.test_file,url:data.test_file}];
|
||||||
}
|
}
|
||||||
|
if(data.oinfo_json!==null){
|
||||||
|
if(that.testitems.length>0){
|
||||||
|
that.testitems.forEach((item) => {
|
||||||
|
item.value = data.oinfo_json[item.id];
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
setTimeout(() => {
|
||||||
|
that.testitems.forEach((item) => {
|
||||||
|
item.value = data.oinfo_json[item.id];
|
||||||
|
});
|
||||||
|
},500)
|
||||||
|
}
|
||||||
|
}
|
||||||
this.getRoute(data.id);
|
this.getRoute(data.id);
|
||||||
},
|
},
|
||||||
changeMtask(){
|
changeMtask(){
|
||||||
|
|
@ -365,6 +447,11 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
that.isSaveing = true;
|
that.isSaveing = true;
|
||||||
that.form.mgroup = that.mgroup;
|
that.form.mgroup = that.mgroup;
|
||||||
|
let oinfo_json = {};
|
||||||
|
that.testitems.forEach((item) => {
|
||||||
|
oinfo_json[item.id] = item.value;
|
||||||
|
})
|
||||||
|
that.form.oinfo_json = oinfo_json;
|
||||||
if (that.mode === "add") {
|
if (that.mode === "add") {
|
||||||
that.$API.wpm.mlog.init.req(that.form).then((res) => {
|
that.$API.wpm.mlog.init.req(that.form).then((res) => {
|
||||||
that.isSaveing = false;
|
that.isSaveing = false;
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@
|
||||||
:process="processId"
|
:process="processId"
|
||||||
:mgroup="mgroupId"
|
:mgroup="mgroupId"
|
||||||
:dept="deptId"
|
:dept="deptId"
|
||||||
:mgroup_name = "mgroup_name"
|
:mgroupName = "mgroupName"
|
||||||
@success="handleSaveSuccess"
|
@success="handleSaveSuccess"
|
||||||
@closed="dialog.save = false"
|
@closed="dialog.save = false"
|
||||||
>
|
>
|
||||||
|
|
@ -155,6 +155,7 @@
|
||||||
v-if="dialog.detail"
|
v-if="dialog.detail"
|
||||||
ref="detailDialog"
|
ref="detailDialog"
|
||||||
:mlogId="mlogId"
|
:mlogId="mlogId"
|
||||||
|
:process="processId"
|
||||||
:mtask="mtask"
|
:mtask="mtask"
|
||||||
@closed="detailClose"
|
@closed="detailClose"
|
||||||
>
|
>
|
||||||
|
|
@ -197,7 +198,6 @@ export default {
|
||||||
deptId: null,
|
deptId: null,
|
||||||
processId: "",
|
processId: "",
|
||||||
processCate: "",
|
processCate: "",
|
||||||
mgroup_name:''
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -206,8 +206,7 @@ export default {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.params.mgroup = "";
|
that.params.mgroup = "";
|
||||||
that.apiObj = null;
|
that.apiObj = null;
|
||||||
that.mgroup_name = newval;
|
that.getMgroupInfo();
|
||||||
// that.getMgroupInfo();
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -215,9 +214,7 @@ export default {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.params.mgroup =that.mgroupId;
|
that.params.mgroup =that.mgroupId;
|
||||||
that.apiObj = that.$API.wpm.mlog.list;
|
that.apiObj = that.$API.wpm.mlog.list;
|
||||||
// this.mgroup_name = this.mgroupName;
|
this.getMgroupInfo();
|
||||||
// this.getMgroupInfo();
|
|
||||||
// console.log("mgroupName",this.mgroupName);
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getMgroupInfo(){
|
getMgroupInfo(){
|
||||||
|
|
@ -227,7 +224,6 @@ export default {
|
||||||
that.$message.error("获取工段错误");
|
that.$message.error("获取工段错误");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
that.mgroupId = res.id;
|
|
||||||
that.deptId = res.belong_dept;
|
that.deptId = res.belong_dept;
|
||||||
that.processId = res.process;
|
that.processId = res.process;
|
||||||
that.processCate = res.process_cate;
|
that.processCate = res.process_cate;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue