仓库问题修改

dev-scheduling
zhangdi 5 days ago
parent f52a79c63e
commit cb0d500a4a
  1. 671
      src/views/warehouseManagement/materialExpiration/expire.vue

@ -1,11 +1,22 @@
<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"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad">
<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="setIndate()">到期处理</el-button>
<!-- <el-button type="danger" @click="handle()">删除</el-button> -->
</template>
@ -19,24 +30,42 @@
<el-button type="text" @click="handle(scope.row)">报废出库</el-button>
</template>
<template #stopUse="scope">
<el-switch v-model="scope.row.stopUse" active-text="限用" inactive-text="合格" active-color="#13ce66"
inactive-color="#ff4949" @change="(val) => usedOpenView(val,scope.row)" />
<el-switch
v-model="scope.row.stopUse"
active-text="限用"
inactive-text="合格"
active-color="#13ce66"
inactive-color="#ff4949"
@change="val => usedOpenView(val, scope.row)"
/>
</template>
<template #goodsStatus="scope">
{{scope.row.goodsStatus === false ? '合格' : scope.row.goodsStatus === true ? '限用' : ''}}
{{
scope.row.goodsStatus === false ? '合格' : scope.row.goodsStatus === true ? '限用' : ''
}}
</template>
</avue-crud>
<!-- 有效期维护 -->
<indateDailog :id="bcId" :set-crew-open="indateOpen" v-if="indateOpen" type="platingAssort"
@setIndateCancel="setIndateCancel" :title="'到期处理'" ></indateDailog>
<bfDialog v-if="bfOpen" :showDialog="bfOpen" :id="scrapId" @setIndateCancel="setIndateCancel"></bfDialog>
<indateDailog
:id="bcId"
:set-crew-open="indateOpen"
v-if="indateOpen"
type="platingAssort"
@setIndateCancel="setIndateCancel"
:title="'到期处理'"
></indateDailog>
<bfDialog
v-if="bfOpen"
:showDialog="bfOpen"
:id="scrapId"
@setIndateCancel="setIndateCancel"
></bfDialog>
</basic-container>
</template>
<script>
import {getList,changeStock} from "@/api/storeManagement/expire"
import indateDailog from "./indateDailog.vue"
import bfDialog from "./bfDialog.vue"
import { getList, changeStock } from '@/api/storeManagement/expire';
import indateDailog from './indateDailog.vue';
import bfDialog from './bfDialog.vue';
export default {
components: { indateDailog, bfDialog },
data() {
@ -221,8 +250,8 @@ export default {
filter: true,
span: 12,
type: 'date',
format:"YYYY-MM-DD",
valueFormat:"YYYY-MM-DD",
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
searchRange: true,
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
@ -248,13 +277,9 @@ export default {
width: 160,
fixed: 'right',
},
]
},
form: {
],
},
form: {},
page: {
pageSize: 10,
currentPage: 1,
@ -263,36 +288,32 @@ export default {
indateOpen: false,
bcId: null,
setCrewOpen: false,
}
};
},
methods: {
//
setIndate() {
if (this.selectionList.length == 0) {
this.$message.error('请至少选择数据')
return
this.$message.error('请至少选择数据');
return;
}
this.bcId = this.selectionList.map(item => item.id).join(',')
this.indateOpen = true
this.bcId = this.selectionList.map(item => item.id).join(',');
this.indateOpen = true;
},
setIndateCancel(isRefresh) {
this.indateOpen = false;
this.bfOpen = false
this.bfOpen = false;
if (isRefresh) {
this.onLoad()
this.onLoad();
}
},
warehousing() {
},
warehousingLog() {
},
warehousing() {},
warehousingLog() {},
// /
usedOpenView(val, row) {
console.log('row.stopUse===========',row.stopUse)
console.log('val===========',val)
row.stopUse = !row.stopUse
console.log('row.stopUse===========', row.stopUse);
console.log('val===========', val);
row.stopUse = !row.stopUse;
if (row.stopUse && row.stopUse == 1) {
this.$confirm('确定将库存限用设置为合格?', {
confirmButtonText: '确定',
@ -301,37 +322,58 @@ export default {
}).then(() => {
changeStock({
rlsId: row.id,
stopUse:0
stopUse: 0,
}).then(res => {
if (res.data.code === 200) {
this.$message.success('操作成功')
this.onLoad()
return false
this.$message.success('操作成功');
this.onLoad();
return false;
}
})
})
});
});
} else {
this.$confirm('确定将库存限用设置为限用?', {
// this.$confirm('?', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning',
// }).then(() => {
// changeStock({
// rlsId:row.id,
// stopUse:1,
// memo:'333',
// }).then(res =>{
// if(res.data.code === 200){
// this.$message.success('')
// this.onLoad()
// return true
// }
// })
// })
this.$prompt('备注:', '确定将库存限用设置为限用?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
})
.then(({ value }) => {
if (value != '') {
changeStock({
rlsId: row.id,
stopUse:1
stopUse: 1,
memo: value,
}).then(res => {
if (res.data.code === 200) {
this.$message.success('操作成功')
this.onLoad()
return true
this.$message.success('操作成功');
this.onLoad();
return true;
}
});
}
})
})
.catch(() => {});
}
},
searchData(type) {
this.query.expireStatus = type
this.onLoad()
this.query.expireStatus = type;
this.onLoad();
},
allocationFun(arId) {
// if (arId == null && this.selectionArr.length === 0) {
@ -340,7 +382,7 @@ export default {
this.$confirm('是否确认调拨', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
})
.then(() => {
const obj = { list: [] };
@ -359,16 +401,14 @@ export default {
// });
})
.catch(() => {
this.$message.info(
this.$t('global.canceled') + this.$t('store.allocation')
);
this.$message.info(this.$t('global.canceled') + this.$t('store.allocation'));
});
},
handle(row) {
console.log('rw===============',row)
this.scrapId = row.id
this.bfOpen = true
console.log('bfOpen-----------',this.bfOpen)
console.log('rw===============', row);
this.scrapId = row.id;
this.bfOpen = true;
console.log('bfOpen-----------', this.bfOpen);
},
handleDelete() {
if (this.selectionList.length === 0) {
@ -379,509 +419,50 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
})
}).then(() => {});
},
searchChange(params, done) {
this.query = params
this.query = params;
this.page.currentPage = 1;
this.onLoad()
done()
this.onLoad();
done();
},
searchReset() {
this.query = {}
this.onLoad()
this.query = {};
this.onLoad();
},
currentChange(currentPage) {
this.page.currentPage = currentPage
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize
this.page.pageSize = pageSize;
},
//
selectionChange(list) {
this.selectionList = list;
},
onLoad() {
this.loading = true
this.loading = true;
let params = {
...this.query,
startDueDate:this.query.scrapCycle && this.query.scrapCycle.length != 0 && this.query.scrapCycle[0],
endDueDate:this.query.scrapCycle && this.query.scrapCycle.length != 0 && this.query.scrapCycle[1],
}
// const {scrapCycle,...invalideParams} = params
if(params.scrapCycle) delete params.scrapCycle
startDueDate:
this.query.scrapCycle && this.query.scrapCycle.length != 0 && this.query.scrapCycle[0],
endDueDate:
this.query.scrapCycle && this.query.scrapCycle.length != 0 && this.query.scrapCycle[1],
};
if (params.scrapCycle) delete params.scrapCycle;
getList({
current: this.page.currentPage,
size: this.page.pageSize,
...params
...params,
}).then(res => {
this.data = res.data.data.records
this.page.total = res.data.data.total
this.loading = false
})
// this.data = [
// {
// "allMoney": null,
// "balanceMoney": 15.0,
// "barCode": null,
// "checkCode": "ck001",
// "coGoods": {
// "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": "null21E543-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,
// "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
// },
// "coStorehouse": {
// "codeAndName": null,
// "createTime": "2023-12-25 10:08:43",
// "deleted": false,
// "factoryId": 41,
// "memo": null,
// "saveUser": {
// "accountId": null,
// "card": null,
// "createTime": "2023-04-06",
// "curStatus": 1,
// "deleted": false,
// "deptName": null,
// "dimissionTime": null,
// "factoryId": 41,
// "head": 0,
// "jobName": "",
// "keyValue": 521,
// "ldapName": null,
// "mail": null,
// "mobile": null,
// "pfDepartment": {
// "appLink": null,
// "createTime": "2022-08-31",
// "deleted": false,
// "deptCode": "001",
// "deptId": 1,
// "deptName": "MES",
// "deptType": 1,
// "deptTypeTitle": "",
// "keyValue": 1,
// "memo": null,
// "orders": "00",
// "parentDeptId": null,
// "parentPath": null,
// "ucDeptId": null,
// "updateTime": "2022-08-31 16:32:46"
// },
// "ucUserId": null,
// "updateTime": "2023-04-06 16:23:38",
// "userCode": "0001",
// "userId": 521,
// "userName": "",
// "userSex": 1,
// "userSources": "",
// "userString": "521:A:",
// "userType": "A",
// "yearsOfService": null
// },
// "shCode": "RB001",
// "shId": 183,
// "shLevel": null,
// "shName": "",
// "toolingType": null,
// "toolingTypeStr": null,
// "type": 0,
// "typeStr": "",
// "updateTime": null
// },
// "createTime": "2023-12-25 10:26:44",
// "facType": 0,
// "factoryId": 41,
// "goodsCodeAndGoodsName": null,
// "goodsId": null,
// "goodsStatus": 0,
// "inStoreDay": 665,
// "isApplyFor": false,
// "keeper": null,
// "memo": null,
// "modelOrBrandStr": "4/null",
// "moldBaseMaterial": false,
// "moldStock": null,
// "outQuantity": null,
// "piNo": "Y20231225001",
// "quantity": 2999.0,
// "quantityLevel": "ccc",
// "rlsId": 222,
// "scrapCycle": "2024-09-18 00:00:00",
// "splyCode": null,
// "stayMaintainNum": 0,
// "stockSource": 0,
// "stopUse": false,
// "stopUseTitle": "",
// "storageLocation": {
// "coStorehouse": {
// "codeAndName": null,
// "createTime": "2023-12-25 10:08:43",
// "deleted": false,
// "factoryId": 41,
// "memo": null,
// "saveUser": {
// "accountId": null,
// "card": null,
// "createTime": "2023-04-06",
// "curStatus": 1,
// "deleted": false,
// "deptName": null,
// "dimissionTime": null,
// "factoryId": 41,
// "head": 0,
// "jobName": "",
// "keyValue": 521,
// "ldapName": null,
// "mail": null,
// "mobile": null,
// "pfDepartment": {
// "appLink": null,
// "createTime": "2022-08-31",
// "deleted": false,
// "deptCode": "001",
// "deptId": 1,
// "deptName": "MES",
// "deptType": 1,
// "deptTypeTitle": "",
// "keyValue": 1,
// "memo": null,
// "orders": "00",
// "parentDeptId": null,
// "parentPath": null,
// "ucDeptId": null,
// "updateTime": "2022-08-31 16:32:46"
// },
// "ucUserId": null,
// "updateTime": "2023-04-06 16:23:38",
// "userCode": "0001",
// "userId": 521,
// "userName": "",
// "userSex": 1,
// "userSources": "",
// "userString": "521:A:",
// "userType": "A",
// "yearsOfService": null
// },
// "shCode": "RB001",
// "shId": 183,
// "shLevel": null,
// "shName": "",
// "toolingType": null,
// "toolingTypeStr": null,
// "type": 0,
// "typeStr": "",
// "updateTime": null
// },
// "cslId": 222,
// "deleted": false,
// "goodsCode": "21E543-6108-B1",
// "goodsName": null,
// "location": "RB001SM02",
// "mtltmrk": null,
// "specifications": null
// },
// "stovePiNo": null,
// "sumNum": 0,
// "thickness": null,
// "updateTime": null,
// "useQuantity": 2999.0,
// "zyQuantity": 0.0
// },
// {
// "allMoney": null,
// "balanceMoney": 30.0,
// "barCode": null,
// "checkCode": "CK002",
// "coGoods": {
// "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": "null04-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,
// "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
// },
// "coStorehouse": {
// "codeAndName": null,
// "createTime": "2023-12-25 10:09:44",
// "deleted": false,
// "factoryId": 41,
// "memo": null,
// "saveUser": {
// "accountId": null,
// "card": null,
// "createTime": "2023-02-08",
// "curStatus": 1,
// "deleted": false,
// "deptName": null,
// "dimissionTime": null,
// "factoryId": 41,
// "head": 0,
// "jobName": "",
// "keyValue": 453,
// "ldapName": "00075",
// "mail": null,
// "mobile": null,
// "pfDepartment": {
// "appLink": null,
// "createTime": "2023-02-08",
// "deleted": false,
// "deptCode": "26",
// "deptId": 57,
// "deptName": "",
// "deptType": 1,
// "deptTypeTitle": "",
// "keyValue": 57,
// "memo": null,
// "orders": "26",
// "parentDeptId": 41,
// "parentPath": null,
// "ucDeptId": null,
// "updateTime": "2023-02-08 16:38:31"
// },
// "ucUserId": null,
// "updateTime": "2023-02-08 17:25:13",
// "userCode": "00075",
// "userId": 453,
// "userName": "1",
// "userSex": 1,
// "userSources": "1",
// "userString": "453:A:1",
// "userType": "A",
// "yearsOfService": null
// },
// "shCode": "RB002",
// "shId": 184,
// "shLevel": null,
// "shName": "",
// "toolingType": null,
// "toolingTypeStr": null,
// "type": 0,
// "typeStr": "",
// "updateTime": "2023-12-25 10:09:58"
// },
// "createTime": "2023-12-25 10:28:24",
// "facType": 0,
// "factoryId": 41,
// "goodsCodeAndGoodsName": null,
// "goodsId": null,
// "goodsStatus": 0,
// "inStoreDay": 665,
// "isApplyFor": false,
// "keeper": null,
// "memo": null,
// "modelOrBrandStr": "23/null",
// "moldBaseMaterial": false,
// "moldStock": null,
// "outQuantity": null,
// "piNo": "Y20231225001",
// "quantity": 1950.0,
// "quantityLevel": "aaa",
// "rlsId": 223,
// "scrapCycle": "2024-09-18 00:00:00",
// "splyCode": null,
// "stayMaintainNum": 0,
// "stockSource": 0,
// "stopUse": false,
// "stopUseTitle": "",
// "storageLocation": {
// "coStorehouse": {
// "codeAndName": null,
// "createTime": "2023-12-25 10:09:44",
// "deleted": false,
// "factoryId": 41,
// "memo": null,
// "saveUser": {
// "accountId": null,
// "card": null,
// "createTime": "2023-02-08",
// "curStatus": 1,
// "deleted": false,
// "deptName": null,
// "dimissionTime": null,
// "factoryId": 41,
// "head": 0,
// "jobName": "",
// "keyValue": 453,
// "ldapName": "00075",
// "mail": null,
// "mobile": null,
// "pfDepartment": {
// "appLink": null,
// "createTime": "2023-02-08",
// "deleted": false,
// "deptCode": "26",
// "deptId": 57,
// "deptName": "",
// "deptType": 1,
// "deptTypeTitle": "",
// "keyValue": 57,
// "memo": null,
// "orders": "26",
// "parentDeptId": 41,
// "parentPath": null,
// "ucDeptId": null,
// "updateTime": "2023-02-08 16:38:31"
// },
// "ucUserId": null,
// "updateTime": "2023-02-08 17:25:13",
// "userCode": "00075",
// "userId": 453,
// "userName": "1",
// "userSex": 1,
// "userSources": "1",
// "userString": "453:A:1",
// "userType": "A",
// "yearsOfService": null
// },
// "shCode": "RB002",
// "shId": 184,
// "shLevel": null,
// "shName": "",
// "toolingType": null,
// "toolingTypeStr": null,
// "type": 0,
// "typeStr": "",
// "updateTime": "2023-12-25 10:09:58"
// },
// "cslId": 223,
// "deleted": false,
// "goodsCode": "04-05-025",
// "goodsName": null,
// "location": "RB002XBJ01",
// "mtltmrk": null,
// "specifications": null
// },
// "stovePiNo": null,
// "sumNum": 0,
// "thickness": null,
// "updateTime": null,
// "useQuantity": 1950.0,
// "zyQuantity": 0.0
// }
// ]
// this.page.total = this.data.length
// this.loading = false
// setTimeout(() => {
// this.selectionClear()
// }, 500)
}
}
}
this.data = res.data.data.records;
this.page.total = res.data.data.total;
this.loading = false;
});
},
},
};
</script>
<style lang="scss" scoped>
:root {

Loading…
Cancel
Save