中航光电热表web
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.

657 lines
25 KiB

8 months ago
<template>
<basic-container>
<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"
@row-update="rowUpdate"
:before-open="beforeOpen"
8 months ago
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad">
<template #deptName="{ row }">{{ row.dept && row.dept.deptName }}</template>
<template #materialGoods="{ row }">{{ row.materialGoods.goodsCode }}</template>
<template #menu-left>
<div style="display: flex;">
7 months ago
<el-input v-model="goodsCode"></el-input>
<el-button type="primary" style="margin-left: 10px;">新增</el-button>
8 months ago
</div>
</template>
</avue-crud>
</basic-container>
</template>
<script>
import {getGoodsList,addGoods,editGoods} from "@/api/storeManagement/materialMaintenance"
import { edit } from '@/api/orderManagement/exceptionOrder';
8 months ago
export default {
data() {
return {
7 months ago
goodsCode: '',
8 months ago
option: {
columnSort: true,
tip: false,
height: 'auto',
align: 'center',
calcHeight: 32,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: false,
selection: true,
viewBtn: false,
delBtn: false,
editBtn: true,
addBtnIcon: ' ',
7 months ago
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
editBtnText: '修改',
8 months ago
addBtn: false,
labelWidth: 120,
searchLabelWidth: 120,
menu: true,
menuWidth: 200,
dialogWidth: 600,
dialogClickModal: false,
searchEnter: true,
excelBtn: true,
gridBtn: false,
searchShowBtn: false,
showOverflowTooltip: true,
7 months ago
searchLabelPosition: 'left',
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
gridBtn: false,
searchMenuPosition: 'right',
8 months ago
column: [
{
label: '物料编码',
prop: 'goodsCode',
span: 24,
7 months ago
editDisabled: true,
8 months ago
overflow: true,
search: true,
width: 200,
// rules: [
// {
// required: true,
// message: '请输入物料编码',
// trigger: 'blur',
// },
// ],
},
{
label: '物料名称',
prop: 'goodsName',
7 months ago
editDisabled: true,
8 months ago
span: 24,
overflow: true,
search: true,
width: 200,
// rules: [
// {
// required: true,
// message: '请输入物料名称',
// trigger: 'blur',
// },
// ],
},
{
label: '采购部门',
prop: 'deptName',
span: 24,
7 months ago
editDisplay: false,
8 months ago
overflow: true,
search: false,
width: 200,
rules: [
{
required: true,
message: '请输入采购部门',
trigger: 'blur',
},
],
},
{
7 months ago
label: '型号/牌号',
8 months ago
prop: 'specifications',
span: 24,
overflow: true,
7 months ago
editDisplay: false,
8 months ago
search: true,
width: 200,
rules: [
{
required: true,
7 months ago
message: '请输入型号/牌号',
8 months ago
trigger: 'blur',
},
],
},
{
label: '计量单位',
prop: 'unitName',
span: 24,
7 months ago
editDisplay: false,
8 months ago
overflow: true,
search: false,
width: 200,
rules: [
{
required: true,
message: '请输入计量单位',
trigger: 'blur',
},
],
},
{
label: '物料类别',
prop: 'coGoodsClass',
span: 24,
7 months ago
editDisplay: false,
8 months ago
overflow: true,
search: false,
width: 200,
rules: [
{
required: true,
message: '请输入物料类别',
trigger: 'blur',
},
],
},
{
label: '是否工艺审批',
prop: 'processApproval',
7 months ago
type: 'select',
dicData: [
{ label: '是', value: '1' },
{ label: '否', value: '0' },
8 months ago
],
span: 24,
overflow: true,
search: false,
width: 200,
// rules: [
// {
// required: true,
// message: '请输入是否工艺审批',
// trigger: 'blur',
// },
// ],
},
{
label: '等级',
prop: 'grade',
7 months ago
editDisplay: false,
8 months ago
span: 24,
overflow: true,
search: false,
width: 200,
rules: [
{
required: true,
message: '请输入等级',
trigger: 'blur',
},
],
},
{
label: '最高库存',
prop: 'maxNum',
span: 24,
overflow: true,
search: false,
width: 200,
// rules: [
// {
// required: true,
// message: '请输入最高库存',
// trigger: 'blur',
// },
// ],
},
{
label: '最低库存',
prop: 'minNum',
span: 24,
overflow: true,
search: false,
width: 200,
// rules: [
// {
// required: true,
// message: '请输入最低库存',
// trigger: 'blur',
// },
// ],
},
6 months ago
8 months ago
{
label: '采购数量',
prop: 'purchaseQuantity',
span: 24,
overflow: true,
search: false,
width: 200,
// rules: [
// {
// required: true,
// message: '请输入采购数量',
// trigger: 'blur',
// },
// ],
},
{
label: '是否停用',
editDisplay: true,
8 months ago
prop: 'used',
type: 'switch',
dicData: [
{ label: '关', value: false },
{ label: '开', value: true }
],
span: 24,
overflow: true,
search: false,
width: 200,
rules: [
{
required: true,
message: '请输入是否停用',
trigger: 'blur',
},
],
},
6 months ago
// {
// label: '周期/天',
// prop: 'cycle',
// span: 24,
// overflow: true,
// search: false,
// width: 200,
// // rules: [
// // {
// // required: true,
// // message: '请输入周期/天',
// // trigger: 'blur',
// // },
// // ],
// },
8 months ago
{
label: '版本',
prop: 'releaseno',
span: 24,
overflow: true,
7 months ago
editDisplay: false,
8 months ago
search: false,
width: 200,
rules: [
{
required: true,
message: '请输入版本',
trigger: 'blur',
},
],
},
{
label: '属性',
prop: 'cplb',
span: 24,
overflow: true,
7 months ago
editDisplay: false,
8 months ago
search: false,
width: 200,
rules: [
{
required: true,
message: '请输入属性',
trigger: 'blur',
},
],
},
{
label: '当前库存',
prop: 'curQuantity',
7 months ago
editDisplay: false,
8 months ago
span: 24,
overflow: true,
search: false,
width: 200,
rules: [
{
required: true,
message: '请输入当前库存',
trigger: 'blur',
},
],
},
{
7 months ago
editDisplay: false,
8 months ago
label: '在途',
prop: 'onthewayQuantity',
span: 24,
overflow: true,
search: false,
width: 200,
rules: [
{
required: true,
message: '请输入在途',
trigger: 'blur',
},
],
},
{
label: '锁料',
prop: 'lockQuantity',
span: 24,
overflow: true,
7 months ago
editDisplay: false,
8 months ago
search: false,
width: 200,
rules: [
{
required: true,
message: '请输入锁料',
trigger: 'blur',
},
],
},
{
label: '组件模式',
prop: 'prtType',
span: 24,
overflow: true,
search: false,
7 months ago
hide: true,
8 months ago
width: 200,
// rules: [
// {
// required: true,
// message: '请输入组件模式',
// trigger: 'blur',
// },
// ],
},
6 months ago
{
label: '最低库存预警',
prop: 'minWarning',
6 months ago
type: 'switch',
dicData: [
{ label: '关', value: false },
{ label: '开', value: true }
],
span: 24,
overflow: true,
search: false,
width: 200,
rules: [
{
required: true,
message: '请选择是否开启最低库存预警',
trigger: 'blur',
},
],
},
8 months ago
]
},
loading: false,
data: [],
form: {},
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
query:{}
8 months ago
}
},
mounted() {
},
methods: {
searchChange(params, done){
this.query = params;
this.page.currentPage = 1;
this.onLoad()
done();
},
searchReset(){
this.query = {}
this.onLoad()
},
beforeOpen(done, type){
console.log('form-----------------',this.form)
this.form.minWarning = this.form.minWarning != '' ? this.form.minWarning : false
done()
},
rowUpdate(row, index, done, loading){
console.log('row----------------',row)
row.minWarning = row.minWarning ? 1 : 0
editGoods(row).then(res =>{
if(res.data.code == 200){
this.$message.success('修改成功')
this.onLoad()
done()
8 months ago
}
})
},
onLoad() {
getGoodsList({
current:this.page.currentPage,
size:this.page.pageSize,
...this.query
}).then(res =>{
res.data.data.records.forEach(item =>{
item.minWarning = item.minWarning == 1 ? true : false
})
this.data = res.data.data.records
this.page.total = res.data.data.total;
})
// this.data = [
// {
// "allGoodsQuantity": null,
// "batch": null,
// "bomQuantity": null,
// "buyQuantity": null,
// "cavityno": null,
// "checkoutCode": "3333",
// "coGoodsClass": null,
// "coStorageLocation": null,
// "cplb": null,
// "createTime": "2023-07-15 16:18:30",
// "curQuantity": 684.0,
// "cycle": null,
// "deleted": false,
// "deliveryDate": null,
// "dept": null,
// "drawingNo": null,
// "ecnno": null,
// "enditem": 0,
// "erpQuantity": null,
// "goodsCode": "21E543-6108-B1-N",
// "goodsCodeAndGoodsName": "null——21E543-6108-B1-N——石墨模",
// "goodsId": 167,
// "goodsName": "石墨模",
// "grade": null,
// "houseQuantity": null,
// "lockQuantity": 0.0,
// "madeIn": null,
// "matbigclassify": null,
// "matsmallclassify": null,
// "maxNum": 300.0,
// "memo": null,
// "minNum": 50.0,
// "minStockWarning": true,
// "mtlsgrt": 0.0,
// "mtltmrk": "232",
// "mustCheck": null,
// "newGoodsName": null,
// "newSpecifications": null,
// "numAcc": null,
// "onthewayQuantity": 0.0,
// "partLink": null,
// "piNo": null,
// "price": null,
// "priority": null,
// "prtType": "零件",
// "prtrevedit": null,
// "prtstd": null,
// "prtwt": 0.0,
// "purchaseQuantity": 100.0,
// "releaseno": null,
// "releasenoTime": "2023-03-23 00:00:00",
// "remark": null,
// "rlsId": null,
// "singlePieceQuota": null,
// "source": null,
// "special": null,
// "specifications": null,
// "syQuantity": null,
// "trademark": null,
// "unitName": "每个",
// "updateTime": "2023-07-15 16:18:30",
// "used": true
// },
// {
// "allGoodsQuantity": null,
// "batch": null,
// "bomQuantity": null,
// "buyQuantity": null,
// "cavityno": null,
// "checkoutCode": "1111",
// "coGoodsClass": null,
// "coStorageLocation": null,
// "cplb": null,
// "createTime": "2023-07-15 16:18:30",
// "curQuantity": 1950.0,
// "cycle": null,
// "deleted": false,
// "deliveryDate": null,
// "dept": null,
// "drawingNo": null,
// "ecnno": null,
// "enditem": 0,
// "erpQuantity": null,
// "goodsCode": "04-05-025",
// "goodsCodeAndGoodsName": "null——04-05-025——锡铂金",
// "goodsId": 169,
// "goodsName": "锡铂金",
// "grade": null,
// "houseQuantity": null,
// "lockQuantity": 0.0,
// "madeIn": null,
// "matbigclassify": null,
// "matsmallclassify": null,
// "maxNum": 300.0,
// "memo": null,
// "minNum": 50.0,
// "minStockWarning": true,
// "mtlsgrt": null,
// "mtltmrk": "23",
// "mustCheck": 0,
// "newGoodsName": null,
// "newSpecifications": null,
// "numAcc": null,
// "onthewayQuantity": 0.0,
// "partLink": null,
// "piNo": null,
// "price": null,
// "priority": null,
// "prtType": "零件",
// "prtrevedit": null,
// "prtstd": null,
// "prtwt": 0.0,
// "purchaseQuantity": 100.0,
// "releaseno": null,
// "releasenoTime": null,
// "remark": null,
// "rlsId": null,
// "singlePieceQuota": null,
// "source": null,
// "special": null,
// "specifications": "100克/瓶",
// "syQuantity": null,
// "trademark": null,
// "unitName": "每克",
// "updateTime": "2023-07-15 16:18:30",
// "used": true
// },
// {
// "allGoodsQuantity": null,
// "batch": null,
// "bomQuantity": null,
// "buyQuantity": null,
// "cavityno": null,
// "checkoutCode": "2222",
// "coGoodsClass": null,
// "coStorageLocation": null,
// "cplb": null,
// "createTime": "2023-07-15 16:18:30",
// "curQuantity": 2999.0,
// "cycle": null,
// "deleted": false,
// "deliveryDate": null,
// "dept": null,
// "drawingNo": null,
// "ecnno": null,
// "enditem": 0,
// "erpQuantity": null,
// "goodsCode": "21E543-6108-B1",
// "goodsCodeAndGoodsName": "null——21E543-6108-B1——石墨模",
// "goodsId": 170,
// "goodsName": "石墨模",
// "grade": null,
// "houseQuantity": null,
// "lockQuantity": 0.0,
// "madeIn": null,
// "matbigclassify": null,
// "matsmallclassify": null,
// "maxNum": 300.0,
// "memo": null,
// "minNum": 50.0,
// "minStockWarning": false,
// "mtlsgrt": null,
// "mtltmrk": "4",
// "mustCheck": 0,
// "newGoodsName": null,
// "newSpecifications": null,
// "numAcc": null,
// "onthewayQuantity": 0.0,
// "partLink": null,
// "piNo": null,
// "price": null,
// "priority": null,
// "prtType": "零件",
// "prtrevedit": null,
// "prtstd": null,
// "prtwt": 0.0,
// "purchaseQuantity": 0.0,
// "releaseno": null,
// "releasenoTime": null,
// "remark": null,
// "rlsId": null,
// "singlePieceQuota": null,
// "source": null,
// "special": null,
// "specifications": null,
// "syQuantity": null,
// "trademark": null,
// "unitName": "每个",
// "updateTime": "2023-07-15 16:18:30",
// "used": true
// }
// ]
// this.page.total = this.data.length
8 months ago
}
}
}
</script>
<style></style>