wangmeng 4 months ago
commit 036284a700
  1. 1
      src/api/firstOrder/inbound.js
  2. 4
      src/api/firstOrder/outbound.js
  3. 11
      src/api/materials/expend.js
  4. 11
      src/api/materials/index.js
  5. 4
      src/views/demandOrder/index.vue
  6. 269
      src/views/firstOrder/components/consumableDialog.vue
  7. 546
      src/views/firstOrder/components/inDialog.vue
  8. 577
      src/views/firstOrder/components/outDialog.vue
  9. 86
      src/views/firstOrder/list.vue
  10. 65
      src/views/materials/components/returnDialog.vue
  11. 56
      src/views/materials/components/scrapDialog.vue
  12. 14
      src/views/materials/expend.vue
  13. 48
      src/views/materials/index.vue
  14. 11
      src/views/purchaseOrders/index.vue
  15. 12
      src/views/secondOrder/outbound.vue

@ -72,7 +72,6 @@ export const submitData = (sizeForm) => {
})
}
export const editList = (onePutStorageId) => {
console.log('api中的数据',onePutStorageId)
return request({
url: '/smartpark/onePutStorage/detail',
method: 'get',

@ -57,10 +57,12 @@ export const submitData = (sizeForm) => {
cryptoData: false
})
}
export const getMaterialList = () => {
export const getMaterialList = (optionType) => {
console.log('api中的数据', optionType)
return request({
url: '/smartpark/oneForm/getPutOneFormList',
method: 'get',
params: optionType,
cryptoToken: false,
cryptoData: false
})

@ -13,3 +13,14 @@ export const getList = (current, size, params) => {
cryptoData: false
})
}
//归还和报废
export const returnMaterial = (LdDurableFormDto) => {
console.log(LdDurableFormDto,'api传的參')
return request({
url: '/smartpark/durableForm/restoreAndScrap ',
method: 'post',
data: LdDurableFormDto,
cryptoToken: false,
cryptoData: false
})
}

@ -0,0 +1,11 @@
import request from '@/router/axios';
export const upload = (file) => {
return request({
url: '/smartpark/material/upload ',
method: 'post',
data: file,
cryptoToken: false,
cryptoData: false
})
}

@ -61,8 +61,8 @@ export default {
label: "提交时间",
prop: "optTime",
type: "date",
format: "yyyy-MM-dd",
valueFormat: "yyyy-MM-dd",
format: "yyyy-MM-dd HH:mm:ss",
valueFormat: "yyyy-MM-dd HH:mm:ss",
headerAlign: "center",
align: "center",
},

@ -0,0 +1,269 @@
<template>
<el-dialog :close-on-click-modal="false" :title="demandDialogTitle" :visible.sync="consumableVisible"
:append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen>
<basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form"
:page.sync="page" :permission="permissionList" @row-del="rowDel" @search-change="searchChange"
@search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
@size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
@row-change="handleRowChange">
<!-- <template slot-scope="scope" slot="menu">
<el-button type="text" size="small" @click.stop="handleLog(scope.row)">记录
</el-button>
</template> -->
</avue-crud>
</basic-container>
</el-dialog>
</template>
<script>
import { getList, recordList } from "@/api/firstOrder/list";
export default {
props: {
consumableVisible: {
type: Boolean,
default: false
},
demandDialogTitle: {
type: String,
default: ''
},
},
data() {
return {
form: {},
selectionList: [],
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
height: "auto",
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 12,
border: true,
index: true,
selection: true,
viewBtn: true,
dialogClickModal: false,
menu: true,
printBtn: false,
refreshBtn: false,
gridBtn: false,
gridBackgroundImage: false,
gridSpan: false,
filterBtn: false,
columnBtn: false,
menuAlign: "left",
searchMenuPosition: "right",
menuWidth: 80,
column: [
{
label: "存货编号",
prop: "materialCode",
headerAlign: "center",
align: "center",
},
{
label: "存货名称",
prop: "materialName",
search: true,
headerAlign: "center",
align: "left",
},
{
label: "规格型号",
prop: "model",
headerAlign: "center",
align: "left",
},
{
label: "类别",
prop: "type",
search: true,
type: "select",
headerAlign: "center",
align: "center",
dicData: [
{
label: "易耗品",
value: "YH",
},
{
label: "耐用品",
value: "NY",
},
],
},
{
label: "计量单位",
prop: "unit",
headerAlign: "center",
align: "center",
},
{
label: "数量",
prop: "num",
headerAlign: "center",
align: "center",
},
{
label: "单价",
prop: "unitPrice",
headerAlign: "center",
align: "center",
},
{
label: "金额",
prop: "amount",
headerAlign: "center",
align: "center",
},
{
label: "描述",
prop: "remark",
headerAlign: "center",
align: "center",
formatter: (row, column) => {
const value = row.remark;
if (value === null || value === undefined || value === "") {
return "无";
}
return value;
}
},
],
},
data: [],
dialogLogVisible: false,
transactionType: "1",
tableData: [],
ckTable: [],
rkTable: [],
currentRow: null,
};
},
computed: {
permissionList() {
return {
addBtn: false,
viewBtn: false,
delBtn: false,
editBtn: false,
};
},
ids() {
let ids = [];
this.selectionList.forEach((ele) => {
ids.push(ele.id);
});
return ids.join(",");
},
},
mounted() {
this.consumableVisible = this.consumableVisible
},
methods: {
formatTime(row, column, cellValue) {
if (!cellValue) return '';
const date = new Date(cellValue);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
async handleLog(row) {
this.dialogLogVisible = true;
this.currentRow = row;
this.loadTransactionData();
},
handleTabClick() {
this.loadTransactionData();
},
async loadTransactionData() {
if (!this.currentRow) return;
const params = {
oneFromId: this.currentRow.id,
transactionType: this.transactionType
};
const pageNum = this.page.currentPage;
const pageSize = this.page.pageSize;
this.loading = true;
try {
const res = await recordList(
pageNum,
pageSize,
Object.assign({}, this.query, params)
);
if (this.transactionType === "1") {
this.ckTable = res.data.result.list;
} else {
this.rkTable = res.data.result.list;
}
this.tableData = res.data.result.list;
} catch (error) {
this.$message.error(error.message);
} finally {
this.loading = false;
}
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
//
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
handleRowChange(row, index, data) {
console.log('Selected data:', data);
},
currentChange(currentPage) {
this.handleRowChange()
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
getList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
).then((res) => {
// const data = res.data.data;
this.data = res.data.result.list;
this.loading = false;
this.page.total = res.data.result.total;
// this.selectionClear();
});
this.loading = false;
},
},
}
</script>

@ -1,291 +1,301 @@
<template>
<div>
<el-dialog :close-on-click-modal="false" :title="inDialogTiltle" :visible.sync="inDialogVisible"
:append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen>
:append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen class="dialog-container">
<!-- 基本信息 -->
<el-form :model="sizeForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<div class="form-title"> 基本信息</div>
<el-row>
<el-col :span="12" v-show="sizeForm.options == 1 && inDialogType != 'add'">
<el-form-item label="入库单号">
<el-input v-model="sizeForm.orderNo" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库时间">
<el-date-picker v-model="sizeForm.inDate" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date"
placeholder="选择日期" style="width: 100%;" disabled>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="事由">
<el-input v-model="sizeForm.reason" :disabled="inDialogType == 'details'"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物资类型">
<el-select v-model="sizeForm.materialType" placeholder="请选择" style="width: 100%;"
:disabled="inDialogType == 'details'">
<el-option label="办公物资" value="1"></el-option>
<el-option label="其他物资" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="source" label="来源">
<el-select v-model="sizeForm.source" placeholder="请选择" style="width: 100%;"
:disabled="inDialogType == 'details'">
<el-option label="采购申请" value="cg"></el-option>
<el-option label="其他来源" value="qt"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="选项">
<el-radio-group v-model="sizeForm.option" @change="radioChange()" :disabled="inDialogType == 'details'">
<el-radio :label="1">批量选择</el-radio>
<el-radio :label="2">单项选择</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-if="sizeForm.option == 1">
<el-form-item label="采购单名称">
<el-input v-model="sizeForm.quarterName" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<div class="form-title">{{ inDate }}</div>
<el-button type="primary" size="mini" style="margin-bottom: 18px;" @click="inTableAdd()"
v-if="!allDisabled && sizeForm.option == 2">新增</el-button>
<!-- 批量选择 -->
<el-table :data="sizeForm.inTableData" border style="width: 100%" v-show="sizeForm.option == 1">
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="materialName" label="物资名称">
</el-table-column>
<el-table-column prop="model" label="规格">
</el-table-column>
<el-table-column prop="unit" label="单位">
</el-table-column>
<el-table-column prop="type" label="类别">
<template slot-scope="scope">
<el-select v-model="scope.row.type" placeholder="请选择" style="width: 100%;"
:disabled="inDialogType == 'details'" @change="handleTypeChange(scope.row)"
v-if='inDialogType != "details"'>
<el-option label="耐用品" value="NY"></el-option>
<el-option label="易耗品" value="YH"></el-option>
</el-select>
<span v-else>{{ scope.row.type == 'NY' ? '耐用品' : '易耗品' }}</span>
</template>
</el-table-column>
<el-table-column prop="requiredQuantity" label="计划采购数量" v-if="sizeForm.option == 1">
<template slot-scope="scope">
{{ scope.row.requiredQuantity || 0 }}
</template>
</el-table-column>
<el-table-column prop="inboundQuantity" label="已入库数量" v-if="sizeForm.option == 1">
<template slot-scope="scope">
{{ scope.row.inboundQuantity || 0 }}
</template>
</el-table-column>
<el-table-column prop="theInboundQuantity" label="本次入库数量">
<template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.theInboundQuantity" :min="0" style="width: 100%;"
@change="syncInboundQuantity(scope.row)" v-if='inDialogType != "details"'></el-input-number>
<span v-else>{{ scope.row.theInboundQuantity === undefined ? 0 : scope.row.theInboundQuantity }}</span>
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.unitPrice" :min="0" style="width: 100%;"
@change="syncUnitPrice(scope.row)"
v-if='inDialogType != "details" && scope.row.type !== "YH"'></el-input-number>
<span v-else-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>
</el-table-column>
</el-table>
<!-- 单项选择 -->
<el-table :data="sizeForm.singleData" border style="width: 100%" v-show="sizeForm.option == 2" align="center">
<el-table-column prop="materialCode" label="物资编码"></el-table-column>
<el-table-column prop="materialName" label="物资名称">
<template slot-scope="scope">
<el-select v-model="scope.row.materialId" placeholder="请选择物资名称" style="width: 100%;"
@change="handleMaterialChange(scope.row)" v-if='inDialogType != "details"'>
<el-option v-for="item in materials" :key="item.materialId" :label="item.materialName"
:value="item.materialId">
</el-option>
</el-select>
<span v-else> {{ scope.row.materialName }}</span>
</template>
</el-table-column>
<el-table-column prop="model" label="物资规格"></el-table-column>
<el-table-column prop="type" label="类别 ">
<template slot-scope="scope">
<el-select v-model="scope.row.type" placeholder="请选择" style="width: 100%;"
@change="handleTypeChange(scope.row)" v-if='inDialogType !== "details"'>
<el-option label="耐用品" value="NY"></el-option>
<el-option label="易耗品" value="YH"></el-option>
</el-select>
<span v-else>{{ scope.row.type == 'NY' ? '耐用品' : '易耗品' }}</span>
</template>
</el-table-column>
<el-table-column prop="unit" label="单位"></el-table-column>
<el-table-column prop="requiredQuantity" label="计划采购数量" v-if="sizeForm.option == 1">
<template slot-scope="scope">
{{ scope.row.requiredQuantity || 0 }}
</template>
</el-table-column>
<el-table-column prop="inboundQuantity" label="已入库数量" v-if="sizeForm.option == 1">
</el-table-column>
<el-table-column prop="theInboundQuantity" label="本次入库数量">
<template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.theInboundQuantity" :min="0" style="width: 100%;"
@change="syncInboundQuantity(scope.row)" v-if='inDialogType != "details"'></el-input-number>
<span v-else>{{ scope.row.theInboundQuantity || 0 }}</span>
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.unitPrice" :min="0" style="width: 100%;"
@change="syncUnitPrice(scope.row)"
v-if='inDialogType != "details" && scope.row.type !== "YH"'></el-input-number>
<span v-else-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>
</el-table-column>
</el-table>
<!-- 入库账目表格 -->
<div class="form-title" v-if="inDialogType !== 'details'">入库账目表格</div>
<!-- 批量选择 -->
<el-table :data="sizeForm.inTableData" border style="width: 100%"
v-show="sizeForm.option == 1 && inDialogType !== 'details'">
<el-table-column prop="date" label="当前库存">
<div class="dialog-content">
<el-form :model="sizeForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic" :rules="rules">
<div class="form-title"> 基本信息</div>
<el-row>
<el-col :span="12" v-show="sizeForm.options == 1 && inDialogType != 'add'">
<el-form-item label="入库单号">
<el-input v-model="sizeForm.orderNo" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="入库时间">
<el-date-picker v-model="sizeForm.inDate" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date"
placeholder="选择日期" style="width: 100%;" disabled>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="事由">
<el-input v-model="sizeForm.reason" :disabled="inDialogType == 'details'"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物资类型">
<el-select v-model="sizeForm.materialType" placeholder="请选择" style="width: 100%;"
:disabled="inDialogType == 'details'">
<el-option label="办公物资" value="1"></el-option>
<el-option label="其他物资" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="source" label="来源">
<el-select v-model="sizeForm.source" placeholder="请选择" style="width: 100%;"
:disabled="inDialogType == 'details'">
<el-option label="采购申请" value="cg"></el-option>
<el-option label="其他来源" value="qt"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="选项">
<el-radio-group v-model="sizeForm.option" @change="radioChange()" :disabled="inDialogType == 'details'">
<el-radio :label="1">批量选择</el-radio>
<el-radio :label="2">单项选择</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-if="sizeForm.option == 1">
<el-form-item label="采购单名称">
<el-input v-model="sizeForm.quarterName" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<div class="form-title">{{ inDate }}</div>
<el-button type="primary" size="mini" style="margin-bottom: 18px;" @click="inTableAdd()"
v-if="!allDisabled && sizeForm.option == 2">新增</el-button>
<!-- 批量选择 -->
<el-table :data="sizeForm.inTableData" border style="width: 100%" v-show="sizeForm.option == 1">
<el-table-column prop="inboundDetailCode" label="入库明细单号">
</el-table-column>
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="materialName" label="物资名称">
</el-table-column>
<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="type" label="类别">
<template slot-scope="scope">
{{ scope.row.type === "NY" ? "耐用品" : (scope.row.type === "YH" ? "易耗品" : "") }}
<el-select v-model="scope.row.type" placeholder="请选择" style="width: 100%;"
:disabled="inDialogType == 'details'" @change="handleTypeChange(scope.row)"
v-if='inDialogType != "details"'>
<el-option label="耐用品" value="NY"></el-option>
<el-option label="易耗品" value="YH"></el-option>
</el-select>
<span v-else>{{ scope.row.type == 'NY' ? '耐用品' : '易耗品' }}</span>
</template>
</el-table-column>
<el-table-column prop="inboundQuantity" label="数量">
<el-table-column prop="requiredQuantity" label="计划采购数量" v-if="sizeForm.option == 1">
<template slot-scope="scope">
{{ scope.row.inboundQuantity || 0 }}
{{ scope.row.requiredQuantity || 0 }}
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<el-table-column prop="inboundQuantity" label="已入库数量" v-if="sizeForm.option == 1">
<template slot-scope="scope">
<span v-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
{{ scope.row.inboundQuantity || 0 }}
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="入库信息">
<el-table-column prop="theInboundQuantity" label="数量">
<el-table-column prop="theInboundQuantity" label="本次入库数量">
<template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.theInboundQuantity" :min="0" style="width: 100%;"
@change="syncInboundQuantity(scope.row)" v-if='inDialogType != "details"'></el-input-number>
<span v-else>{{ scope.row.theInboundQuantity === undefined ? 0 : scope.row.theInboundQuantity }}</span>
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<span v-if='scope.row.type === "YH"'>-</span>
<el-input-number size="mini" v-model="scope.row.unitPrice" :min="0" style="width: 100%;"
@change="syncUnitPrice(scope.row)"
v-if='inDialogType != "details" && scope.row.type !== "YH"'></el-input-number>
<span v-else-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="入库后库存">
<el-table-column label="数量">
<template slot-scope="scope">
{{ Number(scope.row.inboundQuantity || 0) + Number(scope.row.theInboundQuantity || 0) }}
</template>
</el-table>
<!-- 单项选择 -->
<el-table :data="sizeForm.singleData" border style="width: 100%" v-show="sizeForm.option == 2" align="center">
<el-table-column prop="inboundDetailCode" label="入库明细单号">
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<el-table-column prop="materialCode" label="物资编码"></el-table-column>
<el-table-column prop="materialName" label="物资名称">
<template slot-scope="scope">
<span v-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>s
<el-select v-model="scope.row.materialId" placeholder="请选择物资名称" style="width: 100%;"
@change="handleMaterialChange(scope.row)" v-if='inDialogType != "details"'>
<el-option v-for="item in materials" :key="item.materialId" :label="item.materialName"
:value="item.materialId">
</el-option>
</el-select>
<span v-else> {{ scope.row.materialName }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="入库信息">
<el-table-column label="入库人">
<el-table-column prop="model" label="物资规格"></el-table-column>
<el-table-column prop="type" label="类别 ">
<template slot-scope="scope">
{{ scope.row.userInfoVO ? scope.row.userInfoVO.name : sizeForm.userInfoVO.name }}
<el-select v-model="scope.row.type" placeholder="请选择" style="width: 100%;"
@change="handleTypeChange(scope.row)" v-if='inDialogType !== "details"'>
<el-option label="耐用品" value="NY"></el-option>
<el-option label="易耗品" value="YH"></el-option>
</el-select>
<span v-else>{{ scope.row.type == 'NY' ? '耐用品' : '易耗品' }}</span>
</template>
</el-table-column>
<el-table-column prop="inDate" label="入库时间" width="150">
<el-table-column prop="unit" label="单位"></el-table-column>
<el-table-column prop="requiredQuantity" label="计划采购数量" v-if="sizeForm.option == 1">
<template slot-scope="scope">
{{ inDate }}
{{ scope.row.requiredQuantity || 0 }}
</template>
</el-table-column>
</el-table-column>
</el-table>
<!-- 单项选择 -->
<el-table :data="sizeForm.singleData" border style="width: 100%"
v-show="sizeForm.option == 2 && inDialogType !== 'details'">
<el-table-column prop="date" label="当前库存">
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="materialName" label="物资名称">
<el-table-column prop="inboundQuantity" label="已入库数量" v-if="sizeForm.option == 1">
</el-table-column>
<el-table-column prop="model" label="规格"></el-table-column>
<el-table-column prop="type" label="类别">
<el-table-column prop="theInboundQuantity" label="本次入库数量">
<template slot-scope="scope">
{{ scope.row.type === "NY" ? "耐用品" : (scope.row.type === "YH" ? "易耗品" : "") }}
<el-input-number size="mini" v-model="scope.row.theInboundQuantity" :min="0" style="width: 100%;"
@change="syncInboundQuantity(scope.row)" v-if='inDialogType != "details"'></el-input-number>
<span v-else>{{ scope.row.theInboundQuantity || 0 }}</span>
</template>
</el-table-column>
<el-table-column prop="unit" label="单位"></el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<span v-if='scope.row.type === "YH"'>-</span>
<el-input-number size="mini" v-model="scope.row.unitPrice" :min="0" style="width: 100%;"
@change="syncUnitPrice(scope.row)"
v-if='inDialogType != "details" && scope.row.type !== "YH"'></el-input-number>
<span v-else-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="入库信息">
<el-table-column prop="theInboundQuantity" label="数量">
</el-table>
<!-- 入库账目表格 -->
<div class="form-title" v-if="inDialogType !== 'details'">入库账目表格</div>
<!-- 批量选择 -->
<el-table :data="sizeForm.inTableData" border style="width: 100%"
v-show="sizeForm.option == 1 && inDialogType !== 'details'">
<el-table-column prop="date" label="当前库存">
<el-table-column prop="inboundDetailCode" label="入库明细单号">
</el-table-column>
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="materialName" label="物资名称">
</el-table-column>
<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="type" label="类别">
<template slot-scope="scope">
{{ scope.row.type === "NY" ? "耐用品" : (scope.row.type === "YH" ? "易耗品" : "") }}
</template>
</el-table-column>
<el-table-column prop="inboundQuantity" label="数量">
<template slot-scope="scope">
{{ scope.row.inboundQuantity || 0 }}
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<span v-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<span v-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>
<el-table-column prop="date" label="入库信息">
<el-table-column prop="theInboundQuantity" label="数量">
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<span v-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="入库后库存">
<el-table-column label="数量">
<template slot-scope="scope">
{{ Number(scope.row.inboundQuantity || 0) + Number(scope.row.theInboundQuantity || 0) }}
</template>
<el-table-column prop="date" label="入库后库存">
<el-table-column label="数量">
<template slot-scope="scope">
{{ Number(scope.row.inboundQuantity || 0) + Number(scope.row.theInboundQuantity || 0) }}
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<span v-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>s
</el-table-column>
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<span v-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>
<el-table-column prop="date" label="入库信息">
<el-table-column label="入库人">
<template slot-scope="scope">
{{ scope.row.userInfoVO ? scope.row.userInfoVO.name : sizeForm.userInfoVO.name }}
</template>
</el-table-column>
<el-table-column prop="inDate" label="入库时间" width="150">
<template slot-scope="scope">
{{ inDate }}
</template>
</el-table-column>
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="入库信息">
<el-table-column label="入库人">
<template slot-scope="scope">
{{ scope.row.userInfoVO ? scope.row.userInfoVO.name : sizeForm.userInfoVO.name }}
</template>
</el-table>
<!-- 单项选择 -->
<el-table :data="sizeForm.singleData" border style="width: 100%"
v-show="sizeForm.option == 2 && inDialogType !== 'details'">
<el-table-column prop="date" label="当前库存">
<el-table-column prop="inboundDetailCode" label="入库明细单号">
</el-table-column>
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="materialName" label="物资名称">
</el-table-column>
<el-table-column prop="model" label="规格"></el-table-column>
<el-table-column prop="type" label="类别">
<template slot-scope="scope">
{{ scope.row.type === "NY" ? "耐用品" : (scope.row.type === "YH" ? "易耗品" : "") }}
</template>
</el-table-column>
<el-table-column prop="unit" label="单位"></el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<span v-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="inDate" label="入库时间" width="150">
<template slot-scope="scope">
{{ inDate }}
</template>
<el-table-column prop="date" label="入库信息">
<el-table-column prop="theInboundQuantity" label="数量">
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<span v-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="入库后库存">
<el-table-column label="数量">
<template slot-scope="scope">
{{ Number(scope.row.inboundQuantity || 0) + Number(scope.row.theInboundQuantity || 0) }}
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<span v-if='scope.row.type === "YH"'>-</span>
<span v-else>{{ scope.row.unitPrice || 0 }}</span>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
</el-table>
</el-form>
<el-table-column prop="date" label="入库信息">
<el-table-column label="入库人">
<template slot-scope="scope">
{{ scope.row.userInfoVO ? scope.row.userInfoVO.name : sizeForm.userInfoVO.name }}
</template>
</el-table-column>
<el-table-column prop="inDate" label="入库时间" width="150">
<template slot-scope="scope">
{{ inDate }}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-form>
</div>
<span slot="footer" class="dialog-footer" v-if="!allDisabled">
<el-button @click="handleCloseDetail()"> </el-button>
<el-button type="primary" @click="submit(1)">暂存</el-button>
@ -296,7 +306,7 @@
<!-- 批量出库 选择 -->
<el-dialog :close-on-click-modal="false" title="选择数据来源" :visible.sync="inBatchDialogVisible" :append-to-body="true"
width="40%" @close="handleBatchClose" @open="getBatchOptions">
<el-select v-model="batchType" placeholder="请选择数据来源" style="width: 100%;">
<el-select v-model="batchType" placeholder="请选择数据来源" style="width: 100%;" :clearable="true">
<el-option v-for="item in batchOptions" :key="item.ids" :label="item.quarterName" :value="item.ids">
</el-option>
</el-select>
@ -337,8 +347,6 @@ export default {
inDialogVisible: false,
sizeForm: {
orderNo: '',//
// applyNmae: 'user1',//
// submitName: '',//
reason: '',//
inDate: '',//
inAccountsTableData: [],//
@ -353,16 +361,18 @@ export default {
purchaseEndInfo: '',//
userInfoVO: {
userId: "用户ID",
name: "用户名称"
name: "用户名称",
mainErDepartment: "1",
mainErDepartmentName: "主管部门名称",
},
ldOnePutStorageDetailVOList: [],//
},
inTableData: [],
// singleData: {},
inBatchDialogVisible: false,//
batchType: '',//
materialsType: '',
allDisabled: false,
}
},
computed: {
@ -425,7 +435,6 @@ export default {
try {
const res = await editList(this.id);
const { ldOnePutStorage, ldOnePutStorageDetailList = [] } = res.data.result || {};
if (!ldOnePutStorage) {
this.$message.error("回显数据异常");
return;
@ -446,17 +455,12 @@ export default {
} else {
this.sizeForm.singleData = handledDetailList;
}
} catch (error) {
console.error("回显失败:", error);
this.$message.error("获取详情数据失败");
}
}
},
addInit() {
//
// const randomNum = Math.floor(Math.random() * 100000000) + 1;
// this.sizeForm.orderNo = String(randomNum).padStart(8, '0');//
this.sizeForm.inDate = new Date()//
this.sizeForm.inTableData.theInboundQuantity = 0
},
@ -478,7 +482,6 @@ export default {
unitPrice: 0,
})
} else {
// singleData
if (!Array.isArray(this.sizeForm.singleData)) {
this.sizeForm.singleData = [];
}
@ -486,7 +489,7 @@ export default {
unit: '',
model: '',
name: '',
status: '',//
status: '',
materialId: '',
materialName: '',
theInboundQuantity: 0,
@ -512,7 +515,6 @@ export default {
this.sizeForm.purchaseEndInfo = selectedOption
this.loading = true
const res = await getPurchasesByIds(this.batchType);
console.log("res", res)
if (res.data.success) {
this.sizeForm.inTableData = res.data.result;
this.$message.success("数据获取成功");
@ -588,14 +590,16 @@ export default {
this.$message.error("物资名称不能为空");
return;
}
if (row.type === "NY") {
if (row.unitPrice === undefined || row.unitPrice <= 0) {
this.$message.error("单价不能为空");
return;
}
}
if (!row.theInboundQuantity || row.theInboundQuantity < 0) {
this.$message.error("本次入库数量不能为空");
return;
}
if (row.unitPrice === undefined || row.unitPrice < 0) {
this.$message.error("单价不能为空");
return;
}
if (!row.type) {
this.$message.error("请选择类别");
return;
@ -618,14 +622,13 @@ export default {
this.$message.error("物资名称不能为空");
return;
}
if (!row.theInboundQuantity || row.theInboundQuantity < 0) {
this.$message.error("本次入库数量不能为空");
return;
}
if (row.unitPrice === undefined || row.unitPrice <= 0) {
this.$message.error("单价不能为空");
return;
if (row.type === "NY") {
if (row.unitPrice === undefined || row.unitPrice <= 0) {
this.$message.error("单价不能为空");
return;
}
}
if (!row.type) {
this.$message.error("请选择类别");
return;
@ -668,6 +671,7 @@ export default {
// 1 2
radioChange() {
this.batchType = '';
this.sizeForm.inTableData = []
this.sizeForm.singleData = []
if (this.sizeForm.option == 1) {
@ -700,14 +704,24 @@ export default {
}
</script>
<style lang="scss" scoped>
.form-title {
font-size: 16px;
font-weight: 600;
padding: 18px 0;
}
::v-deep .el-table td,
::v-deep .el-table th {
text-align: center !important;
}
.form-title {
margin: 20px 0;
}
::v-deep.el-dialog__footer {
position: fixed !important;
bottom: 0 !important;
right: 0 !important;
}
::v-deep.dialog-content {
max-height: calc(100vh - 200px);
overflow-y: auto;
padding-right: 10px;
}
</style>

@ -3,120 +3,76 @@
<el-dialog :close-on-click-modal="false" :title="outDialogTiltle" :visible.sync="outDialogVisible"
:append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen>
<!-- 基本信息 -->
<el-form :model="sizeForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<div class="form-title"> 基本信息</div>
<el-row>
<el-col :span="12" v-show="sizeForm.options == 1 && outDialogType != 'add'">
<el-form-item label="出库单号">
<el-input v-model="sizeForm.orderNo" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出库申请时间">
<el-date-picker v-model="sizeForm.outDate" type="date" placeholder="选择日期" style="width: 100%;" disabled>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="事由">
<el-input v-model="sizeForm.reason" :disabled="outDialogType == 'details'"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物资类型">
<el-select v-model="sizeForm.materialType" placeholder="请选择" style="width: 100%;"
:disabled="outDialogType == 'details'">
<el-option label="办公室物资" value="1"></el-option>
<el-option label="其他物资" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="选项">
<el-radio-group v-model="sizeForm.options" @change="radioChange()" :disabled="outDialogType == 'details'">
<el-radio :label="1" :disabled="sizeForm.type == 2">批量选择</el-radio>
<el-radio :label="2">单项选择</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-if="sizeForm.options === 2">
<el-form-item label="选项">
<el-radio-group v-model="sizeForm.radio" :disabled="outDialogType == 'details'">
<el-radio :label="1">易耗品</el-radio>
<el-radio :label="2">耐用品</el-radio>
<el-radio :label="3">全部</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-if="sizeForm.options == 1">
<el-form-item label="需求单名称">
<el-input v-model="sizeForm.demandEndInfo" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<div class="form-title">{{ outDate }} 出库信息</div>
<el-button type="primary" size="mini" style="margin-bottom: 18px;" @click="inTableAdd()"
v-if="sizeForm.options == 2">新增</el-button>
<el-table :data="sizeForm.inTableData" border style="width: 100%">
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="materialName" label="物资名称">
<template slot-scope="scope">
<el-select v-model="scope.row.materialitem" placeholder="请选择物资名称" style="width: 100%;"
@change="handleMaterialChange(scope.row.materialitem, scope.$index)"
v-if='inDialogType != "details" && sizeForm.options == 2' value-key="id">
<el-option v-for="item in materials" :key="item.materialId" :label="item.materialName" :value="item">
</el-option>
</el-select>
<span v-else> {{ scope.row.materialName }}</span>
</template>
</el-table-column>
<el-table-column prop="model" label="规格">
</el-table-column>
<el-table-column prop="type" label="类别">
<template slot-scope="scope">
{{ scope.row.type === "NY" ? "耐用品" : (scope.row.type === "YH" ? "易耗品" : "") }}
</template>
</el-table-column>
<el-table-column prop="type" label="出库类型">
<template slot-scope="scope">
{{ scope.row.type === "NY" ? "出库单" : (scope.row.type === "YH" ? "发放单" : "") }}
</template>
</el-table-column>
<el-table-column prop="unit" label="单位">
</el-table-column>
<el-table-column prop="departmentName" label="部门" v-if="sizeForm.options === 2">
<template slot-scope="scope">
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;"
v-if='inDialogType != "details"'>
<el-option v-for="item in list" :key="item.departmentId" :label="item.department"
:value="item.departmentId">
</el-option>
</el-select>
<span v-else> {{ scope.row.departmentName }}</span>
</template>
</el-table-column>
<el-table-column prop="applicationQuantity" label="申请数量" v-if="sizeForm.options == 1">
</el-table-column>
<el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1">
<template slot-scope="scope">
{{ scope.row.outboundQuantity || 0 }}
</template>
</el-table-column>
<el-table-column prop="theOutboundQuantity" label="本次出库数量">
<template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.theOutboundQuantity" :min="0" style="width: 100%;"
@change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"></el-input-number>
<!-- <span v-else>{{ scope.row.theOutboundQuantity || 0 }}</span> -->
</template>
</el-table-column>
</el-table>
<div class="form-title" v-if="outDialogType !== 'details'">出库账目表格</div>
<el-table :data="sizeForm.inTableData" border style="width: 100%" v-if="outDialogType !== 'details'">
<el-table-column prop="date" label="当前库存" width="100">
<div class="dialog-content">
<el-form :model="sizeForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<div class="form-title"> 基本信息</div>
<el-row>
<el-col :span="12" v-show="sizeForm.options == 1 && outDialogType != 'add'">
<el-form-item label="出库单号">
<el-input v-model="sizeForm.orderNo" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出库申请日期">
<el-date-picker v-model="sizeForm.outDate" type="date" placeholder="选择日期" style="width: 100%;" disabled>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="事由">
<el-input v-model="sizeForm.reason" :disabled="outDialogType == 'details'"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物资类型">
<el-select v-model="sizeForm.materialType" placeholder="请选择" style="width: 100%;"
:disabled="outDialogType == 'details'">
<el-option label="办公室物资" value="1"></el-option>
<el-option label="其他物资" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="选项">
<el-radio-group v-model="sizeForm.options" @change="radioChange()"
:disabled="outDialogType == 'details'">
<el-radio :label="1" :disabled="sizeForm.type == 2"><span @click="closeHandle">批量选择</span></el-radio>
<el-radio :label="2">单项选择</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-if="sizeForm.options === 2">
<el-form-item label="选项">
<el-radio-group v-model="sizeForm.optionType" :disabled="outDialogType == 'details'"
@change="getMaterialList">
<el-radio label="YH">易耗品</el-radio>
<el-radio label="NY">耐用品</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-if="sizeForm.options == 1">
<el-form-item label="需求单名称">
<el-input v-model="sizeForm.demandEndInfo" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<div class="form-title">{{ outDate }} 出库信息</div>
<el-button type="primary" size="mini" style="margin-bottom: 18px;" @click="inTableAdd()"
v-if="sizeForm.options == 2">新增</el-button>
<el-table :data="sizeForm.inTableData" border style="width: 100%">
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="materialName" label="物资名称">
<template slot-scope="scope">
<el-select v-model="scope.row.materialitem" placeholder="请选择物资名称" style="width: 100%;"
@change="handleMaterialChange(scope.row.materialitem, scope.$index)"
v-if='inDialogType != "details" && sizeForm.options == 2 && sizeForm.optionType == "YH"'
value-key="id">
<el-option v-for="item in materials" :key="item.materialId" :label="item.materialName" :value="item">
</el-option>
</el-select>
<span v-else> {{ scope.row.materialName }}</span>
</template>
</el-table-column>
<el-table-column prop="model" label="规格">
</el-table-column>
@ -130,25 +86,85 @@
{{ scope.row.type === "NY" ? "出库单" : (scope.row.type === "YH" ? "发放单" : "") }}
</template>
</el-table-column>
<el-table-column prop="departmentName" label="部门" v-if="sizeForm.options == 2">
<el-table-column prop="unit" label="单位">
</el-table-column>
<el-table-column label="部门" prop="departmentName" v-if="sizeForm.options === 2 && sizeForm.optionType"
:key="'account-dept-' + sizeForm.options">
<template slot-scope="scope">
<span>
{{ getDepartmentName(scope.row.department) }}
</span>
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;"
v-if='inDialogType != "details"'>
<el-option v-for="item in list" :key="item.departmentId" :label="item.department"
:value="item.departmentId">
</el-option>
</el-select>
<span v-else> {{ scope.row.departmentName }}</span>
</template>
</el-table-column>
<el-table-column prop="theOutboundQuantity" label="本次出库数量">
<el-table-column prop="applicationQuantity" label="申请数量" v-if="sizeForm.options == 1">
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="出库信息" v-if="sizeForm.options == 1">
<el-table-column prop="outboundQuantity" label="数量">
<el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1">
<template slot-scope="scope">
{{ scope.row.outboundQuantity || 0 }}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-form>
<el-table-column prop="theOutboundQuantity" label="本次出库数量">
<template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.theOutboundQuantity" :min="0" style="width: 100%;"
@change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"></el-input-number>
<!-- <span v-else>{{ scope.row.theOutboundQuantity || 0 }}</span> -->
</template>
</el-table-column>
<el-table-column label="操作" v-if="sizeForm.optionType === 'YH' || inBatchForm.optionType === 'YH'"
style="text-align: center;">
<template slot-scope="scope">
<div style="text-align: center;">
<el-button type="text" size="mini" @click="handleDelete(scope.$index, scope.row)">
删除
</el-button>
</div>
</template>
</el-table-column>
</el-table>
<div class="form-title" v-if="outDialogType !== 'details'">出库账目表格</div>
<el-table :data="sizeForm.inTableData" border style="width: 100%" v-if="outDialogType !== 'details'">
<el-table-column prop="date" label="当前库存" width="100">
<el-table-column prop="materialCode" label="物资编码">
</el-table-column>
<el-table-column prop="materialName" label="物资名称">
</el-table-column>
<el-table-column prop="model" label="规格">
</el-table-column>
<el-table-column prop="type" label="类别">
<template slot-scope="scope">
{{ scope.row.type === "NY" ? "耐用品" : (scope.row.type === "YH" ? "易耗品" : "") }}
</template>
</el-table-column>
<el-table-column prop="type" label="出库类型">
<template slot-scope="scope">
{{ scope.row.type === "NY" ? "出库单" : (scope.row.type === "YH" ? "发放单" : "") }}
</template>
</el-table-column>
<el-table-column prop="departmentName" label="部门" v-if="sizeForm.options == 2"
:key="'account-dept-' + sizeForm.options">
<template slot-scope="scope">
<span>
{{ getDepartmentName(scope.row.department) }}
</span>
</template>
</el-table-column>
<el-table-column prop="theOutboundQuantity" label="本次出库数量">
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="出库信息" v-if="sizeForm.options == 1">
<el-table-column prop="outboundQuantity" label="数量">
<template slot-scope="scope">
{{ scope.row.outboundQuantity || 0 }}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleCloseDetail()"> </el-button>
<el-button type="primary" @click="submit(1)">暂存</el-button>
@ -163,8 +179,10 @@
<el-col :span="24">
<el-form-item label="需求单">
<template slot-scope="scope">
<el-select v-model="inBatchForm.batchType" placeholder="请选择需求单" style="width: 100%;">
<el-option v-for="item in quarterList" :key="item.ids" :label="item.quarterName" :value="item.ids">
<el-select v-model="inBatchForm.batchType" placeholder="请选择需求单" style="width: 100%;"
@change="resetHandle">
<el-option v-for="item in quarterList" :key="item.ids" :label="item.quarterName" :value="item.ids"
:clearable="true">
</el-option>
</el-select>
</template>
@ -172,7 +190,8 @@
</el-col>
<el-col :span="24">
<el-form-item label="部门">
<el-select v-model="inBatchForm.department" placeholder="请选择" style="width: 100%;">
<el-select v-model="inBatchForm.department" placeholder="请选择" style="width: 100%;" :clearable="true"
@change="depchange">
<el-option v-for="item in departmentList" :key="item.departmentId" :label="item.department"
:value="item.departmentId">
</el-option>
@ -181,10 +200,9 @@
</el-col>
<el-col :span="24">
<el-form-item label="选项">
<el-radio-group v-model="sizeForm.radio" :disabled="outDialogType == 'details'">
<el-radio :label="1">易耗品</el-radio>
<el-radio :label="2">耐用品</el-radio>
<el-radio :label="3">全部</el-radio>
<el-radio-group v-model="inBatchForm.optionType" :disabled="outDialogType == 'details'">
<el-radio label="YH">易耗品</el-radio>
<el-radio label="NY">耐用品</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -199,6 +217,13 @@
<!-- 选择弹窗 -->
<el-dialog :close-on-click-modal="false" title="选择耐用品" :visible.sync="goodsVisible" :append-to-body="true"
width="70%">
<!-- 搜索区域 -->
<div class="search-container" style="margin-bottom: 15px;">
<el-input v-model="searchKeyword" placeholder="请输入物资名称搜索" clearable style="width: 300px;"
@keyup.enter.native="handleSearch">
<el-button slot="append" icon="el-icon-search" @click="handleSearch"></el-button>
</el-input>
</div>
<el-table :data="goodsList" border style="width: 100%" @selection-change="goodsListSelectionChange">
<el-table-column type="selection" width="55">
</el-table-column>
@ -215,7 +240,7 @@
</el-table-column>
<el-table-column prop="unit" label="单位">
</el-table-column>
<el-table-column prop="departmentName" label="部门">
<el-table-column prop="departmentName" label="部门" v-if="sizeForm.options == 2">
</el-table-column>
<el-table-column prop="applicationQuantity" label="申请数量">
</el-table-column>
@ -224,24 +249,30 @@
{{ scope.row.outboundQuantity || 0 }}
</template>
</el-table-column>
<!-- <el-table-column prop="theOutboundQuantity" label="本次出库数量">
<template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.theOutboundQuantity" :min="1" style="width: 100%;"
@change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"></el-input-number>
</template>
</el-table-column> -->
</el-table>
<!-- 分页组件 -->
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
:page-sizes="[5, 10, 20, 50]" :page-size="pageSize" :total="total"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<span slot="footer" class="dialog-footer">
<el-button @click="goodsVisible = false"> </el-button>
<el-button type="primary" @click="goodsSubmit()"> </el-button>
</span>
</el-dialog>
<consumableDialog v-if="consumableVisible" :consumableVisible='consumableVisible' :demandDialogTitle="demandDialogTitle"
@handleCloseDetail="handleCloseDetail">
</consumableDialog>
</div>
</template>
<script>
import { getQuarterList, getDepartmentList, getDetailedList, getDetailedItems, submitData, getMaterialList, editList } from "@/api/firstOrder/outbound";
import consumableDialog from './consumableDialog.vue'
export default {
components: {
consumableDialog,
},
props: {
repairVisible: {
type: Boolean,
@ -266,7 +297,9 @@ export default {
},
data() {
return {
demandDialogTitle: '耐用品出库',
goodsVisible: false,
consumableVisible: false, //
quarterList: [],
departmentList: [],
outDialogVisible: false,
@ -279,16 +312,17 @@ export default {
demandEndInfo: '',//
outDate: '',//
options: 2,//
radio: 1, // 1 2
optionType: '', // 1 2
materialType: '1',//
status: '',//1 2
// materialld: '',//Id
userInfoVO: {
userId: "用户ID",
name: "用户名称"
name: "用户名称",
mainErDepartment: "1",
mainErDepartmentName: "主管部门名称",
},
},
uniqueList: [],
goodsList: [],
goodsSelectList: [],
inTableData: [],
@ -296,10 +330,20 @@ export default {
batchType: '',//
inBatchForm: {
batchType: '',
department: ''
department: '',
optionType: '',
},
quarterYearMap: {},
quarterQuarterMap: {}
quarterQuarterMap: {},
rules: {
reason: [
{ required: true, message: '事由不能为空', trigger: 'blur' }
],
materialType: [
{ required: true, message: '请选择物资类型', trigger: 'change' }
]
//
}
}
},
computed: {
@ -308,13 +352,15 @@ export default {
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0')
const hour = String(now.getHours()).padStart(2, '0')
const minute = String(now.getMinutes()).padStart(2, '0')
const second = String(now.getSeconds()).padStart(2, '0')
return `${year}-${month}-${day} ${hour}:${minute}:${second}`
// const hour = String(now.getHours()).padStart(2, '0')
// const minute = String(now.getMinutes()).padStart(2, '0')
// const second = String(now.getSeconds()).padStart(2, '0')
// return `${year}-${month}-${day} ${hour}:${minute}:${second}`
return `${year}-${month}-${day}`
}
},
mounted() {
this.outDialogVisible = this.repairVisible
if (this.outDialogType == 'add') {
this.addInit()
@ -322,22 +368,127 @@ export default {
this.inInit()
}
this.getDetailedItems()
this.getMaterialList()
// this.getMaterialList()
},
methods: {
// //
// async getMaterialList() {
// const { data: res } = await this.$http.get('material/getMaterialList')
// if (res.code !== 200) return this.$message.error(res.msg)
// this.materialList = res.data
// },
//
async handleSearch() {
//
this.currentPage = 1;
await this.loadGoodsList();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.currentPage = 1;
this.loadGoodsList();
},
//
handleCurrentChange(val) {
this.currentPage = val;
this.loadGoodsList();
},
//
// async loadGoodsList() {
// try {
// const res = await getMaterialList({
// optionType: 'NY', //
// // pageNum: this.currentPage,
// // pageSize: this.pageSize,
// // keyword: this.searchKeyword //
// });
// if (res.data && res.data.result) {
// // this.goodsList = res.data.result.list; //
// this.goodsList = res.data.result; //
// this.total = res.data.result.total; //
// }
// } catch (error) {
// this.$message.error("");
// }
// },
//
goodsListSelectionChange(val) {
this.goodsSelectList = JSON.parse(JSON.stringify(val));
},
//
goodsSubmit() {
if (this.goodsSelectList.length > 0) {
const newItems = this.goodsSelectList.map(item => ({
...item,
materialId: item.materialId,
materialCode: item.materialCode,
materialName: item.materialName,
model: item.model,
type: item.type,
unit: item.unit,
department: item.departmentId,
departmentName: item.departmentName,
theOutboundQuantity: 0
}));
this.sizeForm.inTableData.push(...newItems);
this.goodsVisible = false;
} else {
this.$message.warning('请先勾选需要添加的数据');
}
},
depchange(value) {
this.departmentList = this.departmentList
},
//
handleBatchClose() {
this.inBatchDialogVisible = false
},
//
inTableAdd() {
const requiredFields = [
{ value: this.sizeForm.reason, message: '请填写事由' },
{ value: this.sizeForm.materialType, message: '请选择物资类型' },
{ value: this.sizeForm.optionType, message: '请选择类别(易耗品/耐用品)' }
];
//
for (const field of requiredFields) {
if (!field.value) {
this.$message.warning(field.message);
return;
}
}
this.sizeForm.inTableData.push({})
},
addInit() {
this.sizeForm.outDate = new Date()//
},
//
syncInboundQuantity(row) {
row.theOutboundQuantity = Number(row.theOutboundQuantity);
row.theOutboundQuantity = Number(row.theOutboundQuantity)
if (this.sizeForm.options === 1) {
const maxAllowQuantity = (row.applicationQuantity || 0) - (row.outboundQuantity || 0);
if (row.theOutboundQuantity > maxAllowQuantity) {
this.$message.error(`本次出库数量不能大于${maxAllowQuantity}`);
row.theOutboundQuantity = maxAllowQuantity;
}
}
},
//
handleCloseDetail() {
this.outDialogVisible = false
this.consumableVisible = false
this.$emit('handleCloseDetail')
},
//
//
async getQuarterList() {
try {
const res = await getQuarterList()
@ -352,12 +503,10 @@ export default {
})
}
} catch (error) {
console.error('获取需求单列表失败:', error)
this.$message.error('获取需求单列表失败')
}
},
//
//
async onQuarterSelectChange(ids) {
if (!ids) return
const year = this.quarterYearMap[ids]
@ -370,6 +519,7 @@ export default {
})
if (res.data && res.data.result) {
this.departmentList = res.data.result
console.log(this.departmentList, 'departmentList')
} else {
this.departmentList = []
}
@ -381,11 +531,7 @@ export default {
this.departmentList = []
}
},
//
handleBatchClose() {
this.inBatchDialogVisible = false
},
//
async batchSubmit() {
if (!this.inBatchForm.batchType) {
this.$message.error('请选择需求单');
@ -395,23 +541,28 @@ export default {
this.$message.error('请选择部门');
return;
}
if (!this.inBatchForm.optionType) {
this.$message.error('请选择类别');
return;
}
const res = await getDetailedList({
ids: this.inBatchForm.batchType,
departmentId: this.inBatchForm.department
departmentId: this.inBatchForm.department,
optionType: this.inBatchForm.optionType,
})
if (res.data && res.data.result) {
this.sizeForm.inTableData = res.data.result.uniqueList
this.sizeForm.inTableData = res.data.result
const selectedDept = this.departmentList.find(
dept => dept.departmentId === this.inBatchForm.department
);
)
const deptName = selectedDept ? selectedDept.department : '';
this.sizeForm.inTableData = res.data.result.uniqueList.map(item => ({
this.sizeForm.inTableData = res.data.result.map(item => ({
...item,
IdDemandEndld: this.inBatchForm.batchType,
// department: this.inBatchForm.department,
department: deptName
}));
}))
this.inBatchDialogVisible = false;
const selectedQuarter = this.quarterList.find(
item => item.ids === this.inBatchForm.batchType
@ -419,24 +570,23 @@ export default {
if (selectedQuarter) {
this.sizeForm.demandEndInfo = selectedQuarter.quarterName;
}
//radio
if (this.sizeForm.radio === 3) {
if (res.data.result.duplicateList != null && res.data.result.duplicateList.length > 0) {
this.goodsVisible = true
this.goodsList = res.data.result.duplicateList
}
if (this.inBatchForm.optionType === 'NY') {
this.goodsVisible = true
this.data.goodsList = res.data.result
}
this.$nextTick(() => {
this.$forceUpdate();
});
} else {
this.$message.warning('未获取到详细数据');
}
},
//
//
goodsListSelectionChange(val) {
this.goodsSelectList = val
},
//
//
goodsSubmit() {
if (this.goodsSelectList.length > 0) {
this.sizeForm.inTableData.push(...this.goodsSelectList);
@ -466,8 +616,13 @@ export default {
async getMaterialList() {
this.loading = true
try {
const res = await getMaterialList();
this.materials = res.data.result
if (this.sizeForm.optionType === "NY") {
this.consumableVisible = true
} else {
const res = await getMaterialList({ optionType: this.sizeForm.optionType })
this.materials = res.data.result
}
} catch (error) {
this.$message.error("获取数据来源失败,请重试");
} finally {
@ -514,14 +669,22 @@ export default {
// status == 1 2
this.sizeForm.status = index
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData
this.sizeForm.inTableData.forEach(row => {
row.departmentName = this.getDepartmentName(row.department);
});
this.sizeForm.ldOneOutStorageDetailVOList.departmentName = this.sizeForm.inTableData.department
let arr = this.departmentList.find(item => item.departmentId === this.inBatchForm.department || {})
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData.map(row => {
const deptId = row.department
const dept = this.list.find(item => item.departmentId === deptId);
console.log(dept, 'dept')
return {
...row,
department: this.sizeForm.options == '1' ? arr.departmentId : deptId,
departmentName: this.sizeForm.options == '1' ? arr.department : dept.department,
}
})
console.log(this.sizeForm, '111')
this.sizeForm.inTableData = []
try {
const res = await submitData(this.sizeForm)
console.log(this.sizeForm, '222')
if (res.data.success) {
this.$message({
type: "success",
@ -566,29 +729,61 @@ export default {
}
},
//
inTableAdd() {
this.sizeForm.inTableData.push({})
},
//
async radioChange() {
// this.resetAllForms()
this.sizeForm.inTableData = []
this.sizeForm.optionType = '';
if (this.sizeForm.options === 1) {
await this.getQuarterList()
this.inBatchDialogVisible = true
this.$forceUpdate()
this.$nextTick(() => {
this.$forceUpdate();
});
}
},
closeHandle() {
this.inBatchForm.batchType = '',
this.inBatchForm.department = ''
this.inBatchForm.optionType = ''
this.sizeForm.inTableData = []
this.getQuarterList()
this.inBatchDialogVisible = true
this.$nextTick(() => {
this.$forceUpdate();
});
// this.sizeForm.inTableData = []
},
//
handleDelete(index, row) {
this.sizeForm.inTableData.splice(index, 1)
this.$message.success('已成功删除该条记录')
},
},
watch: {
//
'inBatchForm.batchType': function (newVal) {
this.inBatchForm.department = '',
this.inBatchForm.optionType = 1
if (newVal) {
this.onQuarterSelectChange(newVal)
}
},
'sizeForm.optionType': function (newVal) {
if (newVal) {
this.sizeForm.inTableData = []
// this.getMaterialList()
}
},
//
goodsVisible(newVal) {
if (newVal) {
//
this.searchKeyword = '';
this.currentPage = 1;
this.loadGoodsList();
}
}
}
}
@ -597,4 +792,16 @@ export default {
.form-title {
margin: 20px 0;
}
::v-deep.el-dialog__footer {
position: fixed !important;
bottom: 0 !important;
right: 0 !important;
}
::v-deep.dialog-content {
max-height: calc(100vh - 200px);
overflow-y: auto;
padding-right: 10px;
}
</style>

@ -15,21 +15,33 @@
<el-dialog title="记录" :visible.sync="dialogLogVisible" width="50%" :close-on-click-modal="false"
:append-to-body="true" >
<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="1"></el-tab-pane>
<el-tab-pane label="库" name="2"></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="money" label="单价" v-if="transactionType == '2' && currentRow.type === 'NY'">
<el-table-column prop="money" label="单价" v-if="transactionType === '1' && currentRow && currentRow.type === 'NY'">
</el-table-column>
<el-table-column prop="operatorName" label="操作人" >
</el-table-column>
<el-table-column prop="operationTime" label="时间" :formatter="formatTime" width="180">
<el-table-column prop="operationTime" label="时间" :formatter="formatTime" width="200">
</el-table-column>
<el-table-column prop="departmentName" label="部门"> </el-table-column>
</el-table>
<div style="margin-top: 10px; text-align: right;">
<el-pagination
background
@size-change="handleLogSizeChange"
@current-change="handleLogCurrentChange"
:current-page="logPage.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="logPage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="logPage.total"
></el-pagination>
</div>
</el-dialog>
</div>
</template>
@ -48,6 +60,11 @@ export default {
currentPage: 1,
total: 0,
},
logPage: { //
currentPage: 1,
pageSize: 10,
total: 0
},
option: {
height: "auto",
calcHeight: 30,
@ -180,30 +197,64 @@ export default {
this.tableData = [];
},
methods: {
formatTime(row, column, cellValue) {
formatTime(row, column, cellValue) {
if (!cellValue) return '';
return cellValue.replace('T', ' ');
const date = new Date(cellValue);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
async handleLog(row) {
this.dialogLogVisible = true;
this.currentRow = row;
this.logPage.currentPage = 1;
this.loadTransactionData();
},
handleTabClick() {
this.logPage.currentPage = 1
this.loadTransactionData();
},
// async loadTransactionData() {
// if (!this.currentRow) return;
// const params = {
// oneFromId: this.currentRow.id,
// transactionType: this.transactionType
// };
// const pageNum = this.page.currentPage;
// const pageSize = this.page.pageSize;
// this.loading = true;
// try {
// const res = await recordList(
// pageNum,
// pageSize,
// Object.assign({}, this.query, params)
// );
// if (this.transactionType === "1") {
// this.ckTable = res.data.result.list;
// } else {
// this.rkTable = res.data.result.list;
// }
// this.tableData = res.data.result.list;
// } catch (error) {
// this.$message.error(error.message);
// } finally {
// this.loading = false;
// }
// },
async loadTransactionData() {
if (!this.currentRow) return;
const params = {
oneFromId: this.currentRow.id,
transactionType: this.transactionType
};
const pageNum = this.page.currentPage;
const pageSize = this.page.pageSize;
const pageNum = this.logPage.currentPage;
const pageSize = this.logPage.pageSize;
this.loading = true;
try {
const res = await recordList(
@ -211,6 +262,7 @@ export default {
pageSize,
Object.assign({}, this.query, params)
);
this.logPage.total = res.data.result.total;
if (this.transactionType === "1") {
this.ckTable = res.data.result.list;
} else {
@ -218,11 +270,21 @@ export default {
}
this.tableData = res.data.result.list;
} catch (error) {
console.error("获取记录数据失败:", error);
this.$message.error(error.message);
} finally {
this.loading = false;
}
},
handleLogSizeChange(pageSize) {
this.logPage.pageSize = pageSize;
this.logPage.currentPage = 1; //
this.loadTransactionData();
},
//
handleLogCurrentChange(currentPage) {
this.logPage.currentPage = currentPage;
this.loadTransactionData();
},
searchReset() {
this.query = {};
this.onLoad(this.page);

@ -6,7 +6,7 @@
width="30%"
@close="closeDialog"
>
<avue-form ref="form" :option="option"></avue-form>
<avue-form ref="form" :option="option" v-model="formData"></avue-form>
<template #footer>
<span class="dialog-footer">
@ -17,27 +17,53 @@
</el-dialog>
</template>
<script>
import {returnMaterial} from '@/api/materials/expend'
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
// durableFormId
durableFormId: {
type: Number,
default: 0,
}
},
data() {
const today = new Date();
const defaultDate = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, '0')}-${today.getDate().toString().padStart(2, '0')}`;
return {
purchaseTitle:'归还',
openShow: false,
formData: {
returnReason: '',
returnTime: defaultDate,
},
option: {
submitBtn: false,
emptyBtn: false,
column: [
// {
// label: "",
// prop: "name",
// span: 24,
// type: "number",
// hide: true,
// rules: [
// {
// required: true,
// message: "",
// trigger: "blur",
// },
// ],
// },
{
label: "归还数量",
prop: "name",
label: "归还理由",
prop: "returnReason",
span: 24,
type: "number",
type:'textarea',
rows:5,
rules: [
{
required: true,
@ -47,15 +73,15 @@ export default {
],
},
{
label: "归还理由",
prop: "sex",
label: "归还时间",
prop: "returnTime",
span: 24,
type:'textarea',
type:'date',
rows:5,
rules: [
{
required: true,
message: "请输入",
message: "请选择",
trigger: "blur",
},
],
@ -72,10 +98,25 @@ export default {
this.openShow = false;
this.$emit("closeDialog");
},
submit() {
this.$refs.form.validate((valid) => {
async submit() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.$emit("submit", this.formData);
try {
const params = {
durableFormId: this.durableFormId,
num: 1,
returnTime: this.formData.returnTime,
returnReason: this.formData.returnReason,
type: 1
}
await returnMaterial(params)
this.$message.success('归还成功')
this.closeDialog()
this.$emit('submitSuccess')
this.$refs.form.resetFields()
} catch (error) {
this.$message.error(error.message || '归还失败,请重试')
}
}
});
},

@ -6,7 +6,7 @@
width="30%"
@close="closeDialog"
>
<avue-form ref="form" :option="option"></avue-form>
<avue-form ref="form" :option="option" v-model="formData"></avue-form>
<template #footer>
<span class="dialog-footer">
@ -17,17 +17,26 @@
</el-dialog>
</template>
<script>
import {returnMaterial} from '@/api/materials/expend'
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
durableFormId: {
type: Number,
default: 0,
}
},
data() {
const today = new Date();
const defaultDate = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, '0')}-${today.getDate().toString().padStart(2, '0')}`;
return {
formData: {
returnReason: '',
returnTime: defaultDate,
},
purchaseTitle:'报废',
openShow: false,
option: {
@ -36,9 +45,17 @@ export default {
column: [
{
label: "报废数量",
prop: "name",
prop: "num",
span: 24,
value: 1,
disabled: true,
},
{
label: "报废理由",
prop: "returnReason",
span: 24,
type: "number",
type:'textarea',
rows:5,
rules: [
{
required: true,
@ -48,15 +65,15 @@ export default {
],
},
{
label: "报废理由",
prop: "sex",
label: "报废时间",
prop: "returnTime",
span: 24,
type:'textarea',
type:'date',
rows:5,
rules: [
{
required: true,
message: "请输入",
message: "请选择",
trigger: "blur",
},
],
@ -73,10 +90,25 @@ export default {
this.openShow = false;
this.$emit("closeDialog");
},
submit() {
this.$refs.form.validate((valid) => {
async submit() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.$emit("submit", this.formData);
try {
const params = {
durableFormId: this.durableFormId,
num: 1,
returnTime: this.formData.returnTime,
returnReason: this.formData.returnReason,
type: 2
}
await returnMaterial(params)
this.$message.success('报废成功')
this.closeDialog()
this.$emit('submitSuccess')
this.$refs.form.resetFields()
} catch (error) {
this.$message.error(error.message || '报废失败,请重试')
}
}
});
},

@ -43,6 +43,8 @@
:showDialog="returnShow"
:rowDta="returnInfo"
@closeDialog="closeDialog"
:durableFormId="returnInfo.id"
@submitSuccess="handleRefresh"
></returnDialog>
<!-- 报废 -->
<scrapDialog
@ -50,6 +52,8 @@
:showDialog="scrapShow"
:rowDta="scrapInfo"
@closeDialog="closeDialog"
:durableFormId="scrapInfo.id"
@submitSuccess="handleRefresh"
></scrapDialog>
</div>
</template>
@ -280,10 +284,9 @@ export default {
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.data = res.data.result.list
this.page.total = res.data.result.total
})
this.loading = false;
},
//
@ -297,6 +300,9 @@ export default {
this.scrapShow = true;
this.scrapInfo = JSON.parse(JSON.stringify(row));
},
handleRefresh() {
this.onLoad(this.page, this.query);
},
},
};
</script>

@ -10,10 +10,10 @@
</template>
<script>
import { getList, add, remove, update, getCode } from "@/api/materials/list";
import { upload } from "@/api/materials/index";
export default {
data() {
return {
form: { imageUrl: "" },
selectionList: [],
query: {},
loading: true,
@ -103,24 +103,23 @@ export default {
align: "center",
loadText: "图片上传中,请稍等",
span: 12,
// propsHttp: { //
// url: 'picture', //
// name: 'name', //
// res: 'data' //
// },
tip: "只能上传jpg/png文件",
rules: [{
required: true,
message: "请上传图片",
trigger: "change",
}],
formatter: (row, column) => {
// rules: [{
// required: true,
// message: "",
// trigger: "change",
// }],
formatter: (row, column) => {
const value = row.picture;
if (value === null || value === undefined || value === "") {
return "无"
}
return value;
}
},
onSuccess: (res, file, fileList) => {
this.form.picture = res.data
},
httpRequest: this.handleUpload
},
],
},
@ -135,29 +134,39 @@ export default {
this.fetchMaterialCode();
},
methods: {
handleUpload(params) {
const formData = new FormData()
formData.append('file', params.file)
upload(formData)
.then(res => {
params.onSuccess(res)
})
.catch(err => {
params.onError(err)
})
},
fetchMaterialCode() {
getCode()
.then((res) => {
const dicData = res.data.result.map((item) => ({
label: item.name,
value: item.code,
}));
}))
const targetColumn = this.option.column.find(
(col) => col.prop === "materialCode"
);
)
if (targetColumn) {
targetColumn.dicData = dicData;
targetColumn.dicData = dicData
}
})
.catch((error) => {
this.$message.error("加载类别数据失败,请刷新重试");
});
})
},
handleLog() {
this.dialogLogVisible = true;
},
handleTabClick(tab, event) {
console.log(tab, event);
if (this.activeName == "first") {
this.tableData = this.ckTable;
}
@ -185,7 +194,6 @@ export default {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
@ -210,7 +218,7 @@ export default {
window.console.log(error);
loading();
}
);
)
},
//
rowUpdate(row, index, done, loading) {

@ -6,7 +6,6 @@
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad" >
<template slot-scope="scope" slot="menu">
</template>
</avue-crud>
</basic-container>
@ -58,11 +57,17 @@ export default {
align: "center",
},
{
label: "物资Id",
prop: "materialId",
label: "物资名称",
prop: "materialName",
headerAlign: "center",
align: "center",
},
// {
// label: "Id",
// prop: "materialId",
// headerAlign: "center",
// align: "center",
// },
{
label: "规格型号",
prop: "model",

@ -165,16 +165,16 @@ export default {
align: "center",
dicData: [
{
label: "未出库",
value: 0,
label: "待审批",
value: 2,
},
{
label: "已出库",
value: 1,
label: "已审批",
value: 3,
},
{
label: "已驳回",
value: 2,
label: "审批失败",
value: 4,
},
],
},

Loading…
Cancel
Save