添加dayjs插件,入库记录出库记录,毛坯仓库调整

This commit is contained in:
2024-06-28 15:22:03 +08:00
parent 655d1cce28
commit 14e5a8e85b
6 changed files with 219 additions and 23 deletions

View File

@@ -0,0 +1,150 @@
<template>
<div>
<el-dialog v-bind="$attrs" v-on="$listeners" @open="onOpen" @close="onClose" title="库存记录" width="70%" :close-on-click-modal="false">
<el-form ref="elForm" inline :model="queryParams" :rules="rules" size="medium" :label-width="labelWidth">
<el-form-item label="开始时间" prop="startTime">
<el-date-picker v-model="queryParams.startTime" type="date" placeholder="工单开始时间" :clearable="true"></el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker v-model="queryParams.endTime" type="date" placeholder="工单结束时间" :clearable="true"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
</el-form-item>
</el-form>
<!-- 数据区域 -->
<el-table :data="dataList" v-loading="loading" ref="table" border highlight-current-row>
<el-table-column prop="blankNum" label="毛坯号" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="description" label="产品描述" align="center" width="280" :show-overflow-tooltip="true" />
<el-table-column prop="specification" label="规格" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="changeQuantity" label="变动数量" align="center">
<template slot-scope="scope">
<span style="font-weight: 700;">{{scope.row.type === 1? scope.row.changeQuantity : scope.row.changeQuantity * -1}}</span>
</template>
</el-table-column>
<el-table-column prop="type" label="类别" align="center">
<template slot-scope="scope">
<el-tag effect="plain" v-if="scope.row.type === 1" type="success">增加</el-tag>
<el-tag effect="plain" v-if="scope.row.type === 2" type="danger">减少</el-tag>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注原因" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="createdTime" label="创建时间" align="center" :show-overflow-tooltip="true" />
<!-- <el-table-column label="操作" align="center" width="140">
<template slot-scope="scope">
<el-button size="mini" v-hasPermi="['business:wmblankrecord:delete']" type="danger" icon="el-icon-delete" title="删除" @click="handleDelete(scope.row)"></el-button>
</template>
</el-table-column> -->
</el-table>
<pagination class="mt10" background :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
<div slot="footer">
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="handelConfirm">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listWmBlankRecord,
addWmBlankRecord,
delWmBlankRecord,
updateWmBlankRecord,
getWmBlankRecord,
addInventoryNum,
reduceInventoryNum
} from '@/api/wmsManagement/wmBlankRecord.js';
import {
getWmBlankInventory,
} from '@/api/wmsManagement/wmBlankInventory.js';
export default {
inheritAttrs: false,
data() {
return {
labelWidth: "100px",
formLabelWidth: "100px",
// 遮罩层
loading: false,
// 数据列表
dataList: [],
// 总记录数
total: 0,
// 查询参数
queryParams: {
startTime: null,
endTime: null,
pageNum: 1,
pageSize: 10,
},
rules: {},
typeOptions: [
{ dictLabel: '增加', dictValue: 1 },
{ dictLabel: '减少', dictValue: 2 },
],
}
},
computed: {},
watch: {},
created() {
},
mounted() {
this.initData();
},
methods: {
// 初始化数据
initData() {
this.queryParams.startTime = this.$dayjs().startOf('day');
this.queryParams.endTime = this.$dayjs().endOf('day');
},
// 查询数据
getList() {
// this.loading = true;
// this.queryParams.fkBlankInventoryId = this.ItemData.id;
// // this.queryParams.blankNum = this.ItemData.blankNum;
// listWmBlankRecord(this.queryParams).then(res => {
// if (res.code == 200) {
// this.dataList = res.data.result;
// this.total = res.data.totalNum;
// this.loading = false;
// } else {
// this.loading = false;
// }
// }).catch(() => {
// this.loading = false;
// })
},
onOpen() {
this.dataList = [];
this.getList();
},
onClose() {
this.$refs['elForm'].resetFields()
},
close() {
this.$emit('update:visible', false)
},
emitRefresh() {
this.$emit("refresh");
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
handelConfirm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
this.submitForm();
this.close()
})
},
submitForm() {
}
}
}
</script>
<style>
</style>