fix:工艺步骤排一次棒时添加工艺图纸,并在‘排一次棒‘日志中展示第一张图片
This commit is contained in:
parent
761ae58959
commit
cbc940b8df
|
|
@ -194,6 +194,11 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-row>
|
<el-row>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
|
|
@ -331,9 +336,12 @@ export default {
|
||||||
divDisable:false,
|
divDisable:false,
|
||||||
materialsIn: [],
|
materialsIn: [],
|
||||||
materialsOut: [],
|
materialsOut: [],
|
||||||
|
fileIds: [],
|
||||||
|
fileurl:[],
|
||||||
mgroups: [],
|
mgroups: [],
|
||||||
options: [],
|
options: [],
|
||||||
routemats:[],
|
routemats:[],
|
||||||
|
paramsJsonFileurl:[],
|
||||||
materialOptions:[],
|
materialOptions:[],
|
||||||
titleMap: { add: "新增", edit: "编辑" },
|
titleMap: { add: "新增", edit: "编辑" },
|
||||||
setFiltersVisible: false,
|
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") {
|
open(mode = "add") {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
@ -453,6 +482,13 @@ export default {
|
||||||
}
|
}
|
||||||
if(data.process_name=='排一次棒'){
|
if(data.process_name=='排一次棒'){
|
||||||
that.params_json=that.form.params_json;
|
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(() => {
|
setTimeout(() => {
|
||||||
that.options.forEach((item) => {
|
that.options.forEach((item) => {
|
||||||
|
|
@ -475,6 +511,7 @@ export default {
|
||||||
if(that.processName=='捆棒'){
|
if(that.processName=='捆棒'){
|
||||||
that.form.params_json = that.params_json2;
|
that.form.params_json = that.params_json2;
|
||||||
}
|
}
|
||||||
|
console.log('that.form',that.form);
|
||||||
if (that.mode === "add") {
|
if (that.mode === "add") {
|
||||||
that.$API.mtm.route.create.req(that.form).then((res) => {
|
that.$API.mtm.route.create.req(that.form).then((res) => {
|
||||||
that.isSaveing = false;
|
that.isSaveing = false;
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,13 @@
|
||||||
<el-descriptions-item label="指导文件" v-if="route_file!==null">
|
<el-descriptions-item label="指导文件" v-if="route_file!==null">
|
||||||
<el-button @click="showFile">查看</el-button>
|
<el-button @click="showFile">查看</el-button>
|
||||||
</el-descriptions-item>
|
</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>
|
</el-descriptions>
|
||||||
<div style="padding: 5px 10px;display: flex;justify-content: end;">
|
<div style="padding: 5px 10px;display: flex;justify-content: end;">
|
||||||
<el-button
|
<el-button
|
||||||
|
|
@ -466,6 +473,7 @@ export default {
|
||||||
check_single: false,
|
check_single: false,
|
||||||
},
|
},
|
||||||
apiObj: null,
|
apiObj: null,
|
||||||
|
imageUrl:null,
|
||||||
apiObjMuser:null,
|
apiObjMuser:null,
|
||||||
paramsIn: {
|
paramsIn: {
|
||||||
page: 0,
|
page: 0,
|
||||||
|
|
@ -592,6 +600,13 @@ export default {
|
||||||
}
|
}
|
||||||
if(res.route!==null){
|
if(res.route!==null){
|
||||||
that.hasRoute = true;
|
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 = [];
|
that.oinfo_json = [];
|
||||||
if(res.oinfo_json_&&res.oinfo_json_!==null){
|
if(res.oinfo_json_&&res.oinfo_json_!==null){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue