You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
219 lines
7.1 KiB
219 lines
7.1 KiB
<template> |
|
<el-dialog |
|
title="需求申报" |
|
append-to-body |
|
:modelValue="showDialog" |
|
width="80%" |
|
@close="closeDialog" |
|
@open="open" |
|
fullscreen |
|
> |
|
<el-form :inline="true" v-model="submitForm"> |
|
<el-form-item label="银钾系数" prop="coefficient" v-if="searchForm.materalType == 2"> |
|
<el-input placeholder="请输入银钾系数" v-model="submitForm.coefficient"></el-input> |
|
</el-form-item> |
|
<el-form-item :label="labelValue + '需求量'" prop="" v-if="searchForm.materalType == 1"> |
|
<el-input placeholder="请输入需求量" v-model="submitForm.goodsQuantity"></el-input> |
|
</el-form-item> |
|
<el-form-item label="银钾需求量" prop="saveBoardVal" v-if="searchForm.materalType == 2"> |
|
<el-input placeholder="请输入银钾需求量" v-model="submitForm.saveBoardVal"></el-input> |
|
</el-form-item> |
|
<!-- <el-form-item> |
|
<el-button type="primary" @click="onSubmit">提 交</el-button> |
|
</el-form-item> --> |
|
</el-form> |
|
<el-tag type="primary" style="width: 100%; display: block; line-height: 22px" |
|
>选择{{selectionList.length}}个订单 合计:物料需求量:{{this.totalNum}}克</el-tag |
|
> |
|
<div style="border: 1px solid #ccc; padding: 20px 0px"> |
|
<div> |
|
<el-form :inline="true" v-model="searchForm" label-width="90px"> |
|
<el-form-item label="作业中心" prop="wcId"> |
|
<el-select style="width: 182px" v-model="searchForm.wcId" placeholder="请选择作业中心"> |
|
<el-option v-for="item in workList" :key="item.id" :label="item.wcName" :value="item.id"></el-option> |
|
<!-- <el-option label="作业中心二" value="2"></el-option> --> |
|
</el-select> |
|
</el-form-item> |
|
<el-form-item label="物料类型" prop="materalType"> |
|
<el-radio-group v-model="searchForm.materalType" @input="changeType"> |
|
<el-radio :label="1">金钾</el-radio> |
|
<el-radio :label="2">银钾</el-radio> |
|
</el-radio-group> |
|
</el-form-item> |
|
<el-form-item> |
|
<el-checkbox v-model="searchForm.overHalfMon">允许使用半月以上的数据</el-checkbox> |
|
</el-form-item> |
|
<el-form-item> |
|
<el-button type="primary" @click="onSearch" :loading="loading">查 询</el-button> |
|
</el-form-item> |
|
</el-form> |
|
|
|
<el-table :data="tableData" @selection-change="handleSelectionChange" ref="multipleTable" :loading="loading"> |
|
<el-table-column type="selection"></el-table-column> |
|
<el-table-column |
|
label="计划单号" |
|
prop="ypCode" |
|
align="center" |
|
></el-table-column> |
|
<el-table-column label="生产订单号" prop="yoCode" align="center"></el-table-column> |
|
<el-table-column |
|
label="零件号" |
|
prop="partCode" |
|
align="center" |
|
></el-table-column> |
|
<el-table-column |
|
label="零件名称" |
|
prop="partName" |
|
align="center" |
|
></el-table-column> |
|
<el-table-column label="物料编码" prop="plateGoodsCode" align="center"></el-table-column> |
|
<el-table-column |
|
label="生产标识" |
|
prop="productIdent" |
|
align="center" |
|
></el-table-column> |
|
<el-table-column |
|
label="生产数量" |
|
prop="ypQty" |
|
align="center" |
|
></el-table-column> |
|
<el-table-column |
|
label="物料需求量(克)" |
|
prop="plateSingleQuotaTotal" |
|
align="center" |
|
></el-table-column> |
|
<el-table-column label="计划下达时间" prop="releaseDate" align="center"></el-table-column> |
|
|
|
<!-- <el-table-column label="计划生产时间" prop="createTime" align="center"></el-table-column> --> |
|
</el-table> |
|
<div |
|
v-show="totalNum" |
|
style=" |
|
display: flex; |
|
justify-content: flex-end; |
|
align-items: center; |
|
margin: 20px 20px 0 0; |
|
" |
|
> |
|
合计:{{ totalNum }} |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<template #footer> |
|
<span class="dialog-footer"> |
|
<el-button @click="closeDialog">取 消</el-button> |
|
<el-button type="primary" @click="submit">确 定</el-button> |
|
</span> |
|
</template> |
|
</el-dialog> |
|
</template> |
|
|
|
<script> |
|
import { getListlistNoFinished,getAddRequireList,getWorkCenter,add } from '@/api/productionManagement/coatingMaterial'; |
|
export default { |
|
props: { |
|
showDialog: { |
|
type: Boolean, |
|
default: false, |
|
}, |
|
}, |
|
data() { |
|
return { |
|
loading: false, |
|
submitForm: {}, |
|
searchForm: { |
|
materalType: 1, |
|
}, |
|
labelValue: '金钾', |
|
tableData: [], |
|
totalNum: null, |
|
selectionList: [], |
|
workList:[] |
|
}; |
|
}, |
|
mounted() { |
|
this.getWorkCenterList() |
|
}, |
|
methods: { |
|
getWorkCenterList() { |
|
getWorkCenter().then((res) => { |
|
this.workList = res.data.data |
|
}) |
|
}, |
|
// 切换金钾/银钾类型 |
|
changeType(val) { |
|
console.log('val-------------'); |
|
if (val.target.value == 1) { |
|
this.labelValue = '金钾'; |
|
} else { |
|
this.labelValue = '银钾'; |
|
} |
|
}, |
|
// 点击查询按钮 |
|
async onSearch() { |
|
this.loading = true; |
|
try { |
|
// const params = { ...this.submitForm, ...this.query }; |
|
console.log('params', this.searchForm); |
|
let params = { |
|
...this.searchForm, |
|
overHalfMon:this.searchForm.overHalfMon ? 1 : 0, |
|
current:1, |
|
size:99999 |
|
} |
|
const res = await getAddRequireList( params); |
|
this.tableData = res.data.data.records; |
|
// if (res && res.code === 200) { |
|
// this.data = res.data?.data?.records || []; |
|
// this.$refs?.multipleTable?.clearSelection(); |
|
// } else { |
|
// console.warn('查询失败:', '未知错误'); |
|
// } |
|
} finally { |
|
this.loading = false; |
|
} |
|
}, |
|
// 多选 |
|
handleSelectionChange(val) { |
|
this.selectionList = val; |
|
console.log('lisy-------------', this.selectionList); |
|
var strarr = []; |
|
for (let i in this.selectionList) { |
|
strarr.push(Number(this.selectionList[i]['plateSingleQuotaTotal'])); |
|
} |
|
var total = eval(strarr.join('+')); |
|
this.totalNum = total ? total : 0; |
|
console.log('total-----------',total) |
|
this.submitForm.goodsQuantity = total ? total : 0; |
|
}, |
|
closeDialog(val) { |
|
this.$emit('closeDialog',val); |
|
}, |
|
submit() { |
|
// this.submitForm |
|
//this.selectionList |
|
// const form = { |
|
// data: this.submitForm, |
|
// list: this.selectionList, |
|
// }; |
|
// console.log(form); |
|
let params = { |
|
assayContent:{}, |
|
detailList:this.selectionList.map(item =>{ |
|
return {yoId :item.id} |
|
}) |
|
} |
|
console.log('params------------',params) |
|
add(params).then(res =>{ |
|
if(res.data.code == 200){ |
|
this.$message.success('新增成功') |
|
this.closeDialog(true) |
|
} |
|
}) |
|
}, |
|
}, |
|
}; |
|
</script> |
|
|
|
<style></style>
|
|
|