This commit is contained in:
xielue 2023-10-23 12:22:19 +08:00
parent 9ba0283985
commit fd8e32cc0e
2 changed files with 84 additions and 35 deletions

View File

@ -51,11 +51,16 @@
<vxe-column field="inlay" title="镶件材料" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column> <vxe-column field="inlay" title="镶件材料" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
<vxe-column field="remark" title="备注" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column> <vxe-column field="remark" title="备注" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
<vxe-column title="模具图片" width="90"> <vxe-column title="图片" width="90">
<template #default="{ row }"> <template #default="{ row }">
<img v-if="row.component_detail && row.component_detail.image" style="width:50px;height:50px;" <img v-if="row.component_img" style="width:50px;height:50px;" :src="row.component_img"
:src="row.component_detail.image" @click.stop="$hevueImgPreview(row.component_detail.image)" /> @click.stop="$hevueImgPreview(row.component_img)" />
<span v-else></span> <span v-else>
<a-upload name="file" accept="image/*" :before-upload="beforeUpload" :show-upload-list="false">
<a-button type="link" @click="uploadClick({ row })">上传图片</a-button>
</a-upload>
</span>
</template> </template>
</vxe-column> </vxe-column>
@ -287,6 +292,8 @@ export default {
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list` dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`
}, },
currentRow: null
}; };
@ -669,6 +676,33 @@ export default {
console.log(rows, name, params); console.log(rows, name, params);
}, },
beforeUpload(file) {
var suffix = file.name.substring(file.name.lastIndexOf(".") + 1);
this.$mk.uploadFile(file, suffix, (url) => {
this.currentRow.component_img = url;
this.$forceUpdate();
if (this.currentRow.id) {
this.$mk.post({
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/upload`,
data: { id: this.currentRow.id, image: url },
useBigInt: true
}).then(a => {
console.log(a);
});
}
});
return false
},
uploadClick({ row }) {
this.currentRow = row;
}
}, },
// //
watch: { watch: {

View File

@ -17,7 +17,7 @@
<div class="gx-item"> <div class="gx-item">
<div class="gx-item-col"> <div class="gx-item-col">
<div>部门{{ item.department_detail ? item.department_detail.name : '' }}</div> <div v-if="item.department_detail && item.department_detail.name">部门{{ item.department_detail.name }}</div>
<div>部件{{ item.component_detail ? item.component_detail.name : '' }}</div> <div>部件{{ item.component_detail ? item.component_detail.name : '' }}</div>
<div>工序{{ item.process_detail ? item.process_detail.name : '' }}</div> <div>工序{{ item.process_detail ? item.process_detail.name : '' }}</div>
@ -53,22 +53,21 @@
</div> </div>
</div> </div>
<div v-else style="height: 300px;overflow:auto;;"> <div v-else style="height: 350px;overflow:auto;;">
<div v-for="ditem in detailsData3" :key="ditem.id" class="card-item" > <div v-for="ditem in detailsData4" :key="ditem.id" class="card-item">
<h3>{{ ditem.name }}</h3> <h3>{{ ditem.component_detail ? ditem.component_detail.name : '' }}</h3>
<div v-for="item in ditem.progressList" :key="item.id"> <div v-for="item in ditem.progressList" :key="item.id">
<div class="gx-item"> <div class="gx-item">
<div class="gx-item-col"> <div class="gx-item-col">
<div v-if="item.department_detail && item.department_detail.name">部门{{ item.department_detail.name }}</div>
<div>部件{{ item.component_detail ? item.component_detail.name : '' }}</div>
<div>工序{{ item.process_detail ? item.process_detail.name : '' }}</div> <div>工序{{ item.process_detail ? item.process_detail.name : '' }}</div>
<div>状态{{ item.is_complete ? "已完成" : (item.is_send ? "已发料" : "未发料") }}</div> <div>状态{{ item.is_complete ? "已完成" : (item.is_send ? "已发料" : "未发料") }}({{ item.progress }}%)</div>
</div> </div>
<div class="gx-item-col"> <div class="gx-item-col">
<div> <div>
@ -82,26 +81,26 @@
v-if="item.is_complete == 1">撤销报工</a-button> v-if="item.is_complete == 1">撤销报工</a-button>
</div> </div>
<div style="margin-top: 10px;;" v-if="item.complete_time"> <div style="margin-top: 10px;;" v-if="item.complete_time">
{{ getDateValueString(item.complete_time) }} {{ getDateValueString(item.complete_time) }}
</div> </div>
</div> </div>
</div> </div>
<div class="card-item-progress">
<img v-if="item.component_detail && item.component_detail.image"
@click.stop="$hevueImgPreview(item.component_detail.image)"
style="width:50px;height:50px;margin-right: 10px;" :src="item.component_detail.image" />
<span v-else></span>
<a-progress type="circle" :percent="item.progress" :width="50" />
</div>
</div> </div>
<div class="card-item-progress">
<img v-if="ditem.component_img" @click.stop="$hevueImgPreview(ditem.component_img)"
style="width:50px;height:50px;margin-right: 10px;" :src="ditem.component_img" />
<span v-else></span>
<a-progress type="circle" :percent="ditem.progress" :width="50" />
</div>
</div> </div>
@ -113,11 +112,11 @@
<h4>部门进度汇总</h4> <h4>部门进度汇总</h4>
<vxe-table border show-overflow keep-source ref="xTable3" :height="300" :data="detailsData3"> <vxe-table border show-overflow keep-source ref="xTable3" :height="240" :data="detailsData3">
<vxe-column field="name" title="部门名称" width="160"></vxe-column> <vxe-column field="name" title="部门名称" width="160"></vxe-column>
<vxe-column field="code" title="部门编码" width="160"></vxe-column> <vxe-column field="code" title="部门编码" width="160"></vxe-column>
<vxe-column field="process_num" title="工序数量" width="160"></vxe-column> <vxe-column field="process_num" title="工序数" width="110"></vxe-column>
<vxe-column type="expand" title="工序明细" width="160"> <vxe-column type="expand" title="工序明细" width="160" v-if="false">
<template #content="{ row }"> <template #content="{ row }">
<a-table :columns="sub_columns" :data-source="row.progressList" <a-table :columns="sub_columns" :data-source="row.progressList"
style="border:1px solid #afafaf;margin: 15px;"> style="border:1px solid #afafaf;margin: 15px;">
@ -277,6 +276,10 @@ export default {
currentId: 0, currentId: 0,
detailsData: [], detailsData: [],
detailsData3: [], detailsData3: [],
detailsData4: [], //
poData: [], poData: [],
tips: ["点一", "点二", "点三"], tips: ["点一", "点二", "点三"],
current_mold_production_order_component_processes: [], current_mold_production_order_component_processes: [],
@ -362,14 +365,9 @@ export default {
}, },
{ {
title: '工程师傅', span: 24, title: '工程师傅', span: 24,
field: 'project_user_detail', field: 'engineer_name',
itemRender: { itemRender: {
name: 'MkFormInputShow', props: { name: 'MkFormInputShow', props: {
params: {
dataType: "object",
valueField: "id",
textField: "name"
}
} }
} }
}, },
@ -745,6 +743,8 @@ export default {
let mold_production_order_component_processes = JSON.parse(JSON.stringify(row.mold_production_order_component_processes)); let mold_production_order_component_processes = JSON.parse(JSON.stringify(row.mold_production_order_component_processes));
let ds3 = JSON.parse(JSON.stringify(row.department_progress || [])); let ds3 = JSON.parse(JSON.stringify(row.department_progress || []));
let ds4 = JSON.parse(JSON.stringify(row.mold_production_order_component || []));
ds3.forEach(item => { ds3.forEach(item => {
item.progressList = []; item.progressList = [];
@ -759,12 +759,27 @@ export default {
}) })
}) })
ds4.forEach(item => {
item.progressList = [];
mold_production_order_component_processes.forEach(pitem => {
if (pitem.component_line == item.component_line) {
pitem.process_detail_name = pitem.process_detail.name
pitem.process_detail_code = pitem.process_detail.code
pitem.component_detail_name = pitem.component_detail.name
item.progressList.push(pitem);
}
})
})
this.detailsData3 = ds3; this.detailsData3 = ds3;
this.detailsData4 = ds4;
data3.mold_master_user_detail = row.mold_master_user_detail; data3.mold_master_user_detail = row.mold_master_user_detail;
data3.engineer_name = row.engineer_name;
this.formOptions2.data = data2 this.formOptions2.data = data2
this.formOptions3.data = data3 this.formOptions3.data = data3
this.current_mold_production_order_component_processes = row.mold_production_order_component_processes; this.current_mold_production_order_component_processes = row.mold_production_order_component_processes;
@ -1012,11 +1027,11 @@ export default {
} }
.left { .left {
flex: 4; flex: 5;
} }
.right { .right {
flex: 6; flex: 5;
margin-left: 10px; margin-left: 10px;
} }