二级库管理页面代码提交

master
zhangdi 4 months ago
parent 5ee4e7db75
commit 96b8e87ebb
  1. 2
      src/api/materials/expend.js
  2. 10
      src/api/secondOrder/list.js
  3. 13
      src/api/secondOrder/outbound.js
  4. 2
      src/views/firstOrder/components/outDialog.vue
  5. 94
      src/views/materials/expend.vue
  6. 85
      src/views/secondOrder/components/approvalProcessDialog.vue
  7. 207
      src/views/secondOrder/components/outDialog.vue
  8. 121
      src/views/secondOrder/components/recordDialog.vue
  9. 1
      src/views/secondOrder/list.vue
  10. 74
      src/views/secondOrder/outbound.vue

@ -2,7 +2,7 @@ import request from '@/router/axios';
export const getList = (current, size, params) => {
return request({
url: '/smartpark/material/list',
url: '/smartpark/durableForm/list',
method: 'get',
params: {
...params,

@ -15,15 +15,11 @@ export const getList = (current, size, params) => {
}
export const recordList = (current, size, params) => {
export const recordList = params => {
return request({
url: '/smartpark/inventoryRecord/list',
url: '/smartpark/twoInventoryRecord/list',
method: 'get',
params: {
...params,
pageSize:size,
pageNum:current,
},
params: params,
cryptoToken: false,
cryptoData: false
})

@ -40,7 +40,7 @@ export const getUserList = params => {
// 提交
export const submit = data => {
return request({
url: '/smartpark/user/getUserByDeptId',
url: '/smartpark/twoOutStorage/submit',
method: 'post',
data: data,
@ -56,3 +56,14 @@ export const getDetails = params => {
})
}
export const getMaterialList = (params) => {
return request({
url: '/smartpark/consumerForm/getConsumerFormList',
method: 'get',
params: params,
cryptoToken: false,
cryptoData: false
})
}

@ -351,7 +351,7 @@ export default {
} else {
this.$message.warning('未获取到详细数据');
}
},
//
async getDetailedItems() {

@ -20,7 +20,7 @@
>
<template slot-scope="scope" slot="menu">
<el-button
v-if="scope.row.status == '未归还'"
v-if="scope.row.isBorrow == '0'"
type="text"
size="small"
@click.stop="handleReturn(scope.row)"
@ -30,7 +30,7 @@
type="text"
size="small"
@click.stop="handleScrap(scope.row)"
v-if="scope.row.status == '未归还'"
v-if="scope.row.isBorrow == '0'"
>报废
</el-button>
</template>
@ -51,7 +51,6 @@
:rowDta="scrapInfo"
@closeDialog="closeDialog"
></scrapDialog>
</div>
</template>
@ -109,46 +108,57 @@ export default {
column: [
{
label: "编号",
prop: "no",
prop: "materialCode",
headerAlign: "center",
align: "center",
},
{
label: "部门",
prop: "str8",
search: true,
type: "select",
headerAlign: "center",
align: "center",
dicData: [
{
label: "部门一",
value: 0,
},
{
label: "部门二",
value: 1,
},
],
},
// {
// label: "",
// prop: "str8",
// search: true,
// type: "select",
// headerAlign: "center",
// align: "center",
// dicData: [
// {
// label: "",
// value: 0,
// },
// {
// label: "",
// value: 1,
// },
// ],
// },
{
label: "名称",
prop: "name",
prop: "materialName",
search: true,
headerAlign: "center",
align: "center",
},
{
label: "规格型号",
prop: "xh",
prop: "model",
headerAlign: "center",
align: "center",
},
{
label: "类别",
prop: "lb",
prop: "type",
headerAlign: "center",
align: "center",
type: "select",
dicDta: [
{
label: "易耗品",
value: "1",
},
{
label: "耐用品",
value: "2",
},
],
},
{
label: "计量单位",
@ -158,31 +168,46 @@ export default {
},
{
label: "数量",
prop: "number",
prop: "num",
headerAlign: "center",
align: "center",
},
{
label: "单价",
prop: "dj",
prop: "unitPrice",
headerAlign: "center",
align: "center",
},
{
label: "金额",
prop: "pice",
prop: "amount",
headerAlign: "center",
align: "center",
},
{
label: "状态",
prop: "status",
prop: "isBorrow",
headerAlign: "center",
align: "center",
type: "select",
dicDta: [
{
label: "已借出",
value: "0",
},
{
label: "已归还",
value: "1",
},
{
label: "已报废",
value: "2",
},
],
},
{
label: "归还时间",
prop: "time",
prop: "returnTime",
headerAlign: "center",
align: "center",
},
@ -250,6 +275,15 @@ export default {
},
onLoad(page, params = {}) {
this.loading = true;
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.loading = false;
},
//

@ -0,0 +1,85 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
:title="inDialogTiltle"
:visible.sync="inDialogVisible"
:append-to-body="true"
width="20%"
@close="handleCloseDetail"
>
<el-steps class="teps-con" direction="vertical" :active="1">
<el-step
v-for="(item, index) in approvalList"
:title="item.name"
:description="item.time || ''"
></el-step>
</el-steps>
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="handleCloseDetail()"> </el-button>
</span> -->
</el-dialog>
</div>
</template>
<script>
import {
getAllQuarter,
getPurchasesByIds,
getMaterialList,
getDetailList,
} from "@/api/firstOrder/inbound";
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
},
data() {
return {
inDialogVisible: false,
inDialogTiltle: "审批流程",
approvalList: [
{
name: "张三",
time: "2021-01-01 10:10:10",
status: "通过",
},
{
name: "张三1",
time: "",
status: "待审核",
},
{
name: "张三3",
time: "",
status: "待审核",
},
],
};
},
mounted() {
this.inDialogVisible = this.showDialog;
},
methods: {
handleCloseDetail() {
this.inDialogVisible = false;
this.$emit("closeDialog");
},
},
};
</script>
<style lang="scss" scoped>
.form-title {
font-size: 16px;
font-weight: 600;
padding: 18px 0;
}
.teps-con{
margin:0 auto 0
}
:deep(.el-dialog__body) {
height: 300px;
}
</style>

@ -15,13 +15,14 @@
ref="dynamicValidateForm"
label-width="100px"
class="demo-dynamic"
:rules="rules"
>
<div class="form-title">基本信息</div>
<el-row>
<el-col :span="12">
<el-form-item label="出库申请时间">
<el-date-picker
v-model="sizeForm.outDate"
v-model="sizeForm.ldTwoOutStorage.outDate"
type="date"
placeholder="选择日期"
style="width: 100%"
@ -31,17 +32,21 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="事由">
<el-form-item label="事由" prop="ldTwoOutStorage.reason">
<el-input
v-model="sizeForm.argument"
v-model="sizeForm.ldTwoOutStorage.reason"
:disabled="outDialogType != 'add'"
placeholder="请输入"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物资类型">
<el-form-item
label="物资类型"
prop="ldTwoOutStorage.materialType"
>
<el-select
v-model="sizeForm.type"
v-model="sizeForm.ldTwoOutStorage.materialType"
placeholder="请选择"
style="width: 100%"
:disabled="outDialogType != 'add'"
@ -52,57 +57,58 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门">
<el-form-item label="部门" prop="ldTwoOutStorage.departmentInfo">
<el-select
v-model="sizeForm.departmentId"
placeholder="请选择部门"
v-model="sizeForm.ldTwoOutStorage.departmentInfo"
placeholder="请选择"
style="width: 100%"
:disabled="outDialogType != 'add'"
@change="deptChange"
clearable
filterable
value-key="departmentId"
>
<el-option
v-for="item in departmentOptions"
:key="item.departmentId"
:label="item.department"
:value="item.departmentId"
:value="item"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="领用人">
<!-- userOptions -->
<el-form-item label="领用人" prop="ldTwoOutStorage.proposerInfo">
<el-select
v-model="sizeForm.lingyongren"
placeholder="请选择物资名称"
v-model="sizeForm.ldTwoOutStorage.proposerInfo"
placeholder="请选择"
style="width: 100%"
v-if="outDialogType != 'details'"
:disabled="sizeForm.departmentId == ''"
value-key="id"
clearable
filterable
value-key="userId"
@change="proposerChange"
>
<el-option
v-for="item in userOptions"
:key="item.materialId"
:label="item.materialName"
:key="item.userId"
:label="item.name"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="12" v-if="outDialogType == 'details'">
<el-form-item label="填报人">
<el-input
v-model="sizeForm.submitName"
v-model="sizeForm.ldTwoOutStorage.submitName"
:disabled="outDialogType != 'add'"
></el-input>
</el-form-item>
</el-col>
</el-row>
<div class="form-title">{{ outDateInfo }} 出库信息</div>
<el-button
type="primary"
size="mini"
@ -110,14 +116,18 @@
@click="inTableAdd()"
>新增</el-button
>
<el-table :data="sizeForm.inTableData" border style="width: 100%">
<el-table
:data="sizeForm.ldTwoOutStorageDetailList"
border
style="width: 100%"
>
<el-table-column prop="materialCode" label="物资编码" width="100">
</el-table-column>
<el-table-column prop="str2" label="物资名称" width="140">
<template slot-scope="scope">
<el-select
v-model="scope.row.materialitem"
placeholder="请选择物资名称"
placeholder="请选择物"
style="width: 100%"
@change="
handleMaterialChange(scope.row.materialitem, scope.$index)
@ -139,22 +149,17 @@
<el-table-column prop="model" label="规格/型号"> </el-table-column>
<el-table-column prop="type" label="类别"> </el-table-column>
<el-table-column prop="unit" label="单位"> </el-table-column>
<el-table-column prop="str6" label="申请数量"> </el-table-column>
<el-table-column prop="str9" label="已出库"> </el-table-column>
<el-table-column prop="str7" label="出库数量">
<el-table-column prop="num" label="数量">
<template slot-scope="scope">
<el-input-number
size="mini"
v-model="scope.row.str7"
v-model="scope.row.num"
:min="1"
style="width: 100%"
:disabled="outDialogType != 'add'"
v-if="scope.row.str7"
@change="numberChange($event)"
></el-input-number>
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价"> </el-table-column>
</el-table>
<div class="form-title">出库账目表格</div>
<el-table
@ -181,7 +186,7 @@
<el-table-column prop="str4" label="类别"> </el-table-column>
<el-table-column prop="str5" label="单位"> </el-table-column>
<el-table-column prop="str6" label="数量"> </el-table-column>
<el-table-column prop="str7" label="单价"> </el-table-column>
<el-table-column prop="num" label="单价"> </el-table-column>
</el-table-column>
<el-table-column prop="date" label="出库信息">
<el-table-column prop="str8" label="数量"> </el-table-column>
@ -203,8 +208,12 @@
</div>
</template>
<script>
import { getDetailedItems, getMaterialList } from "@/api/firstOrder/outbound";
import { getUserList } from "@/api/secondOrder/outbound";
import { getDetailedItems } from "@/api/firstOrder/outbound";
import {
getUserList,
getMaterialList,
submit,
} from "@/api/secondOrder/outbound";
export default {
props: {
repairVisible: {
@ -224,20 +233,73 @@ export default {
default: "",
},
},
computed: {
outDateInfo() {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, "0");
const day = String(now.getDate()).padStart(2, "0");
return `${year}${month}${day}`;
},
},
data() {
return {
outDialogVisible: false,
sizeForm: {
code: "", //
applyNmae: "", //
submitName: "", //
waNmae: "", //
argument: "", //
inAccountsTableData: [], //
inTableData: [],
departmentId: "", //id
ldTwoOutStorage: {
outDate: "",
reason: "",
materialType: "",
departmentId: "",
department: "",
proposerId: "",
proposerName: "",
submitName: "", //
departmentInfo: null,
proposerInfo: null,
},
ldTwoOutStorageDetailList: [], //
inAccountsTableData: [], //
userInfoVO: {
//
userId: "user001",
name: "张三2",
mainErDepartment: "20",
mainErDepartmentName: "实业公司",
},
},
rules: {
ldTwoOutStorage: {
reason: [
{
required: true,
message: "请填写",
trigger: "blur",
},
],
materialType: [
{
required: true,
message: "请选择",
trigger: "change",
},
],
departmentInfo: [
{
required: true,
message: "请选择",
trigger: "change",
},
],
proposerInfo: [
{
required: true,
message: "请选择",
trigger: "change",
},
],
},
},
inTableData: [],
inBatchDialogVisible: false, //
batchType: "", //
materials: [], //
@ -252,30 +314,27 @@ export default {
} else {
this.inInit();
}
this.getMaterialList();
this.getDetailedItems();
},
methods: {
//
async getMaterialList() {
this.loading = true;
try {
const res = await getMaterialList();
async getMaterialList(value) {
getMaterialList({ departmentId: value }).then((res) => {
this.materials = res.data.result;
} catch (error) {
this.$message.error("获取数据来源失败,请重试");
} finally {
this.loading = false;
}
});
},
//
handleMaterialChange(row, index) {
this.sizeForm.inTableData[index].materialId = row.materialId;
this.sizeForm.inTableData[index].model = row.model;
this.sizeForm.inTableData[index].materialCode = row.materialCode;
this.sizeForm.inTableData[index].materialName = row.materialName;
this.sizeForm.inTableData[index].type = row.type;
this.sizeForm.inTableData[index].unit = row.unit;
this.sizeForm.ldTwoOutStorageDetailList[index].materialId =
row.materialId;
this.sizeForm.ldTwoOutStorageDetailList[index].model = row.model;
this.sizeForm.ldTwoOutStorageDetailList[index].materialCode =
row.materialCode;
this.sizeForm.ldTwoOutStorageDetailList[index].materialName =
row.materialName;
this.sizeForm.ldTwoOutStorageDetailList[index].type = row.type;
this.sizeForm.ldTwoOutStorageDetailList[index].unit = row.unit;
},
//
getUserList(value) {
@ -291,7 +350,17 @@ export default {
},
//
deptChange(value) {
this.getUserList(value);
this.sizeForm.ldTwoOutStorage.proposerInfo = null;
this.sizeForm.ldTwoOutStorage.departmentId = value.departmentId;
this.sizeForm.ldTwoOutStorage.department = value.department;
this.getUserList(value.departmentId);
this.getMaterialList(value.departmentId);
},
//
proposerChange(value) {
console.log('领用人',value);
this.sizeForm.ldTwoOutStorage.proposerId = value.userId;
this.sizeForm.ldTwoOutStorage.proposerName = value.name;
},
handleCloseDetail() {
this.outDialogVisible = false;
@ -300,7 +369,11 @@ export default {
inInit() {},
addInit() {
this.sizeForm.outDate = new Date(); //
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, "0");
const day = String(now.getDate()).padStart(2, "0");
this.sizeForm.ldTwoOutStorage.outDate = `${year}-${month}-${day} 00:00:00`; //
},
handleCloseDetail() {
this.inDialogVisible = false;
@ -308,15 +381,22 @@ export default {
},
//
inTableAdd() {
this.sizeForm.inTableData.push({});
this.sizeForm.ldTwoOutStorageDetailList.push({});
},
//
sumbit() {
this.$message({
type: "success",
message: "提交成功",
console.log("form", this.sizeForm);
this.$refs.dynamicValidateForm.validate((valid) => {
if (valid) {
submit(this.sizeForm).then((res) => {
this.$message({
type: "success",
message: "提交成功",
});
this.handleCloseDetail();
});
}
});
this.handleCloseDetail();
},
},
};
@ -336,5 +416,4 @@ export default {
overflow-y: auto;
padding-right: 10px; /* 预留滚动条空间 */
}
</style>

@ -9,15 +9,16 @@
<el-tabs v-model="transactionType" @tab-click="handleTabClick">
<el-tab-pane label="出库" name="1"></el-tab-pane>
<el-tab-pane label="入库" name="2"></el-tab-pane>
<el-tab-pane label="报废" name="3"></el-tab-pane>
</el-tabs>
<el-table :data="tableData" style="width: 100%">
<el-table-column type="index" width="50"> </el-table-column>
<el-table-column prop="quantity" label="数量"> </el-table-column>
<el-table-column prop="operatorName" label="操作人"> </el-table-column>
<el-table-column prop="operationTime" label="时间"> </el-table-column>
<el-table-column prop="departmentName" label="部门"> </el-table-column>
</el-table>
<avue-crud
:data="data"
:option="option"
v-model:page="page"
@on-load="onLoad"
@current-change="currentChange"
@size-change="sizeChange"
></avue-crud>
</el-dialog>
</template>
<script>
@ -30,43 +31,113 @@ export default {
default: false,
},
rowData:{
rowData: {
type: Object,
default: () => ({})
}
default: () => ({}),
},
},
data() {
return {
openShow: false,
transactionType: "1",
tableData: [],
purchaseTitle:'记录',
purchaseTitle: "记录",
data: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
header: false,
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
selection: true,
viewBtn: false,
addBtn: false,
editBtn: false,
delBtn: false,
dialogClickModal: false,
menu: false,
selection: false,
printBtn: false,
refreshBtn: false,
gridBtn: false,
gridBackgroundImage: false,
gridSpan: false,
filterBtn: false,
columnBtn: false,
menuAlign: "left",
searchMenuPosition: "right",
header: false,
column: [
{
label: "数量",
prop: "quantity",
},
{
label: "单价",
prop: "money",
},
{
label: "操作人",
prop: "operatorName",
},
{
label: "时间",
prop: "operationTime",
},
// {
// label: "",
// prop: "departmentName",
// },
],
},
};
},
mounted() {
this.openShow = this.showDialog;
console.log('二级出入库记录 rowData',this.rowData);
console.log("二级出入库记录 rowData", this.rowData);
},
methods: {
handleTabClick() {
this.tableData = [];
//
if (this.transactionType == "1") {
// recordList().then((res) => {});
}
//
if (this.transactionType == "2") {
// recordList().then((res) => {});
}
//
if (this.transactionType == "3") {
// recordList().then((res) => {});
}
let query_ = {};
this.page.currentPage = 1
this.onLoad(this.page);
},
closeDialog() {
this.openShow = false;
this.$emit("closeDialog");
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad(this.page);
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad(this.page);
},
onLoad(page, params = {}) {
this.loading = true;
let query_ = {
consumerFormId: this.rowData.id,
transactionType: this.transactionType,
currentPage: page.currentPage,
pageSize: page.pageSize,
};
recordList(query_).then((res) => {
this.data = res.data.result.list;
this.loading = false;
this.page.total = res.data.result.total;
});
this.loading = false;
},
},
};
</script>

@ -78,6 +78,7 @@ export default {
columnBtn: false,
menuAlign: "left",
searchMenuPosition: "right",
menuWidth: 100,
column: [
{
label: "部门",

@ -19,8 +19,12 @@
<el-button size="small" @click.stop="handleDesign()" type="primary"
>新增出库单
</el-button>
<!-- <el-button size="small" plain @click.stop="handleExport()">出库单导出
</el-button> -->
</template>
<template #menu="scope">
<el-button type="text" @click.stop="approvalProcessFn(scope.row)"
>审批流程</el-button
>
<el-button type="text" @click.stop="handleDetails(scope.row)">详情</el-button>
</template>
<template slot-scope="scope" slot="xuqiudanmingcheng">
<el-button
@ -50,6 +54,13 @@
@closeDialog="closeDialog"
:purchaseTitle="purchaseTitle"
></needDialog>
<!-- 审批流程 -->
<approvalProcessDialog
:showDialog="approvalProcessShow"
v-if="approvalProcessShow"
@closeDialog="closeDialog"
></approvalProcessDialog>
</basic-container>
</template>
@ -57,11 +68,13 @@
import outDialog from "./components/outDialog.vue";
import needDialog from "./components/needDialog.vue";
import { getList } from "@/api/secondOrder/outbound";
import approvalProcessDialog from "./components/approvalProcessDialog.vue";
export default {
components: {
outDialog,
needDialog,
approvalProcessDialog
},
data() {
return {
@ -91,7 +104,10 @@ export default {
border: true,
index: true,
selection: true,
viewBtn: true,
viewBtn: false,
addBtn: false,
editBtn: false,
delBtn: false,
dialogClickModal: false,
selection: false,
printBtn: false,
@ -101,10 +117,10 @@ export default {
gridSpan: false,
filterBtn: false,
columnBtn: false,
menu: false,
menuAlign: "left",
searchMenuPosition: "right",
excelBtn: true,
menuWidth:140,
column: [
// {
// label: "",
@ -123,32 +139,25 @@ export default {
// },
{
label: "出库单号",
prop: "str2",
prop: "orderNo",
headerAlign: "center",
align: "center",
},
{
label: "出库时间",
prop: "str3",
prop: "outDate",
search: true,
type: "datetime",
headerAlign: "center",
align: "center",
},
{
label: "出库人",
prop: "str4",
search: true,
headerAlign: "center",
align: "center",
},
{
label: "审批人",
prop: "approvers",
headerAlign: "center",
align: "center",
},
// {
// label: "",
// prop: "approvers",
// headerAlign: "center",
// align: "center",
// },
{
label: "状态",
@ -159,16 +168,16 @@ export default {
align: "center",
dicData: [
{
label: "暂存",
value: 1,
label: "未出库",
value:0,
},
{
label: "待审批",
value: 2,
label: "已出库",
value: 1,
},
{
label: "已审批",
value: 3,
label: "已驳回",
value: 2,
},
],
},
@ -178,10 +187,22 @@ export default {
outDialogVisible: false,
outDialogTiltle: "出库",
outDialogType: "",
approvalProcessShow:false,
};
},
methods: {
approvalProcessFn(row) {
this.approvalProcessShow = true;
},
//
handleDetails(row) {
this.outDialogVisible = true
this.outDialogType = 'details'
this.outDialogTiltle = '详情'
this.id = row.id
console.log(this.id,'id')
},
purchaseFn(row) {
this.purchaseOpen = true;
this.purchaseTitle = row.xuqiudanmingcheng + "详情";
@ -194,9 +215,10 @@ export default {
this.outDialogType = "add";
this.outDialogTiltle = "新增出库";
},
//
//
handleCloseDetail() {
this.outDialogVisible = false;
this.onLoad(this.page);
},
handleExport(name) {
this.$message({

Loading…
Cancel
Save