优化
This commit is contained in:
@@ -50,6 +50,9 @@
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="outboundList" @selection-change="printSelectionChange" border
|
||||
ref="infoTableRef"
|
||||
highlight-current-row
|
||||
@row-click="(row) => tableInfoRowClick(row, infoTableRef)"
|
||||
show-overflow-tooltip>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
|
||||
@@ -100,7 +103,7 @@
|
||||
<printBill :billAllObj="printList" />
|
||||
</div>
|
||||
<!-- 添加或修改库存单据主对话框 -->
|
||||
<el-dialog :title="title" v-model="open" append-to-body width="70%">
|
||||
<el-dialog :title="title" v-model="open" width="70%" :z-index="4" :close-on-click-modal="false" :draggable="true">
|
||||
<el-form ref="stockRef" :model="storeData" :rules="rules">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
@@ -240,30 +243,11 @@ import { addOutbound } from "@/api/wisdom/outbound"
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const outboundList = ref([]);
|
||||
const open = ref(false);
|
||||
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const planList = ref([]); //从供应计划中添加列表
|
||||
|
||||
const storeTypeList = ref([]); //出库类型下拉数据
|
||||
const wzTypeList = ref([]); //施工队下拉数据
|
||||
|
||||
const personList = ref([]); //理货员下拉数据
|
||||
const orderNum = ref("") //搜索条件:订单号
|
||||
const showContent = ref(false); // 控制打印内容是否显示
|
||||
const dateStr = ref("") //打印单据生成的日期
|
||||
const printList = ref([]) //要打印的数据列表
|
||||
const kwOptions = ref([]); //库位下拉
|
||||
const borrowTime = ref([])
|
||||
const data = reactive({
|
||||
form: {},
|
||||
storeData: {
|
||||
ckType: "JLCK"
|
||||
}, //借料数据
|
||||
@@ -294,8 +278,6 @@ const data = reactive({
|
||||
printViewInfo: {
|
||||
id: "printMe", //打印区域的唯一的id属性
|
||||
popTitle: '入库信息打印',
|
||||
|
||||
|
||||
beforeOpenCallback() {
|
||||
showContent.value = false;
|
||||
}, // 开始打印之前的callback
|
||||
@@ -308,13 +290,12 @@ const data = reactive({
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, storeData, rules, form, printViewInfo, outQueryParams } = toRefs(data);
|
||||
const { queryParams, storeData, rules, printViewInfo, outQueryParams } = toRefs(data);
|
||||
|
||||
const statusList = ref([
|
||||
{ value: 1, label: '未还料', elTagType: "danger", elTagClass: null },
|
||||
{ value: 2, label: '已还料', elTagType: "primary", elTagClass: null }
|
||||
])
|
||||
|
||||
const dictTagData = () => {
|
||||
return statusList.value.map(item => ({
|
||||
...item,
|
||||
@@ -323,6 +304,10 @@ const dictTagData = () => {
|
||||
}
|
||||
|
||||
/** 查询库存单据主列表 */
|
||||
const outboundList = ref([]);
|
||||
const infoTableRef = ref(null);
|
||||
const loading = ref(true);
|
||||
const total = ref(0);
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listStock({ ...queryParams.value, bizType: '2' }).then(response => {
|
||||
@@ -333,23 +318,8 @@ function getList() {
|
||||
}
|
||||
getList();
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
planList.value = []
|
||||
storeData.value = {
|
||||
ckType: "JLCK"
|
||||
}
|
||||
orderNum.value = ""
|
||||
proxy.resetForm("stockRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const borrowTime = ref([])
|
||||
function handleQuery() {
|
||||
if (borrowTime.value && borrowTime.value.length > 0) {
|
||||
queryParams.value.startDate = borrowTime.value[0]
|
||||
@@ -369,56 +339,44 @@ function resetQuery() {
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
//出库 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(info => info.id)
|
||||
}
|
||||
//打印单据 多选框选中数据
|
||||
function printSelectionChange(selection) {
|
||||
printList.value = selection
|
||||
queryParams.value.ids = selection.map(item => item.id)
|
||||
// console.log(queryParams.value.ids)
|
||||
}
|
||||
//打印单据
|
||||
function handlePrint() {
|
||||
if (printList.value.length == 0) {
|
||||
proxy.$modal.msgError("请勾选数据");
|
||||
return
|
||||
}
|
||||
const date = new Date();
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1; // 月份从0开始,需要加1
|
||||
const day = date.getDate();
|
||||
const hour = date.getHours();
|
||||
const minute = date.getMinutes();
|
||||
const second = date.getSeconds();
|
||||
dateStr.value = year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second
|
||||
showContent.value = true
|
||||
//获取出库类型下拉数据
|
||||
const storeTypeList = ref([]); //出库类型下拉数据
|
||||
const getOutTypeList = () => {
|
||||
listOuttype({ pageNum: 1, pageSize: 50 }).then(response => {
|
||||
storeTypeList.value = response.rows
|
||||
})
|
||||
}
|
||||
getOutTypeList()
|
||||
|
||||
// 获取施工队下拉数据
|
||||
const wzTypeList = ref([]); //施工队下拉数据
|
||||
const getConstructionList = () => {
|
||||
listConstruction({ pageNum: 1, pageSize: 50 }).then(response => {
|
||||
wzTypeList.value = response.rows
|
||||
})
|
||||
}
|
||||
getConstructionList()
|
||||
|
||||
// 获取理货员下拉数据
|
||||
const personList = ref([]); //理货员下拉数据
|
||||
const getPersonList = () => {
|
||||
personListDict().then(response => {
|
||||
personList.value = response.data
|
||||
})
|
||||
}
|
||||
getPersonList()
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const open = ref(false);
|
||||
const title = ref("");
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加借料单据";
|
||||
//获取出库类型下拉数据
|
||||
listOuttype({ pageNum: 1, pageSize: 50 }).then(response => {
|
||||
storeTypeList.value = response.rows
|
||||
})
|
||||
//获取施工队下拉数据
|
||||
listConstruction({ pageNum: 1, pageSize: 50 }).then(response => {
|
||||
wzTypeList.value = response.rows
|
||||
})
|
||||
|
||||
//理货员下拉数据
|
||||
personListDict().then(response => {
|
||||
personList.value = response.data
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
//查询库存中数据 搜索
|
||||
const planList = ref([]); //从供应计划中添加列表
|
||||
function searchPlan() {
|
||||
if (!outQueryParams.value.xmNo && !outQueryParams.value.wlNo && !outQueryParams.value.sapNo) {
|
||||
proxy.$modal.msgWarning("查询条件不能为空");
|
||||
@@ -435,15 +393,17 @@ function searchPlan() {
|
||||
planList.value = response.rows
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
//出库 多选框选中数据
|
||||
const ids = ref([]);
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(info => info.id)
|
||||
}
|
||||
|
||||
/** 借料出库 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["stockRef"].validate(valid => {
|
||||
|
||||
if (valid) {
|
||||
if (ids.value.length == 0) {
|
||||
proxy.$modal.msgError("请勾选数据");
|
||||
@@ -476,6 +436,46 @@ function submitForm() {
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
planList.value = []
|
||||
storeData.value = {
|
||||
ckType: "JLCK"
|
||||
}
|
||||
proxy.resetForm("stockRef");
|
||||
}
|
||||
|
||||
//打印单据 多选框选中数据
|
||||
const printList = ref([]) //要打印的数据列表
|
||||
function printSelectionChange(selection) {
|
||||
printList.value = selection
|
||||
}
|
||||
|
||||
//打印单据
|
||||
const dateStr = ref("") //打印单据生成的日期
|
||||
const showContent = ref(false); // 控制打印内容是否显示
|
||||
function handlePrint() {
|
||||
if (printList.value.length == 0) {
|
||||
proxy.$modal.msgError("请勾选数据");
|
||||
return
|
||||
}
|
||||
const date = new Date();
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1; // 月份从0开始,需要加1
|
||||
const day = date.getDate();
|
||||
const hour = date.getHours();
|
||||
const minute = date.getMinutes();
|
||||
const second = date.getSeconds();
|
||||
dateStr.value = year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second
|
||||
showContent.value = true
|
||||
}
|
||||
|
||||
const returnId = ref([])
|
||||
const returnData = ref({})
|
||||
const returnOpen = ref(false)
|
||||
@@ -525,60 +525,12 @@ function warehouseFun() {
|
||||
})
|
||||
}
|
||||
warehouseFun()
|
||||
//库位字典
|
||||
function pcodeList(value) {
|
||||
console.log(value)
|
||||
getKwAllList(value[1]).then(response => {
|
||||
kwOptions.value = response.data
|
||||
returnData.value.pcode = ""
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-table .warning-row {
|
||||
--el-table-tr-bg-color: var(--el-color-warning-light-9);
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
--el-table-tr-bg-color: var(--el-color-success-light-9);
|
||||
}
|
||||
|
||||
.titleBox {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.printMeBox {
|
||||
div {
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.topBox {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.topEveryBox {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.tableBox {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.oneLineBox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.everyBox {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.bottomBox {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user