parent
ebf08dd4f0
commit
dfb4009335
9 changed files with 918 additions and 603 deletions
@ -1,468 +1,516 @@ |
||||
<template> |
||||
<div> |
||||
<avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud" |
||||
@row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" |
||||
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
||||
@refresh-change="refreshChange" @on-load="onLoad"> |
||||
<template #menu-left> |
||||
<el-button type="primary" @click="handleAdd">新增 |
||||
</el-button> |
||||
</template> |
||||
<template #menu="{row}"> |
||||
<el-button type="text" @click="approvalRow(row)" v-if="row.approvalStatus == 0">审批</el-button> |
||||
</template> |
||||
<template #menu-right> |
||||
<el-button type="success" @click="handleImport">批量发送 |
||||
</el-button> |
||||
</template> |
||||
<div> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
v-model="form" |
||||
v-model:page="page" |
||||
ref="crud" |
||||
@row-del="rowDel" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@selection-change="selectionChange" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template #menu-left> |
||||
<el-button type="primary" @click="handleAdd">新增 </el-button> |
||||
<el-button type="primary" @click="handleImport">批量发送 </el-button> |
||||
</template> |
||||
<template #menu="{ row }"> |
||||
<el-button type="text" @click="approvalRow(row)" v-if="row.approvalStatus == 0" |
||||
>一级审批</el-button |
||||
> |
||||
<el-button type="text" @click="approvalSecondRow(row)" v-if="row.approvalStatus == 1" |
||||
>二级审批</el-button |
||||
> |
||||
<el-button type="text" @click="delRow(row)" v-if="row.approvalStatus == 0">删除</el-button> |
||||
</template> |
||||
<template #menu-right> </template> |
||||
</avue-crud> |
||||
|
||||
</avue-crud> |
||||
|
||||
<addEditDialog v-if="isOpen" :showDialog="isOpen" @closeDialog="closeDialog" :moldAddMore="moldAddMore" :buy-cycle="buyCycle"></addEditDialog> |
||||
<el-dialog width="30%" v-model="approveDialog" title="审批"> |
||||
<el-form :model="auditForm" :rules="auditRules" ref="auditForm"> |
||||
<el-form-item label="是否审核通过" prop="approvalResult"> |
||||
<el-radio v-model="auditForm.approvalResult" label="1">是</el-radio> |
||||
<el-radio v-model="auditForm.approvalResult" label="10">否</el-radio> |
||||
</el-form-item> |
||||
</el-form> |
||||
<template #footer> |
||||
<span class="dialog-footer"> |
||||
<el-button @click="approveDialog = false">取 消</el-button> |
||||
<el-button type="primary" @click="submit">确 定</el-button> |
||||
</span> |
||||
</template> |
||||
</el-dialog> |
||||
</div> |
||||
<addEditDialog |
||||
v-if="isOpen" |
||||
:showDialog="isOpen" |
||||
@closeDialog="closeDialog" |
||||
:moldAddMore="moldAddMore" |
||||
:buy-cycle="buyCycle" |
||||
></addEditDialog> |
||||
<el-dialog width="30%" v-model="approveDialog" title="审批"> |
||||
<el-form :model="auditForm" :rules="auditRules" ref="auditForm"> |
||||
<el-form-item label="是否审核通过:" prop="approvalResult"> |
||||
<el-radio-group v-model="auditForm.approvalResult" v-if="rowItem.approvalStatus == 0"> |
||||
<el-radio label="1">是</el-radio> |
||||
<el-radio label="2">否</el-radio> |
||||
</el-radio-group> |
||||
<el-radio-group v-model="auditForm.approvalResult" v-if="rowItem.approvalStatus == 1"> |
||||
<el-radio label="3">是</el-radio> |
||||
<el-radio label="4">否</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-form> |
||||
<template #footer> |
||||
<span class="dialog-footer"> |
||||
<el-button @click="approveDialog = false">取 消</el-button> |
||||
<el-button type="primary" @click="submit">确 定</el-button> |
||||
</span> |
||||
</template> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import addEditDialog from './addEditDialog.vue' |
||||
import {getList,batchSend,approve} from "@/api/storeManagement/additionalPlan" |
||||
import addEditDialog from './addEditDialog.vue'; |
||||
import { getList, batchSend, approve, del } from '@/api/storeManagement/additionalPlan'; |
||||
export default { |
||||
components: { |
||||
addEditDialog |
||||
components: { |
||||
addEditDialog, |
||||
}, |
||||
data() { |
||||
return { |
||||
formData: { |
||||
method: 'mes_request_stocks', |
||||
date: [], |
||||
}, |
||||
approveDialog: false, |
||||
query: {}, |
||||
loading: true, |
||||
selectionList: [], |
||||
auditForm: {}, |
||||
auditRules: { |
||||
approvalResult: [{ required: true, message: '请选择是否通过审核', trigger: 'blur' }], |
||||
}, |
||||
option: { |
||||
height: 'auto', |
||||
calcHeight: 32, |
||||
tip: false, |
||||
// size: 'medium', |
||||
simplePage: true, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
searchIcon: true, |
||||
searchIndex: 3, |
||||
tree: false, |
||||
border: true, |
||||
index: true, |
||||
selection: true, |
||||
viewBtn: false, |
||||
delBtn: false, |
||||
editBtn: false, |
||||
addBtn: false, |
||||
editBtnText: '修改', |
||||
addBtnIcon: ' ', |
||||
viewBtnIcon: ' ', |
||||
delBtnIcon: ' ', |
||||
editBtnIcon: ' ', |
||||
viewBtnText: '详情', |
||||
labelWidth: 120, |
||||
menuWidth: 140, |
||||
dialogWidth: 1040, |
||||
dialogClickModal: false, |
||||
searchEnter: true, |
||||
excelBtn: false, |
||||
filterBtn: true, |
||||
searchShowBtn: false, |
||||
columnSort: true, |
||||
excelBtn: true, |
||||
columnSort: true, |
||||
index: false, |
||||
showOverflowTooltip: true, |
||||
menu: true, |
||||
searchLabelPosition: 'left', |
||||
searchLabelWidth: 'auto', |
||||
searchGutter: 24, |
||||
searchSpan: 6, |
||||
menuAlign: 'center', |
||||
gridBtn: false, |
||||
searchMenuPosition: 'right', |
||||
align: 'center', |
||||
column: [ |
||||
{ |
||||
label: 'MES采购单号', |
||||
prop: 'boCode', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
searchLabelWidth: 100, |
||||
searchOrder: 20, |
||||
}, |
||||
{ |
||||
label: '物料编号', |
||||
prop: 'goodsCode', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 180, |
||||
searchOrder: 19, |
||||
}, |
||||
{ |
||||
label: '物料名称', |
||||
prop: 'goodsName', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '型号/牌号', |
||||
prop: 'mtltmrk', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '物料规格', |
||||
prop: 'specifications', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '采购数量', |
||||
prop: 'buyQty', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '单位', |
||||
prop: 'unitName', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '生产标识', |
||||
prop: 'grade', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '需求日期', |
||||
prop: 'needDate', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
format: 'YYYY-MM-DD', |
||||
valueFormat: 'YYYY-MM-DD', |
||||
searchOrder: 15, |
||||
type: 'date', |
||||
searchRange: true, |
||||
startPlaceholder: '开始时间', |
||||
endPlaceholder: '结束时间', |
||||
}, |
||||
{ |
||||
label: '备注', |
||||
prop: 'memo', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '采购部门', |
||||
prop: 'purchaseDeptName', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '需求部门', |
||||
prop: 'requireDeptName', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
searchOrder: 16, |
||||
}, |
||||
{ |
||||
label: '批料状态', |
||||
prop: 'batchStatus', |
||||
type: 'select', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
searchOrder: 17, |
||||
dicData: [ |
||||
{ label: '新建', value: '新建' }, |
||||
{ label: '未批料', value: '未批料' }, |
||||
{ label: '部分批料', value: '部分批料' }, |
||||
{ label: '全部批料', value: '全部批料' }, |
||||
{ label: '物资取消', value: '物资取消' }, |
||||
{ label: '车间取消', value: '车间取消' }, |
||||
{ label: '完工取消', value: '完工取消' }, |
||||
], |
||||
}, |
||||
{ |
||||
label: '领料状态', |
||||
prop: 'pickStatus', |
||||
type: 'select', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
searchOrder: 18, |
||||
dicData: [ |
||||
{ label: '新建', value: '新建' }, |
||||
{ label: '未领', value: '未领' }, |
||||
{ label: '领取部分', value: '领取部分' }, |
||||
{ label: '已领', value: '已领' }, |
||||
], |
||||
}, |
||||
{ |
||||
label: '申报人', |
||||
prop: 'declareManName', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
searchOrder: 15, |
||||
}, |
||||
{ |
||||
label: '采购员', |
||||
prop: 'buyManName', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '申报日期', |
||||
prop: 'declareDate', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
format: 'YYYY-MM-DD', |
||||
valueFormat: 'YYYY-MM-DD', |
||||
width: 140, |
||||
searchOrder: 14, |
||||
type: 'date', |
||||
searchRange: true, |
||||
startPlaceholder: '开始时间', |
||||
endPlaceholder: '结束时间', |
||||
}, |
||||
{ |
||||
label: '采购周期(天)', |
||||
prop: 'buyCycle', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
searchLabelWidth: 100, |
||||
}, |
||||
{ |
||||
label: '技术条件', |
||||
prop: 'skillCon', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '计划区域', |
||||
prop: 'planArea', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '当前状态', |
||||
prop: 'approvalStatus', |
||||
type: 'select', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
dicData: [ |
||||
{ label: '一级待审批', value: 0 }, |
||||
{ label: '一级审批通过', value: 1 }, |
||||
{ label: '一级审批驳回', value: 2 }, |
||||
{ label: '二级审批通过', value: 3 }, |
||||
{ label: '三级审批驳回', value: 4 }, |
||||
// { label: '审批驳回', value: 10 }, |
||||
], |
||||
}, |
||||
], |
||||
}, |
||||
form: {}, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
isOpen: false, |
||||
moldAddMore: false, |
||||
buyCycle: 0, |
||||
checkId: null, |
||||
rowItem: {}, |
||||
}; |
||||
}, |
||||
methods: { |
||||
// 新增 |
||||
handleAdd() { |
||||
this.isOpen = true; |
||||
this.moldAddMore = true; |
||||
}, |
||||
data() { |
||||
return { |
||||
formData: { |
||||
method: "mes_request_stocks", |
||||
date: [] |
||||
}, |
||||
approveDialog:false, |
||||
query:{}, |
||||
loading:true, |
||||
selectionList: [], |
||||
auditForm:{}, |
||||
auditRules:{ |
||||
approvalResult:[{ required: true, message: '请选择是否通过审核', trigger: 'blur' }] |
||||
}, |
||||
option: { |
||||
height: 'auto', |
||||
calcHeight: 32, |
||||
tip: false, |
||||
// size: 'medium', |
||||
simplePage: true, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
searchIcon: true, |
||||
searchIndex: 3, |
||||
tree: false, |
||||
border: true, |
||||
index: true, |
||||
selection: true, |
||||
viewBtn: false, |
||||
delBtn: false, |
||||
editBtn: false, |
||||
addBtn: false, |
||||
editBtnText: '修改', |
||||
addBtnIcon: ' ', |
||||
viewBtnIcon: ' ', |
||||
delBtnIcon: ' ', |
||||
editBtnIcon: ' ', |
||||
viewBtnText: '详情', |
||||
labelWidth: 120, |
||||
menuWidth: 100, |
||||
dialogWidth: 1040, |
||||
dialogClickModal: false, |
||||
searchEnter: true, |
||||
excelBtn: false, |
||||
filterBtn: true, |
||||
searchShowBtn: false, |
||||
columnSort: true, |
||||
excelBtn: true, |
||||
columnSort: true, |
||||
index: false, |
||||
showOverflowTooltip: true, |
||||
menu: true, |
||||
searchLabelPosition: 'left', |
||||
searchLabelWidth: 'auto', |
||||
searchGutter: 24, |
||||
searchSpan: 6, |
||||
menuAlign: 'center', |
||||
gridBtn: false, |
||||
searchMenuPosition: 'right', |
||||
align: 'center', |
||||
column: [ |
||||
{ |
||||
label: 'MES采购单号', |
||||
prop: 'boCode', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
searchLabelWidth: 100, |
||||
searchOrder: 20, |
||||
}, |
||||
{ |
||||
label: '物料编号', |
||||
prop: 'goodsCode', |
||||
// bind: 'coGoods.goodsCode', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 180, |
||||
searchOrder: 19, |
||||
}, |
||||
{ |
||||
label: '物料名称', |
||||
prop: 'goodsName', |
||||
// bind: 'coGoods.goodsName', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '型号/牌号', |
||||
prop: 'mtltmrk', |
||||
// bind: 'coGoods.mtltmrk', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '物料规格', |
||||
prop: 'specifications', |
||||
// bind: 'coGoods.specifications', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '采购数量', |
||||
prop: 'buyQty', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '单位', |
||||
prop: 'unitName', |
||||
// bind: 'coGoods.unitName', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '生产标识', |
||||
prop: 'grade', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '需求日期', |
||||
prop: 'needDate', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
format:"YYYY-MM-DD", |
||||
valueFormat:"YYYY-MM-DD", |
||||
searchOrder: 15, |
||||
type: 'date', |
||||
searchRange: true, |
||||
startPlaceholder: '开始时间', |
||||
endPlaceholder: '结束时间' |
||||
}, |
||||
{ |
||||
label: '备注', |
||||
prop: 'memo', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '采购部门', |
||||
prop: 'purchaseDeptName', |
||||
// bind: 'buyDept.deptName', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '需求部门', |
||||
prop: 'requireDeptName', |
||||
// bind: 'needDept.deptName', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
searchOrder: 16, |
||||
}, |
||||
{ |
||||
label: '批料状态', |
||||
prop: 'batchStatus', |
||||
type:"select", |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
searchOrder: 17, |
||||
dicData:[ |
||||
{label:'新建',value:'新建'}, |
||||
{label:'未批料',value:'未批料'}, |
||||
{label:'部分批料',value:'部分批料'}, |
||||
{label:'全部批料',value:'全部批料'}, |
||||
{label:'物资取消',value:'物资取消'}, |
||||
{label:'车间取消',value:'车间取消'}, |
||||
{label:'完工取消',value:'完工取消'}, |
||||
] |
||||
}, |
||||
{ |
||||
label: '领料状态', |
||||
prop: 'pickStatus', |
||||
type:"select", |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
searchOrder: 18, |
||||
dicData:[ |
||||
{label:'新建',value:'新建'}, |
||||
{label:'未领',value:'未领'}, |
||||
{label:'领取部分',value:'领取部分'}, |
||||
{label:'已领',value:'已领'}, |
||||
] |
||||
}, |
||||
{ |
||||
label: '申报人', |
||||
prop: 'declareManName', |
||||
// bind: 'declareMan.userName', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
searchOrder: 15, |
||||
}, |
||||
{ |
||||
label: '采购员', |
||||
prop: 'buyManName', |
||||
// bind: 'buyMan.userName', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '申报日期', |
||||
prop: 'declareDate', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
format:"YYYY-MM-DD", |
||||
valueFormat:"YYYY-MM-DD", |
||||
width: 140, |
||||
searchOrder: 14, |
||||
type: 'date', |
||||
searchRange: true, |
||||
startPlaceholder: '开始时间', |
||||
endPlaceholder: '结束时间' |
||||
}, |
||||
{ |
||||
label: '采购周期(天)', |
||||
prop: 'buyCycle', |
||||
search: true, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
searchLabelWidth: 100, |
||||
}, |
||||
{ |
||||
label: '技术条件', |
||||
prop: 'skillCon', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '计划区域', |
||||
prop: 'planArea', |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
}, |
||||
{ |
||||
label: '当前状态', |
||||
prop: 'approvalStatus', |
||||
type:"select", |
||||
search: false, |
||||
sortable: true, |
||||
filter: true, |
||||
span: 12, |
||||
width: 140, |
||||
dicData:[ |
||||
{label:"审批中",value:0,}, |
||||
{label:"审批通过",value:1,}, |
||||
{label:"审批驳回",value:10,}, |
||||
] |
||||
}, |
||||
] |
||||
}, |
||||
form: { |
||||
|
||||
}, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
isOpen:false, |
||||
moldAddMore:false, |
||||
buyCycle: 0, |
||||
checkId:null, |
||||
} |
||||
closeDialog(val) { |
||||
this.isOpen = false; |
||||
if (val) { |
||||
this.onLoad(); |
||||
} |
||||
}, |
||||
methods: { |
||||
// 新增 |
||||
handleAdd() { |
||||
this.isOpen = true |
||||
this.moldAddMore = true |
||||
}, |
||||
closeDialog(val){ |
||||
this.isOpen = false |
||||
if(val){ |
||||
this.onLoad() |
||||
} |
||||
}, |
||||
approvalRow(row){ |
||||
this.checkId = row.id |
||||
this.auditForm = {} |
||||
this.approveDialog = true |
||||
}, |
||||
submit(){ |
||||
this.$refs.auditForm.validate(valid => { |
||||
if(valid){ |
||||
approve({id:this.checkId,...this.auditForm}).then(res =>{ |
||||
if(res.data.code == 200){ |
||||
this.$message.success('审批成功') |
||||
this.approveDialog = false |
||||
this.onLoad() |
||||
} |
||||
}) |
||||
} |
||||
}) |
||||
}, |
||||
handleImport(){ |
||||
if(this.selectionList.length === 0){ |
||||
this.$message.error('请至少选择一条数据') |
||||
return |
||||
} |
||||
let tmp = this.selectionList.find(item => item.approvalStatus != 1) |
||||
if(tmp){ |
||||
this.$message.error("请选择状态为【审批通过】的数据") |
||||
return |
||||
} |
||||
|
||||
this.$confirm("确定对选择数据进行批量发送?", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
}).then(() => { |
||||
batchSend(this.selectionList).then(res =>{ |
||||
if(res.data.code == 200){ |
||||
this.$message.success('发送成功') |
||||
this.onLoad() |
||||
} |
||||
}) |
||||
}) |
||||
|
||||
|
||||
|
||||
}, |
||||
// 多选 |
||||
selectionChange(list) { |
||||
this.selectionList = list; |
||||
}, |
||||
searchChange(params, done){ |
||||
this.query = params; |
||||
this.page.currentPage = 1 |
||||
this.onLoad(this.page, params) |
||||
done() |
||||
}, |
||||
searchReset(){ |
||||
this.query = {} |
||||
this.onLoad() |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
onLoad() { |
||||
this.loading = true |
||||
let params = { |
||||
...this.query, |
||||
startNeedDate:this.query.needDate && this.query.needDate.length != 0 && this.query.needDate[0], |
||||
endNeedDate:this.query.needDate && this.query.needDate.length != 0 && this.query.needDate[1], |
||||
startDeclareDate:this.query.declareDate && this.query.declareDate.length != 0 && this.query.declareDate[0], |
||||
endDeclareDate:this.query.declareDate && this.query.declareDate.length != 0 && this.query.declareDate[1], |
||||
delRow(row) { |
||||
if (row.approvalStatus != 0) { |
||||
this.$message.warning('请选择一级待审批数据'); |
||||
return; |
||||
} |
||||
this.$confirm('确定对选择数据进行删除处理?', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
}).then(() => { |
||||
del({ ids: row.id }).then(res => { |
||||
this.$message.success('删除成功!'); |
||||
this.onLoad(this.page); |
||||
}); |
||||
}); |
||||
}, |
||||
// 一级审批 |
||||
approvalRow(row) { |
||||
this.rowItem = row; |
||||
this.checkId = row.id; |
||||
this.auditForm = {}; |
||||
this.approveDialog = true; |
||||
}, |
||||
// 二级审批 |
||||
approvalSecondRow(row) { |
||||
this.rowItem = row; |
||||
this.checkId = row.id; |
||||
this.auditForm = {}; |
||||
this.approveDialog = true; |
||||
}, |
||||
submit() { |
||||
this.$refs.auditForm.validate(valid => { |
||||
if (valid) { |
||||
approve({ id: this.checkId, ...this.auditForm }).then(res => { |
||||
if (res.data.code == 200) { |
||||
this.$message.success('审批成功'); |
||||
this.approveDialog = false; |
||||
this.onLoad(); |
||||
} |
||||
// let {needDate,declareDate,...searchParams} = params |
||||
if(params.declareDate) delete params.declareDate |
||||
if(params.needDate) delete params.needDate |
||||
console.log('params',params) |
||||
getList({ |
||||
current:this.page.currentPage, |
||||
size:this.page.pageSize, |
||||
...params |
||||
}).then(res =>{ |
||||
this.data = res.data.data.records |
||||
this.page.total = res.data.data.total |
||||
this.loading = false |
||||
}) |
||||
}); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
handleImport() { |
||||
if (this.selectionList.length === 0) { |
||||
this.$message.error('请至少选择一条数据'); |
||||
return; |
||||
} |
||||
let tmp = this.selectionList.find(item => item.approvalStatus != 3); |
||||
if (tmp) { |
||||
this.$message.error('请选择状态为【二级审批通过】的数据'); |
||||
return; |
||||
} |
||||
|
||||
this.$confirm('确定对选择数据进行批量发送?', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
}).then(() => { |
||||
batchSend(this.selectionList).then(res => { |
||||
this.loading = true; |
||||
if (res.data.code == 200) { |
||||
this.$message.success('发送成功'); |
||||
this.onLoad(); |
||||
} |
||||
}).catch(() => { |
||||
this.loading = false; |
||||
}); |
||||
}); |
||||
}, |
||||
// 多选 |
||||
selectionChange(list) { |
||||
this.selectionList = list; |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(); |
||||
}, |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
onLoad() { |
||||
this.loading = true; |
||||
let params = { |
||||
...this.query, |
||||
startNeedDate: |
||||
this.query.needDate && this.query.needDate.length != 0 && this.query.needDate[0], |
||||
endNeedDate: |
||||
this.query.needDate && this.query.needDate.length != 0 && this.query.needDate[1], |
||||
startDeclareDate: |
||||
this.query.declareDate && this.query.declareDate.length != 0 && this.query.declareDate[0], |
||||
endDeclareDate: |
||||
this.query.declareDate && this.query.declareDate.length != 0 && this.query.declareDate[1], |
||||
}; |
||||
// let {needDate,declareDate,...searchParams} = params |
||||
if (params.declareDate) delete params.declareDate; |
||||
if (params.needDate) delete params.needDate; |
||||
console.log('params', params); |
||||
getList({ |
||||
current: this.page.currentPage, |
||||
size: this.page.pageSize, |
||||
...params, |
||||
}).then(res => { |
||||
this.data = res.data.data.records; |
||||
this.page.total = res.data.data.total; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped></style> |
||||
@ -0,0 +1,263 @@ |
||||
<template> |
||||
<el-dialog :title="title" append-to-body :modelValue="openShow" width="60%" @close="closeDialog"> |
||||
<avue-form ref="form" v-model="form" :option="option"></avue-form> |
||||
|
||||
<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 { submitGoods } from '@/api/storeManagement/materialMaintenance'; |
||||
export default { |
||||
props: { |
||||
showDialog: { |
||||
type: Boolean, |
||||
default: false, |
||||
}, |
||||
rowItem: { |
||||
type: Object, |
||||
default: {}, |
||||
}, |
||||
title: { |
||||
type: String, |
||||
default: '新增', |
||||
}, |
||||
}, |
||||
data() { |
||||
return { |
||||
openShow: false, |
||||
showLoading: false, |
||||
form: {}, |
||||
option: { |
||||
submitBtn: false, |
||||
emptyBtn: false, |
||||
column: [ |
||||
{ |
||||
label: '物料编码', |
||||
prop: 'goodsCode', |
||||
span: 12, |
||||
disabled: true, |
||||
overflow: true, |
||||
search: true, |
||||
width: 120, |
||||
}, |
||||
{ |
||||
label: '物料名称', |
||||
prop: 'goodsName', |
||||
disabled: true, |
||||
span: 12, |
||||
overflow: true, |
||||
search: true, |
||||
width: 120, |
||||
}, |
||||
{ |
||||
label: '计量单位', |
||||
prop: 'unitName', |
||||
span: 12, |
||||
overflow: true, |
||||
search: false, |
||||
width: 120, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: '请输入计量单位', |
||||
trigger: 'blur', |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
{ |
||||
label: '物料类别', |
||||
prop: 'gcId', |
||||
span: 12, |
||||
type: 'select', |
||||
overflow: true, |
||||
search: false, |
||||
width: 120, |
||||
rules: [ |
||||
{ |
||||
required: false, |
||||
message: '请输入物料类别', |
||||
trigger: 'blur', |
||||
}, |
||||
], |
||||
dicUrl: '/api/blade-wms/stGoodsClass/findGoodsClass', |
||||
props: { |
||||
label: 'gcName', |
||||
value: 'id', |
||||
}, |
||||
}, |
||||
{ |
||||
label: '是否工艺审批', |
||||
prop: 'processApproval', |
||||
type: 'select', |
||||
dicData: [ |
||||
{ label: '是', value: true }, |
||||
{ label: '否', value: false }, |
||||
], |
||||
span: 12, |
||||
overflow: true, |
||||
search: false, |
||||
width: 120, |
||||
}, |
||||
{ |
||||
label: '补制类型', |
||||
prop: 'reissueType', |
||||
type: 'select', |
||||
dicData: [ |
||||
{ label: '无', value: 0 }, |
||||
{ label: '物料出库', value: 1 }, |
||||
{ label: '最低库存', value: 2 }, |
||||
], |
||||
span: 12, |
||||
overflow: true, |
||||
search: false, |
||||
width: 120, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: '请选择补制类型', |
||||
trigger: 'blur', |
||||
}, |
||||
], |
||||
change: val => { |
||||
if (val.value != 0) { |
||||
let tmp = this.option.column.find(item => item.prop == 'gcId'); |
||||
tmp.rules[0].required = true; |
||||
if (val.value == 2) { |
||||
let tmp = this.option.column.find(item => item.prop == 'minNum'); |
||||
tmp.rules[0].required = true; |
||||
} else { |
||||
let tmp = this.option.column.find(item => item.prop == 'minNum'); |
||||
tmp.rules[0].required = false; |
||||
} |
||||
} else { |
||||
let tmp = this.option.column.find(item => item.prop == 'gcId'); |
||||
tmp.rules[0].required = false; |
||||
let tmp1 = this.option.column.find(item => item.prop == 'minNum'); |
||||
tmp1.rules[0].required = false; |
||||
} |
||||
}, |
||||
}, |
||||
|
||||
{ |
||||
label: '最高库存', |
||||
prop: 'maxNum', |
||||
span: 12, |
||||
overflow: true, |
||||
search: false, |
||||
width: 120, |
||||
}, |
||||
{ |
||||
label: '最低库存', |
||||
prop: 'minNum', |
||||
span: 12, |
||||
overflow: true, |
||||
search: false, |
||||
width: 120, |
||||
rules: [ |
||||
{ |
||||
required: false, |
||||
message: '请输入最低库存', |
||||
trigger: 'blur', |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
{ |
||||
label: '采购数量', |
||||
prop: 'purchaseQuantity', |
||||
span: 12, |
||||
overflow: true, |
||||
search: false, |
||||
width: 120, |
||||
}, |
||||
{ |
||||
label: '是否停用', |
||||
editDisplay: true, |
||||
prop: 'used', |
||||
type: 'switch', |
||||
dicData: [ |
||||
{ label: '关', value: false }, |
||||
{ label: '开', value: true }, |
||||
], |
||||
span: 12, |
||||
overflow: true, |
||||
search: false, |
||||
width: 120, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: '请输入是否停用', |
||||
trigger: 'blur', |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: '组件模式', |
||||
prop: 'prtType', |
||||
span: 12, |
||||
overflow: true, |
||||
search: false, |
||||
hide: true, |
||||
width: 120, |
||||
}, |
||||
{ |
||||
label: '最低库存预警', |
||||
prop: 'minWarning', |
||||
type: 'switch', |
||||
dicData: [ |
||||
{ label: '关', value: false }, |
||||
{ label: '开', value: true }, |
||||
], |
||||
span: 12, |
||||
overflow: true, |
||||
search: false, |
||||
labelWidth: 120, |
||||
rules: [ |
||||
{ |
||||
required: true, |
||||
message: '请选择是否开启最低库存预警', |
||||
trigger: 'blur', |
||||
}, |
||||
], |
||||
}, |
||||
], |
||||
}, |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this.openShow = this.showDialog; |
||||
this.form = this.rowItem; |
||||
this.form.minWarning = this.form.minWarning ? true : false; |
||||
}, |
||||
methods: { |
||||
closeDialog() { |
||||
this.openShow = false; |
||||
this.$emit('closeDialog'); |
||||
}, |
||||
submit() { |
||||
this.$refs.form.validate(async valid => { |
||||
if (valid) { |
||||
this.showLoading = true; |
||||
this.form.minWarning = this.form.minWarning ? 1 : 0; |
||||
submitGoods(this.form) |
||||
.then(res => { |
||||
this.showLoading = false; |
||||
this.$message.success('新增成功'); |
||||
this.closeDialog(); |
||||
}) |
||||
.catch(err => { |
||||
this.showLoading = false; |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped></style> |
||||
Loading…
Reference in new issue