修改生产界面

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

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

@ -249,3 +249,20 @@ export function formatDayHourMinutes(seconds) {
}
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 label="仓库" >
<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-form-item>
<el-form-item label="数量" >
@ -428,7 +428,7 @@
</el-form-item>
<el-form-item label="退库类型" prop="taskType">
<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-form-item>
<el-form-item label="申请原因" >
@ -827,7 +827,7 @@ export default {
},
async startPlan(val,materialBarcode) {
let data;
if(materialBarcode && materialBarcode!=null && materialBarcode!=undefined && materialBarcode!=''){
if(materialBarcode && materialBarcode!==''){
data = await scan2StartNextProductPlanDetail({planId: val.planId,materialBarcode:materialBarcode})
}else{
data = await startNextProductPlanDetail({planId: val.planId})
@ -854,7 +854,7 @@ export default {
this.$modal.msgWarning("请扫描或输入物料条码");
return;
}
this.startPlan(val,this.input1);
await this.startPlan(val, this.input1);
document.body.click()
// const data = await startNextProductPlanDetail({planId: val.planId})

@ -515,7 +515,7 @@
</el-dialog>
<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-input v-model="returnModelForm.planCode" autocomplete="off" disabled></el-input>
</el-form-item>
@ -526,25 +526,27 @@
<el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input>
</el-form-item>
<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-input>
</el-form-item>
<el-form-item label="仓库">
<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-select v-model="returnModelForm.warehouseId" :disabled="!returnModelForm.materialBarcode"
placeholder="请选择仓库">
<el-option v-for="i in WarehousesList" :label="i.label" :key="i.value" :value="i.value"></el-option>
</el-select>
</el-form-item>
<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 label="退库类型" prop="taskType">
<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-form-item>
<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-button @click="returnModelVisible = false"> </el-button>
@ -553,6 +555,65 @@
</el-form>
</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>
</template>
@ -570,6 +631,7 @@ import {
firstFloorProduceInstock,
scanMaterial2Confirm, applyRawReturn
} from '@/api/board'
import {getToken} from "@/utils/auth";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -581,6 +643,51 @@ export default {
},
data() {
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,
returnModelForm: {},
WarehousesList: [],
@ -634,6 +741,9 @@ export default {
{required: true, message: '请选择退库类型', trigger: 'change'}
],
},
headers: {
Authorization: "Bearer " + getToken(),
},
}
},
@ -1144,7 +1254,22 @@ export default {
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 {
padding: 0 !important;
}
/deep/ .el-upload {
display: none;
}
</style>

@ -364,7 +364,7 @@
</el-form-item>
<el-form-item label="仓库" >
<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-form-item>
<el-form-item label="数量" >
@ -372,7 +372,7 @@
</el-form-item>
<el-form-item label="退库类型" prop="taskType">
<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-form-item>
<el-form-item label="申请原因" >

Loading…
Cancel
Save