fix:工艺步骤排一次棒时添加工艺图纸,并在‘排一次棒‘日志中展示第一张图片
This commit is contained in:
parent
761ae58959
commit
cbc940b8df
|
|
@ -194,6 +194,11 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="工艺图纸">
|
||||
<sc-upload-multiple v-model="fileurl" @imagesDel="imagesDel" @imagesChange="imagesChange" draggable :limit="9" tip="最多上传9个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
|
|
@ -331,9 +336,12 @@ export default {
|
|||
divDisable:false,
|
||||
materialsIn: [],
|
||||
materialsOut: [],
|
||||
fileIds: [],
|
||||
fileurl:[],
|
||||
mgroups: [],
|
||||
options: [],
|
||||
routemats:[],
|
||||
paramsJsonFileurl:[],
|
||||
materialOptions:[],
|
||||
titleMap: { add: "新增", edit: "编辑" },
|
||||
setFiltersVisible: false,
|
||||
|
|
@ -424,6 +432,27 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesChange(data,data1){
|
||||
let files = [];
|
||||
this.fileIds = data;
|
||||
data1.forEach((item)=>{
|
||||
let obj = {};
|
||||
obj.id = item.id;
|
||||
obj.file = item.file;
|
||||
obj.name = item.name;
|
||||
obj.path = item.path;
|
||||
files.push(obj);
|
||||
})
|
||||
this.paramsJsonFileurl = files;
|
||||
this.params_json.fileurl = JSON.stringify(files);
|
||||
},
|
||||
//合并新增的图片Ids
|
||||
imagesDel(index){
|
||||
this.fileIds.splice(index,1);
|
||||
this.paramsJsonFileurl.splice(index,1);
|
||||
this.params_json.fileurl = JSON.stringify(this.paramsJsonFileurl);
|
||||
},
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
let that = this;
|
||||
|
|
@ -453,6 +482,13 @@ export default {
|
|||
}
|
||||
if(data.process_name=='排一次棒'){
|
||||
that.params_json=that.form.params_json;
|
||||
console.log('that.params_json',that.params_json);
|
||||
let fileurl = JSON.parse(that.params_json.fileurl);
|
||||
console.log('fileurl',fileurl);
|
||||
fileurl.forEach((item)=>{
|
||||
item.url = item.path;
|
||||
that.fileurl.push(item);
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
that.options.forEach((item) => {
|
||||
|
|
@ -475,6 +511,7 @@ export default {
|
|||
if(that.processName=='捆棒'){
|
||||
that.form.params_json = that.params_json2;
|
||||
}
|
||||
console.log('that.form',that.form);
|
||||
if (that.mode === "add") {
|
||||
that.$API.mtm.route.create.req(that.form).then((res) => {
|
||||
that.isSaveing = false;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,13 @@
|
|||
<el-descriptions-item label="指导文件" v-if="route_file!==null">
|
||||
<el-button @click="showFile">查看</el-button>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工艺图纸" v-if="imageUrl!==null">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src="imageUrl"
|
||||
fit="fill"
|
||||
/>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div style="padding: 5px 10px;display: flex;justify-content: end;">
|
||||
<el-button
|
||||
|
|
@ -466,6 +473,7 @@ export default {
|
|||
check_single: false,
|
||||
},
|
||||
apiObj: null,
|
||||
imageUrl:null,
|
||||
apiObjMuser:null,
|
||||
paramsIn: {
|
||||
page: 0,
|
||||
|
|
@ -592,6 +600,13 @@ export default {
|
|||
}
|
||||
if(res.route!==null){
|
||||
that.hasRoute = true;
|
||||
that.$API.mtm.route.item.req(res.route).then((routeRes) => {
|
||||
let params_json = routeRes.params_json;
|
||||
if(params_json.fileurl){
|
||||
let fileurl = JSON.parse(params_json.fileurl);
|
||||
that.imageUrl = fileurl[0].file;
|
||||
}
|
||||
})
|
||||
}
|
||||
that.oinfo_json = [];
|
||||
if(res.oinfo_json_&&res.oinfo_json_!==null){
|
||||
|
|
|
|||
Loading…
Reference in New Issue