代码提交

master
taozi 3 months ago
parent 8dcbdca13c
commit 3dc2d1a0dc
  1. 13
      src/api/firstOrder/outbound.js
  2. 4
      src/views/firstOrder/components/batchSelectionDialog.vue
  3. 200
      src/views/firstOrder/components/consumableDialog.vue
  4. 124
      src/views/firstOrder/components/needDialog.vue
  5. 26
      src/views/firstOrder/components/outDialog.vue
  6. 3
      src/views/firstOrder/inbound.vue
  7. 21
      src/views/firstOrder/outbound.vue
  8. 5
      src/views/materials/index.vue
  9. 11
      src/views/secondOrder/components/outDialog.vue

@ -85,4 +85,17 @@ export const editList = (oneOutStorageId) => {
cryptoToken: false,
cryptoData: false
})
}
export const getPutPurchaseList = (current, size, params) => {
return request({
url: '/smartpark/oneOutStorageDetail/getOneOutStorageDetailList',
method: 'get',
params: {
...params,
pageSize: size,
pageNum: current,
},
cryptoToken: false,
cryptoData: false
})
}

@ -38,8 +38,8 @@
<el-table-column label="物料名称" prop="materialName" />
<el-table-column label="规格型号" prop="model" />
<el-table-column label="申请数量" prop="applicationQuantity" />
<el-table-column label="已出库数量" prop="outboundQuantity" />
<el-table-column label="本此出库数量" prop="applicationQuantity" />
<!-- <el-table-column label="已出库数量" prop="outboundQuantity" /> -->
<el-table-column label="部门" prop="departmentName" />
<el-table-column label="单位" prop="unit" />
</el-table>

@ -35,7 +35,7 @@ export default {
query: { type: "NY" },
loading: true,
page: {
pageSize: 5,
pageSize: 10,
currentPage: 1,
total: 0,
},
@ -152,6 +152,7 @@ export default {
rkTable: [],
currentRow: null,
allSelectedList: [], //
isUpdatingSelection: false, // data
}
},
computed: {
@ -194,8 +195,8 @@ export default {
handleTabClick() {
this.loadTransactionData();
},
async loadTransactionData() {
if (!this.currentRow) return;
const params = {
@ -223,142 +224,155 @@ export default {
this.loading = false;
}
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
//
selectionChange(list) {
console.log("勾选选中", list)
const currentPageIds = this.data.map(item => item.id)
console.log(currentPageIds, "currentPageIds")
this.allSelectedList = this.allSelectedList.filter(item => !currentPageIds.includes(item.id))
console.log(this.allSelectedList, '1')
this.allSelectedList.push(...list)
console.log('所有勾选数据:', this.allSelectedList)
selectionChange(selection) {
//
if (this.isUpdatingSelection) {
return;
}
console.log("勾选选中", selection);
const currentPageIds = this.data.map(item => item.id);
console.log(currentPageIds, "currentPageIds");
// allSelectedListselection
this.allSelectedList = this.allSelectedList.filter(item =>
!currentPageIds.includes(item.id)
);
console.log(this.allSelectedList, '1');
// allSelectedList
this.allSelectedList.push(...selection);
console.log('所有勾选数据:', this.allSelectedList);
},
//
handleConfirm() {
console.log(6)
console.log(this.allSelectedList, 'chuan')
this.$emit("confirm", this.allSelectedList)
console.log(6);
console.log(this.allSelectedList, 'chuan');
this.$emit("confirm", this.allSelectedList);
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
this.allSelectedList = []; //
if (this.$refs.crud) {
this.$refs.crud.toggleSelection(); //
}
},
handleRowChange(row, index, data) {
//
// onLoad
//
this.$nextTick(() => {
const currentPageData = this.data
console.log(this.data,0)
this.$refs.crud.toggleAllSelection(false);
//
this.isUpdatingSelection = true;
const currentPageData = this.data || [];
//
this.$refs.crud.toggleSelection();
// allSelectedList
currentPageData.forEach((item) => {
// 0
const isSelected = this.allSelectedList.some(selectedItem =>
selectedItem.id === item.id && !(item.num === 0 || item.num === null || item.num === undefined || item.num === '')
const isSelected = this.allSelectedList.some(selectedItem =>
selectedItem.id === item.id
);
//
if (isSelected) {
this.$refs.crud.toggleRowSelection(item, true);
}
});
//
setTimeout(() => {
this.isUpdatingSelection = false;
}, 100);
});
},
// handleRowChange(row, index, data) {
// //
// this.$nextTick(() => {
// //
// const currentPageData = this.data || [];
// //
// this.$refs.crud.toggleAllSelection(false);
// // allSelectedList
// currentPageData.forEach((item, index) => {
// const isSelected = this.allSelectedList.some(selectedItem =>
// selectedItem.id === item.id
// );
// //
// if (isSelected) {
// this.$refs.crud.toggleRowSelection(item, true);
// }
// });
// });
// },
// currentChange(currentPage) {
// console.log(currentPage, 1);
// this.page.currentPage = currentPage;
// // onLoad handleRowChange
// this.onLoad(this.page, this.query);
// },
// onLoad(page, params = {}) {
// this.loading = true;
// console.log(this.query, 2);
// getList(
// page.currentPage,
// page.pageSize,
// Object.assign(params, this.query)
// ).then((res) => {
// this.data = res.data.result.list;
// this.loading = false;
// this.page.total = res.data.result.total;
// //
// this.$nextTick(() => {
// this.updateCurrentPageSelection();
// });
// });
// this.loading = false;
// },
// //
// updateCurrentPageSelection() {
// if (!this.$refs.crud) return;
// const currentPageData = this.data || [];
// currentPageData.forEach((item) => {
// const isSelected = this.allSelectedList.some(selectedItem =>
// selectedItem.id === item.id
// );
// if (isSelected) {
// this.$refs.crud.toggleRowSelection(item, true);
// }
// });
// },
currentChange(currentPage) {
console.log(currentPage, 1)
this.handleRowChange()
console.log(currentPage, 1);
this.page.currentPage = currentPage;
// onLoad
this.onLoad(this.page, this.query);
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad(this.page, this.query);
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
console.log(this.query, 2)
console.log(this.query, 2);
getList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
).then((res) => {
this.data = res.data.result.list
this.data = res.data.result.list;
this.loading = false;
this.page.total = res.data.result.total;
})
this.loading = false;
//
this.$nextTick(() => {
this.updateCurrentPageSelection();
});
}).catch(error => {
this.loading = false;
this.$message.error('加载数据失败: ' + error.message);
});
},
//
updateCurrentPageSelection() {
if (!this.$refs.crud) return;
//
this.isUpdatingSelection = true;
const currentPageData = this.data || [];
//
this.$refs.crud.toggleSelection();
currentPageData.forEach((item) => {
const isSelected = this.allSelectedList.some(selectedItem =>
selectedItem.id === item.id
);
if (isSelected) {
this.$refs.crud.toggleRowSelection(item, true);
}
});
//
this.$nextTick(() => {
setTimeout(() => {
this.isUpdatingSelection = false;
}, 100);
});
},
handleCancel() {
this.$emit('handleCloseDetail');
}
},
}
</script>
@ -375,4 +389,4 @@ export default {
padding-right: 10px;
overflow-x: hidden;
}
</style>
</style>

@ -1,59 +1,91 @@
<template>
<el-dialog :title="purchaseTitle" append-to-body :visible.sync="openShow" width="70%" @close="closeDialog">
<el-dialog :title="purchaseTitle" append-to-body :visible.sync="openShow" width="70%" @close="closeDialog">
<avue-crud :data="data" :option="option"></avue-crud>
<!-- <template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</template> -->
</el-dialog>
<avue-crud :data="data" :option="option" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" :page.sync="page" @on-load="onLoad"></avue-crud>
</el-dialog>
</template>
<script>
import { getPutPurchaseList } from "@/api/firstOrder/outbound";
export default {
props: {
showDialog: {
type: Boolean,
default: false
},
purchaseTitle:{
type:String,
default:''
}
props: {
showDialog: {
type: Boolean,
default: false
},
data() {
return {
openShow:false,
option:{
menu:false,
header:false,
align: 'center',
column:[
{
label:'物品名称',
prop:'wupinmingcheng'
}, {
label:'需求数量',
prop:'caigoushuliang'
},{
label:'已出库数量',
prop:'yirukushuliang'
}
]
}
}
purchaseTitle: {
type: String,
default: ''
},
mounted(){
this.openShow = this.showDialog
id: {
type: Number,
default: 0
}
},
data() {
return {
openShow: false,
data: [],
query: {},
loading: false,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
menu: false,
header: false,
align: 'center',
// page: true,
column: [
{
label: '物资名称',
prop: 'materialName'
}, {
label: '计划需求数量',
prop: 'requiredQuantity'
}, {
label: '已出库数量',
prop: 'outboundQuantity'
}
]
}
}
},
mounted() {
this.openShow = this.showDialog
},
methods: {
closeDialog() {
this.openShow = false
this.$emit('closeDialog');
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
methods:{
closeDialog(){
this.openShow = false
this.$emit('closeDialog');
}
onLoad(page, params = {}) {
this.loading = true;
const queryParams = Object.assign(params, this.query, {
onePutStorageId: this.id
});
getPutPurchaseList(page.currentPage, page.pageSize, queryParams).then(res => {
console.log('采购单列表', res.data.result)
// const data = res.data.data;
this.data = res.data.result.list;
this.loading = false;
this.page.total = res.data.result.total;
// this.selectionClear();
});
}
}
}
</script>
<style lang="scss" scoped></style>

@ -88,7 +88,7 @@
</el-table-column>
<el-table-column prop="unit" label="单位">
</el-table-column>
<el-table-column label="部门" prop="departmentName" v-if="sizeForm.options === 2 && sizeForm.optionType"
<el-table-column label="部门" prop="departmentName" v-if="sizeForm.options === 2 || sizeForm.optionType"
:key="'account-dept-' + sizeForm.options">
<template slot-scope="scope">
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;"
@ -97,7 +97,7 @@
:value="item.departmentId">
</el-option>
</el-select>
<span v-else> {{ scope.row.departmentName }}</span>
<span v-else> {{ scope.row.departmentName || ''}}</span>
</template>
</el-table-column>
<!-- <el-table-column prop="departmentName" label="部门" :key="'account-dept-' + sizeForm.options">
@ -112,12 +112,16 @@
</template>
</el-table-column> -->
<el-table-column prop="applicationQuantity" label="申请数量" v-if="sizeForm.options == 1">
<template slot-scope="scope">
{{ scope.row.applicationQuantity || 0 }}
</template>
</el-table-column>
<!-- <el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1">
<el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1 ">
<template slot-scope="scope">
{{ scope.row.outboundQuantity || 0 }}
</template>
</el-table-column> -->
</el-table-column>
<el-table-column prop="theOutboundQuantity" label="本次出库数量">
<template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.theOutboundQuantity" :min="0" style="width: 100%;"
@ -774,7 +778,7 @@ export default {
this.sizeForm.demandEndInfo = ldOneOutStorage.demandEndInfo
this.sizeForm.outDate = ldOneOutStorage.outDate
this.sizeForm.options = Number(ldOneOutStorage.options)
// this.sizeForm.optionType = ldOneOutStorage.optionType
// reason: '',//
// inAccountsTableData: [],//
// inTableData: [],
@ -862,11 +866,13 @@ export default {
}
},
'sizeForm.optionType': function (newVal) {
if (newVal) {
this.sizeForm.inTableData = []
// this.getMaterialList()
}
},
if (newVal && this.outDialogType === 'add') {
this.sizeForm.inTableData = []
this.getMaterialList()
} else if (newVal && this.outDialogType !== 'add') {
this.getMaterialList()
}
},
}
}
</script>

@ -17,7 +17,7 @@
@on-load="onLoad"
>
<template slot-scope="scope" slot="menuLeft">
<el-button size="small" type="primary" @click="handleDesign()"
<el-button size="small" type="primary" @click="handleDesign()"
>新增入库单
</el-button>
</template>
@ -279,6 +279,7 @@ export default {
},
//
purchaseFn(row) {
console.log(122)
this.purchaseOpen = true;
this.purchaseTitle = row.purchaseEndInfo + "采购单详情";
this.id = row.id;

@ -11,10 +11,20 @@
<!-- <el-button size="small" plain @click="handleExport()">出库单导出
</el-button> -->
</template>
<template slot-scope="scope" slot="purchaseEndInfo">
<el-button type="text" @click.stop="purchaseFn(scope.row)" v-if="scope.row.purchaseEndInfo != '无'">{{
scope.row.purchaseEndInfo }}</el-button>
<span>{{ scope.row.purchaseEndInfo || '无' }}</span>
<!-- <template slot-scope="scope" slot="purchaseEndInfo">
<el-button type="text" @click.stop="purchaseFn(scope.row)"
v-if="scope.row.purchaseEndInfo != '无'">
{{scope.row.purchaseEndInfo }}</el-button>
<span>{{ scope.row.purchaseEndInfo || '无' }}</span>
</template> -->
<template slot-scope="scope" slot="demandEndInfo">
<el-button
type="text"
@click.stop="purchaseFn(scope.row)"
v-if="scope.row.demandEndInfo && scope.row.demandEndInfo !== ''"
>{{ scope.row.demandEndInfo }}</el-button
>
<span v-else></span>
</template>
<template #menu="scope">
<el-button type="text" @click.stop="handleDetails(scope.row)">详情</el-button>
@ -226,8 +236,9 @@ export default {
},
//
purchaseFn(row) {
console.log('xuqiudanchuku')
this.purchaseOpen = true
this.purchaseTitle = row.purchaseEndInfo + '需求单详情'
this.purchaseTitle = row.demandEndInfo + '需求单详情'
this.id = row.id
},
closeDialog() {

@ -64,12 +64,13 @@ export default {
align: "center",
},
{
label: "类别",
label: "物资编码",
prop: "materialCode",
type: "select",
headerAlign: "center",
align: "center",
dicData: [],
dicData: [
],
props: {
label: "label",
value: "value",

@ -124,9 +124,9 @@
border
style="width: 100%"
>
<el-table-column prop="materialCode" label="物资编码" width="100">
<el-table-column prop="materialCode" label="物资编码" >
</el-table-column>
<el-table-column prop="str2" label="物资名称" width="140">
<el-table-column prop="str2" label="物资名称">
<template slot-scope="scope">
<el-select
v-model="scope.row.materialitem"
@ -150,7 +150,12 @@
</template>
</el-table-column>
<el-table-column prop="model" label="规格/型号"> </el-table-column>
<el-table-column prop="type" label="类别"> </el-table-column>
<!-- <el-table-column prop="type" label="类别"> </el-table-column> -->
<el-table-column prop="type" label="类别">
<template slot-scope="scope">
{{ scope.row.type === "NY" ? "耐用品" : (scope.row.type === "YH" ? "易耗品" : "") }}
</template>
</el-table-column>
<el-table-column prop="unit" label="单位"> </el-table-column>
<el-table-column prop="num" label="数量">
<template slot-scope="scope">

Loading…
Cancel
Save