二级出库勾选调整

master
taozi 3 months ago
parent 5fab6cdd98
commit f15747ff8d
  1. 9
      src/views/firstOrder/components/approvalProcessDialog.vue
  2. 14
      src/views/firstOrder/components/outDialog.vue
  3. 6
      src/views/firstOrder/components/recordDialog.vue
  4. 4
      src/views/firstOrder/inbound.vue
  5. 4
      src/views/materials/index.vue
  6. 52
      src/views/secondOrder/components/categoryDialog.vue
  7. 20
      src/views/secondOrder/components/outDialog.vue

@ -89,9 +89,16 @@ export default {
} }
.teps-con { .teps-con {
margin: 0 auto 0 margin: 0 auto 0;
:deep(.el-step) {
margin-bottom: 10px;
&:last-child {
margin-bottom: 0;
}
}
} }
// :deep(.el-dialog__body) { // :deep(.el-dialog__body) {
// height: 300px; // height: 300px;
// } // }

@ -594,20 +594,22 @@ export default {
}, },
getStatistics() { getStatistics() {
getStatistics(this.sizeForm.inTableData).then((res) => { getStatistics(this.sizeForm.inTableData).then((res) => {
this.statisticsList = res.data.result; this.statisticsList = res.data.result
this.statisticsList = this.statisticsList.map((stat) => { this.statisticsList = this.statisticsList.map((stat) => {
const detail = this.sizeForm.inTableData.find( const detail = this.sizeForm.inTableData.find(
(item) => item.materialCode === stat.materialCode (item) => item.materialCode === stat.materialCode
); )
console.log("detail", detail, stat); console.log("detail", detail, stat)
return { return {
...stat, ...stat,
theOutboundQuantity: detail.theOutboundQuantity, // theOutboundQuantity: detail.theOutboundQuantity, //
unitPrice: detail.unitPrice, unitPrice: detail.unitPrice,
totalQuantity: stat.num - detail.theOutboundQuantity, totalQuantity: stat.num - detail.theOutboundQuantity,
}; department: detail.department, // ID
}); departmentName: detail.departmentName || this.getDepartmentName(detail.department),
}); }
})
})
}, },
changeDepartment(){ changeDepartment(){
this.getStatistics() this.getStatistics()

@ -5,13 +5,12 @@
:visible.sync="openShow" :visible.sync="openShow"
width="50%" width="50%"
@close="closeDialog" @close="closeDialog"
:style="{ height: '600px' }"
> >
<el-tabs v-model="transactionType" @tab-click="handleTabClick"> <el-tabs v-model="transactionType" @tab-click="handleTabClick">
<el-tab-pane label="入库" name="2"></el-tab-pane> <el-tab-pane label="入库" name="2"></el-tab-pane>
<el-tab-pane label="出库" name="1"></el-tab-pane> <el-tab-pane label="出库" name="1"></el-tab-pane>
</el-tabs> </el-tabs>
<div style="height: 400px; overflow: hidden;">
<avue-crud <avue-crud
:data="data" :data="data"
:option="dynamicOption" :option="dynamicOption"
@ -23,6 +22,7 @@
@search-reset="searchReset" @search-reset="searchReset"
:page.sync="page" :page.sync="page"
></avue-crud> ></avue-crud>
</div>
</el-dialog> </el-dialog>
</template> </template>
@ -44,7 +44,7 @@ export default {
data() { data() {
return { return {
openShow: false, openShow: false,
transactionType: "1", transactionType: "2",
tableData: [], tableData: [],
purchaseTitle: "记录", purchaseTitle: "记录",
data: [], data: [],

@ -236,6 +236,10 @@ export default {
label: "已审批", label: "已审批",
value: 3, value: 3,
}, },
{
label: "审批失败",
value: 4,
},
], ],
}, },
], ],

@ -76,12 +76,14 @@ export default {
search: true, search: true,
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
rules: [{ required: true, message: "请输入物资名称", trigger: "blur" }]
}, },
{ {
label: "规格/型号", label: "规格/型号",
prop: "model", prop: "model",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
rules: [{ required: true, message: "请输入规格/型号", trigger: "blur" }]
}, },
{ {
label: "物资编码", label: "物资编码",
@ -95,12 +97,14 @@ export default {
value: "value", value: "value",
}, },
dataType: "string", dataType: "string",
rules: [{ required: true, message: "请选择物资编码", trigger: "change" }]
}, },
{ {
label: "单位", label: "单位",
prop: "unit", prop: "unit",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
rules: [{ required: true, message: "请输入单位", trigger: "blur" }]
}, },
{ {
label: "描述", label: "描述",

@ -41,7 +41,6 @@
<script> <script>
import { getList } from "@/api/secondOrder/list.js"; import { getList } from "@/api/secondOrder/list.js";
import { getList as fetchDurableApi } from "@/api/materials/expend"; import { getList as fetchDurableApi } from "@/api/materials/expend";
export default { export default {
props: { props: {
categoryVisible: { categoryVisible: {
@ -53,7 +52,7 @@ export default {
default: "", default: "",
}, },
departmentId: { departmentId: {
type: [String, Number], type: String,
default: "", default: "",
}, },
selectionData: { selectionData: {
@ -196,26 +195,18 @@ export default {
// //
updateCurrentPageSelection() { updateCurrentPageSelection() {
if (!this.$refs.crud || !this.data) return; if (!this.$refs.crud || !this.data) return;
this.isUpdatingSelection = true; this.isUpdatingSelection = true;
const currentPageData = this.data || []; const currentPageData = this.data || [];
//
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
console.log(this.allSelectedList,'勾选状态数据')
// allSelectedList
currentPageData.forEach((item) => { currentPageData.forEach((item) => {
const isSelected = this.allSelectedList.some( const isSelected = this.allSelectedList.some(
(selectedItem) => selectedItem.id === item.id (selectedItem) => selectedItem.id === item.id
); );
if (isSelected) { if (isSelected) {
this.$refs.crud.toggleRowSelection(item, true); this.$refs.crud.toggleRowSelection(item, true);
} }
}); })
//
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => { setTimeout(() => {
this.isUpdatingSelection = false; this.isUpdatingSelection = false;
@ -225,66 +216,55 @@ export default {
// //
selectionChange(selection,row) { selectionChange(selection,row) {
let isSelectedInfo = selection.filter( let isSelectedInfo = selection.filter(
(item) => item.id==row.id (item) => item.id==row.id
); );
if (this.isUpdatingSelection) { if (this.isUpdatingSelection) {
return; return;
} }
// ID
const currentPageIds = this.data.map((item) => item.id); const currentPageIds = this.data.map((item) => item.id);
const otherPageSelected = this.allSelectedList.filter( const otherPageSelected = this.allSelectedList.filter(
(item) => !currentPageIds.includes(item.id) (item) => !currentPageIds.includes(item.id)
); );
const currentSelected = selection.map((item) => ({ const currentSelected = selection.map((item) => ({
...item, ...item,
twoInventoryId: item.id, twoInventoryId: item.id,
})); }));
//
const combinedSelection = [ const combinedSelection = [
...otherPageSelected, // ...otherPageSelected,
...currentSelected, // ...currentSelected,
]; ]
// allSelectedList
this.allSelectedList = this.uniqueById(combinedSelection); this.allSelectedList = this.uniqueById(combinedSelection);
if(isSelectedInfo.length <= 0){
if(isSelectedInfo.length<=0){ this.allSelectedList = this.allSelectedList.filter(
this.allSelectedList=this.allSelectedList.filter( (item) => item.id !== row.id
(item) => item.id!==row.id
); );
} }
console.log('isSelectedInfo', this.allSelectedList);
this.allSelectedList.forEach(item=>{ this.allSelectedList.forEach(item=>{
item.num = 0 item.num = 1
}) })
// console.log("allSelectedList:", this.allSelectedList);
}, },
// //
uniqueById(arr) { uniqueById(arr) {
const uniqueObj = {}; const uniqueObj = {};
arr.forEach((item) => { arr.forEach((item) => {
if (item.id && !uniqueObj[item.id]) { if (item.id && !uniqueObj[item.id]) {
uniqueObj[item.id] = item; uniqueObj[item.id] = item
} }
}); })
return Object.values(uniqueObj); return Object.values(uniqueObj)
}, },
// //
handleConfirm() { handleConfirm() {
const uniqueList = this.uniqueById(this.allSelectedList); const uniqueList = this.uniqueById(this.allSelectedList);
this.$emit("confirm", uniqueList); this.$emit("confirm", uniqueList);
this.allSelectedList = []
}, },
selectionClear() { selectionClear() {
this.allSelectedList = []; this.allSelectedList = [];
if (this.$refs.crud) { if (this.$refs.crud) {
@ -336,7 +316,7 @@ export default {
}) })
.finally(() => { .finally(() => {
this.loading = false; this.loading = false;
}); })
}, },
handleCancel() { handleCancel() {

@ -411,27 +411,9 @@ export default {
this.categoryVisible = true; this.categoryVisible = true;
}, },
confirm(allSelectedList) { confirm(allSelectedList) {
console.log("allSelectedList-------", allSelectedList); this.selectionData = allSelectedList
// this.selectionData = allSelectedList
allSelectedList.map((item) => {
this.selectionData.push(item);
});
this.categoryVisible = false; this.categoryVisible = false;
//
const newItems = allSelectedList.filter(
(newItem) =>
!this.sizeForm.ldTwoOutStorageDetailList.some(
(oldItem) => oldItem.id === newItem.id
)
);
//
this.sizeForm.ldTwoOutStorageDetailList = allSelectedList; this.sizeForm.ldTwoOutStorageDetailList = allSelectedList;
console.log(
"ldTwoOutStorageDetailList--------",
this.sizeForm.ldTwoOutStorageDetailList
);
//
// this.summaryTableData();
this.getStatistics(); this.getStatistics();
}, },
// //

Loading…
Cancel
Save