完成
This commit is contained in:
@@ -319,10 +319,8 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Stock">
|
||||
import {
|
||||
moveRecord,
|
||||
} from "@/api/wisdom/bill";
|
||||
import { listStock, editStock, printTag } from "@/api/wisdom/stock";
|
||||
import { moveRecord } from "@/api/wisdom/bill";
|
||||
import { listStock, getTotal, editStock, printTag } from "@/api/wisdom/stock";
|
||||
import { warehousingDict } from "@/api/information/warehousingtype"; //入库类型
|
||||
import { materialtypeDict } from "@/api/information/materialtype"; //物资类型
|
||||
import { warehouseAll } from "@/api/information/warehouseinfo"; //所属仓库
|
||||
@@ -334,10 +332,10 @@ import { parseTime } from '@/utils/manage'
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
|
||||
const loading = ref(true);
|
||||
|
||||
const showSearch = ref(true);
|
||||
|
||||
const total = ref(0);
|
||||
|
||||
|
||||
const warehouseCode = ref(''); //所属仓库下拉数据
|
||||
const printList = ref([]) //要打印的数据列表
|
||||
@@ -347,9 +345,7 @@ const optionTime = ref([]) //入库时间
|
||||
const dialogImageUrl = ref('')
|
||||
const dialogVisible = ref(false)
|
||||
|
||||
const totalMoney = ref(null)
|
||||
const pcodeCount = ref(null)
|
||||
const sumQty = ref(null)
|
||||
|
||||
|
||||
const printNum = ref(1) //打印机编号
|
||||
const printNumList = ref([
|
||||
@@ -397,6 +393,8 @@ const { queryParams, rules } = toRefs(data);
|
||||
|
||||
/** 查询库存单据主列表 */
|
||||
const stockList = ref([]);
|
||||
const total = ref(0);
|
||||
const loading = ref(true);
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listStock(queryParams.value).then(response => {
|
||||
@@ -405,15 +403,24 @@ function getList() {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
getList();
|
||||
|
||||
// 获取总计
|
||||
const totalMoney = ref(null)
|
||||
const pcodeCount = ref(null)
|
||||
const sumQty = ref(null)
|
||||
function getSumInfo() {
|
||||
//统计信息
|
||||
//getSumInfoI(queryParams.value).then(response => {
|
||||
// totalMoney.value = response.sumMoney
|
||||
//pcodeCount.value = response.pcdeCount
|
||||
//sumQty.value = response.sumQty
|
||||
//});
|
||||
let rkInfo = JSON.parse(JSON.stringify(queryParams.value))
|
||||
delete rkInfo.pageNum
|
||||
delete rkInfo.pageSize
|
||||
getTotal({rkInfo: rkInfo}).then(response => {
|
||||
totalMoney.value = response.sumMoney
|
||||
pcodeCount.value = response.pcdeCount
|
||||
sumQty.value = response.sumQty
|
||||
});
|
||||
}
|
||||
getSumInfo()
|
||||
|
||||
//所属仓库字典
|
||||
const warehouseOptions = ref([]);
|
||||
@@ -422,22 +429,25 @@ function warehouseFun() {
|
||||
warehouseOptions.value = response.data
|
||||
})
|
||||
}
|
||||
warehouseFun()
|
||||
|
||||
//物资类型典
|
||||
//物资类型
|
||||
const wzTypeList = ref([]);
|
||||
function materialFun() {
|
||||
materialtypeDict().then(response => {
|
||||
wzTypeList.value = response.data
|
||||
})
|
||||
}
|
||||
materialFun()
|
||||
|
||||
//理货员典
|
||||
//理货员
|
||||
const personList = ref([]);
|
||||
function lhyList() {
|
||||
personListDict().then(response => {
|
||||
personList.value = response.data
|
||||
})
|
||||
}
|
||||
lhyList()
|
||||
|
||||
//入库类型典
|
||||
const storeTypeList = ref([]);
|
||||
@@ -446,6 +456,7 @@ function rklxList() {
|
||||
storeTypeList.value = response.data
|
||||
})
|
||||
}
|
||||
rklxList()
|
||||
|
||||
// 仓库下拉改变事件
|
||||
function onChangeToCangku (val){
|
||||
@@ -499,49 +510,6 @@ function handleExport() {
|
||||
}, `库存记录_${parseTime(new Date().getTime(), '{y}年{m}月{d}日 {h}_{i}_{s}')}.xlsx`)
|
||||
}
|
||||
|
||||
//打印标签
|
||||
function handlePrintTag() {
|
||||
if (printList.value.length == 0) {
|
||||
proxy.$modal.msgError("请勾选数据");
|
||||
return
|
||||
}
|
||||
if (!printNum.value) {
|
||||
proxy.$modal.msgError("请选择打印机编号");
|
||||
return
|
||||
}
|
||||
for (let i = 0; i < printList.value.length; i++) {
|
||||
printList.value[i].printer = printNum.value
|
||||
}
|
||||
|
||||
printTag(printList.value).then(response => {
|
||||
if (response.code == 200) {
|
||||
proxy.$modal.msgSuccess("打印指令已发送");
|
||||
} else {
|
||||
proxy.$modal.msgError("操作失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
function getSummaries(param) {
|
||||
const { columns, data } = param;
|
||||
// console.log(columns)
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 1) { // 第一列不进行合计操作,通常是序列号或选择框等非数值列。
|
||||
sums[index] = '总计'; // 这里可以设置为其他文字或空字符串。
|
||||
return;
|
||||
} else if (index === 2) { // 第二列是金额列,进行求和操作。
|
||||
sums[index] = '总金额:' + totalMoney.value;
|
||||
// }else if(index === 2){
|
||||
// sums[index] = totalMoney.value
|
||||
} else if (index === 3) {
|
||||
sums[index] = '共存于:' + pcodeCount.value + '个库位'
|
||||
} else if (index === 4) {
|
||||
sums[index] = '总数:' + sumQty.value
|
||||
}
|
||||
})
|
||||
return sums
|
||||
}
|
||||
|
||||
// 移库弹框
|
||||
const openMove = ref(false); //移库
|
||||
const checkStockList = ref([]); //移库数据
|
||||
@@ -635,18 +603,53 @@ function editForm() {
|
||||
})
|
||||
}
|
||||
|
||||
//统计信息
|
||||
getSumInfo()
|
||||
//数据列表
|
||||
getList();
|
||||
//所属仓库
|
||||
warehouseFun()
|
||||
//物资类型
|
||||
materialFun()
|
||||
//理货员下拉数据
|
||||
lhyList()
|
||||
//入库类型下拉数据
|
||||
rklxList()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//打印标签
|
||||
function handlePrintTag() {
|
||||
if (printList.value.length == 0) {
|
||||
proxy.$modal.msgError("请勾选数据");
|
||||
return
|
||||
}
|
||||
if (!printNum.value) {
|
||||
proxy.$modal.msgError("请选择打印机编号");
|
||||
return
|
||||
}
|
||||
for (let i = 0; i < printList.value.length; i++) {
|
||||
printList.value[i].printer = printNum.value
|
||||
}
|
||||
|
||||
printTag(printList.value).then(response => {
|
||||
if (response.code == 200) {
|
||||
proxy.$modal.msgSuccess("打印指令已发送");
|
||||
} else {
|
||||
proxy.$modal.msgError("操作失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
function getSummaries(param) {
|
||||
const { columns, data } = param;
|
||||
// console.log(columns)
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 1) { // 第一列不进行合计操作,通常是序列号或选择框等非数值列。
|
||||
sums[index] = '总计'; // 这里可以设置为其他文字或空字符串。
|
||||
return;
|
||||
} else if (index === 2) { // 第二列是金额列,进行求和操作。
|
||||
sums[index] = '总金额:' + totalMoney.value;
|
||||
// }else if(index === 2){
|
||||
// sums[index] = totalMoney.value
|
||||
} else if (index === 3) {
|
||||
sums[index] = '共存于:' + pcodeCount.value + '个库位'
|
||||
} else if (index === 4) {
|
||||
sums[index] = '总数:' + sumQty.value
|
||||
}
|
||||
})
|
||||
return sums
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.searchBtn {
|
||||
|
||||
Reference in New Issue
Block a user