修改生产界面

master
夜笙歌 7 months ago
parent 0c1011f411
commit afd9339c01

@ -25,7 +25,8 @@ import {
selectDictLabel, selectDictLabel,
selectDictLabels, selectDictLabels,
handleTree, handleTree,
formatDayHourMinutes formatDayHourMinutes,
fileDownload
} from "@/utils/ruoyi"; } from "@/utils/ruoyi";
// 分页组件 // 分页组件
import Pagination from "@/components/Pagination"; import Pagination from "@/components/Pagination";
@ -57,6 +58,7 @@ Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download Vue.prototype.download = download
Vue.prototype.handleTree = handleTree Vue.prototype.handleTree = handleTree
Vue.prototype.formatDayHourMinutes = formatDayHourMinutes Vue.prototype.formatDayHourMinutes = formatDayHourMinutes
Vue.prototype.fileDownload = fileDownload
// 全局组件挂载 // 全局组件挂载
Vue.component('DictTag', DictTag) Vue.component('DictTag', DictTag)

@ -249,3 +249,20 @@ export function formatDayHourMinutes(seconds) {
} }
return result; return result;
} }
export function fileDownload(file) {
fetch(file.url).then(res => res.blob()).then((blob) => {
let reader = new FileReader();
reader.readAsDataURL(blob); // 转换为base64可以直接放入a标签href
reader.onload = function (e) {
// 转换完成创建一个a标签用于下载
let a = document.createElement('a');
a.download = file.name;
a.href = e.target.result;
document.body.appendChild(a);
a.click();
// 移除元素
document.body.removeChild(a);
}
})
}

@ -420,7 +420,7 @@
</el-form-item> </el-form-item>
<el-form-item label="仓库" > <el-form-item label="仓库" >
<el-select v-model="returnModelForm.warehouseId" placeholder="请选择仓库" :disabled="!returnModelForm.materialBarcode"> <el-select v-model="returnModelForm.warehouseId" placeholder="请选择仓库" :disabled="!returnModelForm.materialBarcode">
<el-option :label="i.label" :value="i.value" v-for="i in WarehousesList"></el-option> <el-option :label="i.label" :key="i.value" :value="i.value" v-for="i in WarehousesList"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数量" > <el-form-item label="数量" >
@ -428,7 +428,7 @@
</el-form-item> </el-form-item>
<el-form-item label="退库类型" prop="taskType"> <el-form-item label="退库类型" prop="taskType">
<el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型"> <el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型">
<el-option :label="i.label" :value="i.value" v-for="i in dict.type.wms_raw_return_task_type"></el-option> <el-option :label="i.label" :key="i.value" :value="i.value" v-for="i in dict.type.wms_raw_return_task_type"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="申请原因" > <el-form-item label="申请原因" >
@ -827,7 +827,7 @@ export default {
}, },
async startPlan(val,materialBarcode) { async startPlan(val,materialBarcode) {
let data; let data;
if(materialBarcode && materialBarcode!=null && materialBarcode!=undefined && materialBarcode!=''){ if(materialBarcode && materialBarcode!==''){
data = await scan2StartNextProductPlanDetail({planId: val.planId,materialBarcode:materialBarcode}) data = await scan2StartNextProductPlanDetail({planId: val.planId,materialBarcode:materialBarcode})
}else{ }else{
data = await startNextProductPlanDetail({planId: val.planId}) data = await startNextProductPlanDetail({planId: val.planId})
@ -854,7 +854,7 @@ export default {
this.$modal.msgWarning("请扫描或输入物料条码"); this.$modal.msgWarning("请扫描或输入物料条码");
return; return;
} }
this.startPlan(val,this.input1); await this.startPlan(val, this.input1);
document.body.click() document.body.click()
// const data = await startNextProductPlanDetail({planId: val.planId}) // const data = await startNextProductPlanDetail({planId: val.planId})

@ -515,36 +515,38 @@
</el-dialog> </el-dialog>
<el-dialog :visible.sync="returnModelVisible" title="退料" width="25%"> <el-dialog :visible.sync="returnModelVisible" title="退料" width="25%">
<el-form ref="returnModelForm" :model="returnModelForm" label-width="80px" :rules="returnModelFormRules"> <el-form ref="returnModelForm" :model="returnModelForm" :rules="returnModelFormRules" label-width="80px">
<el-form-item label="计划编号" > <el-form-item label="计划编号">
<el-input v-model="returnModelForm.planCode" autocomplete="off" disabled></el-input> <el-input v-model="returnModelForm.planCode" autocomplete="off" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="明细编号" > <el-form-item label="明细编号">
<el-input v-model="returnModelForm.planDetailCode" autocomplete="off" disabled></el-input> <el-input v-model="returnModelForm.planDetailCode" autocomplete="off" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="成品" > <el-form-item label="成品">
<el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input> <el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="物料条码" > <el-form-item label="物料条码">
<el-input placeholder="请输入内容" v-model="returnModelForm.materialBarcode" class="input-with-select" @blur="setReturnModelForm"> <el-input v-model="returnModelForm.materialBarcode" class="input-with-select" placeholder="请输入内容"
@blur="setReturnModelForm">
<el-button slot="append" icon="el-icon-search"></el-button> <el-button slot="append" icon="el-icon-search"></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="仓库" > <el-form-item label="仓库">
<el-select v-model="returnModelForm.warehouseId" placeholder="请选择仓库" :disabled="!returnModelForm.materialBarcode"> <el-select v-model="returnModelForm.warehouseId" :disabled="!returnModelForm.materialBarcode"
<el-option :label="i.label" :value="i.value" v-for="i in WarehousesList"></el-option> placeholder="请选择仓库">
<el-option v-for="i in WarehousesList" :label="i.label" :key="i.value" :value="i.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数量" > <el-form-item label="数量">
<el-input-number v-model="returnModelForm.planAmount" controls-position="right" :min="1" ></el-input-number> <el-input-number v-model="returnModelForm.planAmount" :min="1" controls-position="right"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="退库类型" prop="taskType"> <el-form-item label="退库类型" prop="taskType">
<el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型"> <el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型">
<el-option :label="i.label" :value="i.value" v-for="i in dict.type.wms_raw_return_task_type"></el-option> <el-option v-for="i in dict.type.wms_raw_return_task_type" :label="i.label" :key="i.value" :value="i.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="申请原因" > <el-form-item label="申请原因">
<el-input type="textarea" v-model="returnModelForm.applyReason" autocomplete="off"></el-input> <el-input v-model="returnModelForm.applyReason" autocomplete="off" type="textarea"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="returnModelVisible = false"> </el-button> <el-button @click="returnModelVisible = false"> </el-button>
@ -553,6 +555,65 @@
</el-form> </el-form>
</el-dialog> </el-dialog>
<el-dialog
:visible.sync="SOPModel"
title="上传图纸"
width="30%"
@before-close="blueprintModel = false">
<el-upload
ref="drawingUpload"
:auto-upload="true"
:file-list="fileList"
:headers="headers"
:limit="0"
action="uploadImgUrl"
list-type="picture-card"
single
>
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
<img
v-if="isAssetTypeAnImage(file.name)"
:alt="file.name"
:src="file.url" class="el-upload-list__item-thumbnail"
>
<span v-else>{{ file.name }}</span>
<span class="el-upload-list__item-actions">
<span
v-if="isAssetTypeAnImage(file.name)"
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<span
class="el-upload-list__item-delete"
@click="handleDownload(file)"
>
<i class="el-icon-download"></i>
</span>
</span>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="SOPModel = false"> </el-button>
<el-button @click="SOPModel = false"> </el-button>
</div>
</el-dialog>
<el-dialog
:visible.sync="pictureDetailModel"
append-to-body
title="图纸预览"
width="800"
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</el-dialog>
</div> </div>
</template> </template>
@ -570,20 +631,66 @@ import {
firstFloorProduceInstock, firstFloorProduceInstock,
scanMaterial2Confirm, applyRawReturn scanMaterial2Confirm, applyRawReturn
} from '@/api/board' } from '@/api/board'
import {getToken} from "@/utils/auth";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default { export default {
name: 'Board1', name: 'Board1',
dicts: ['mes_plan_detail_status','wms_raw_return_task_type'], dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type'],
components: { components: {
Chart, Chart,
PrintPage PrintPage
}, },
data() { data() {
return { return {
fileList: [
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: 'Snipaste_2023-09-04_08-16-59.png',
url: 'http://175.27.215.92:9665/statics/2024/04/17/Snipaste_2023-09-04_08-16-59_20240417142903A013.png'
},
{
name: '会议纪要 0825_20240417143926A014.docx',
url: 'http://175.27.215.92:9665/statics/2024/04/17/会议纪要 0825_20240417143926A014.docx'
},
],
SOPModel: true,
pictureDetailModel: false,
dialogImageUrl: '',
returnModelVisible: false, returnModelVisible: false,
returnModelForm:{}, returnModelForm: {},
WarehousesList:[], WarehousesList: [],
PrintData: {}, PrintData: {},
printModel: false, printModel: false,
nowNum1: 1, nowNum1: 1,
@ -631,9 +738,12 @@ export default {
}, },
returnModelFormRules: { returnModelFormRules: {
taskType: [ taskType: [
{ required: true, message: '请选择退库类型', trigger: 'change' } {required: true, message: '请选择退库类型', trigger: 'change'}
], ],
}, },
headers: {
Authorization: "Bearer " + getToken(),
},
} }
}, },
@ -1108,31 +1218,31 @@ export default {
}, },
returnMaterial(e) { returnMaterial(e) {
this.returnModelVisible = true this.returnModelVisible = true
this.returnModelForm = {materialName:this.nowMaterial,...e.row} this.returnModelForm = {materialName: this.nowMaterial, ...e.row}
}, },
setReturnModelForm(){ setReturnModelForm() {
getWarehouses({ getWarehouses({
warehouseFloor:1, warehouseFloor: 1,
materialBarcode:this.returnModelForm.materialBarcode materialBarcode: this.returnModelForm.materialBarcode
}).then(e=>{ }).then(e => {
this.WarehousesList = e.data.map(v=>{ this.WarehousesList = e.data.map(v => {
return { return {
label:v.warehouseName, label: v.warehouseName,
value:v.warehouseId, value: v.warehouseId,
} }
}) })
}) })
}, },
returnModelConfirm(){ returnModelConfirm() {
this.$refs.returnModelForm.validate((valid) => { this.$refs.returnModelForm.validate((valid) => {
if (valid) { if (valid) {
let data = {} let data = {}
let keys = ['warehouseId','planCode','planDetailCode','productId','materialBarcode','planAmount','taskType','applyReason'] let keys = ['warehouseId', 'planCode', 'planDetailCode', 'productId', 'materialBarcode', 'planAmount', 'taskType', 'applyReason']
keys.forEach(v=>{ keys.forEach(v => {
data[v] = this.returnModelForm[v] data[v] = this.returnModelForm[v]
}) })
applyRawReturn(data).then(v=>{ applyRawReturn(data).then(v => {
if(v.code === 200){ if (v.code === 200) {
this.$message({ this.$message({
message: '退库成功', message: '退库成功',
type: 'success' type: 'success'
@ -1144,7 +1254,22 @@ export default {
return false; return false;
} }
}); });
} },
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.pictureDetailModel = true;
},
//
async handleDownload(file) {
this.fileDownload(file)
},
isAssetTypeAnImage(ext) {
let suffix = ext.lastIndexOf(".");
let name = ext.substr(suffix + 1);
return ['png', 'jpg', 'jpeg'].includes(name.toLowerCase())
},
} }
} }
@ -1260,4 +1385,8 @@ export default {
/deep/ .dialog .el-dialog__body { /deep/ .dialog .el-dialog__body {
padding: 0 !important; padding: 0 !important;
} }
/deep/ .el-upload {
display: none;
}
</style> </style>

@ -364,7 +364,7 @@
</el-form-item> </el-form-item>
<el-form-item label="仓库" > <el-form-item label="仓库" >
<el-select v-model="returnModelForm.warehouseId" placeholder="请选择仓库" :disabled="!returnModelForm.materialBarcode"> <el-select v-model="returnModelForm.warehouseId" placeholder="请选择仓库" :disabled="!returnModelForm.materialBarcode">
<el-option :label="i.label" :value="i.value" v-for="i in WarehousesList"></el-option> <el-option :label="i.label" :key="i.value" :value="i.value" v-for="i in WarehousesList"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数量" > <el-form-item label="数量" >
@ -372,7 +372,7 @@
</el-form-item> </el-form-item>
<el-form-item label="退库类型" prop="taskType"> <el-form-item label="退库类型" prop="taskType">
<el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型"> <el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型">
<el-option :label="i.label" :value="i.value" v-for="i in dict.type.wms_raw_return_task_type"></el-option> <el-option :label="i.label" :key="i.value" :value="i.value" v-for="i in dict.type.wms_raw_return_task_type"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="申请原因" > <el-form-item label="申请原因" >

Loading…
Cancel
Save