问题修改

master
zhangdi 3 days ago
parent 0bae108902
commit f95f0a4483
  1. 324
      src/views/firstOrder/components/outDialog.vue
  2. 3
      src/views/firstOrder/outbound.vue
  3. 2
      src/views/secondOrder/components/inDialog.vue
  4. 60
      src/views/secondOrder/inbound.vue

@ -1,60 +1,32 @@
<template>
<div>
<el-dialog
:close-on-click-modal="false"
:title="outDialogTiltle"
:visible.sync="outDialogVisible"
:append-to-body="true"
width="70%"
@close="handleCloseDetail"
fullscreen
>
<el-dialog :close-on-click-modal="false" :title="outDialogTiltle" :visible.sync="outDialogVisible"
:append-to-body="true" width="70%" @close="handleCloseDetail" fullscreen>
<!-- 基本信息 -->
<div class="dialog-content">
<el-form
:model="sizeForm"
ref="dynamicValidateForm"
label-width="100px"
class="demo-dynamic"
>
<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-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 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-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-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>
@ -62,25 +34,17 @@
</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>批量选择</span></el-radio
>
<el-radio-group v-model="sizeForm.options" @change="radioChange()"
:disabled="outDialogType == 'details'">
<el-radio :label="1" :disabled="sizeForm.type == 2"><span>批量选择</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-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>
@ -91,100 +55,62 @@
<el-input v-model="sizeForm.demandEndInfo" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12" v-if="outDialogTiltle == '详情'">
<el-form-item label="状态">
<span v-if="rowItem.status == 1">暂存</span>
<span v-if="rowItem.status == 2">待二级库入库</span>
<span v-if="rowItem.status == 3">已出库</span>
</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 && outDialogType != 'details'"
>新增</el-button
>
<el-table
:data="sizeForm.inTableData"
border
style="width: 100%"
:span-method="objectSpanMethod"
>
<el-button type="primary" size="mini" style="margin-bottom: 18px" @click="inTableAdd()"
v-if="sizeForm.options == 2 && outDialogType != 'details'">新增</el-button>
<el-table :data="sizeForm.inTableData" border style="width: 100%" :span-method="objectSpanMethod">
<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, scope.$index)"
v-if="
<el-select v-model="scope.row.materialId" placeholder="请选择物资名称" style="width: 100%"
@change="handleMaterialChange(scope.row, scope.$index)" v-if="
outDialogType != '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.materialId"
>
" value-key="id">
<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="unit" label="单位"> </el-table-column>
<el-table-column
label="部门"
prop="departmentName"
v-if="sizeForm.options === 2 || sizeForm.optionType"
:key="'account-dept-' + sizeForm.options"
>
<el-table-column label="部门" prop="departmentName" v-if="sizeForm.options === 2 || sizeForm.optionType"
:key="'account-dept-' + sizeForm.options">
<template slot-scope="scope">
<el-select
v-model="scope.row.department"
placeholder="请选择部门名称"
style="width: 100%"
v-if="outDialogType != 'details'"
@change="changeDepartment"
>
<el-option
v-for="item in list"
:key="item.departmentId"
:label="item.department"
:value="item.departmentId"
>
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%"
v-if="outDialogType != 'details'" @change="changeDepartment">
<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 prop="applicationQuantity" label="申请数量" v-if="sizeForm.options == 1">
<template slot-scope="scope">
{{ scope.row.applicationQuantity || 0 }}
</template>
</el-table-column>
<el-table-column
prop="num"
label="当前库存"
>
<el-table-column prop="num" label="当前库存">
<template slot-scope="scope">
<span>{{ scope.row.num }}</span>
</template>
</el-table-column>
<el-table-column
prop="outboundQuantity"
label="已出库数量"
v-if="sizeForm.options == 1"
>
<el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1">
<template slot-scope="scope">
<span>{{ scope.row.outboundQuantity || 0 }}</span>
</template>
@ -192,18 +118,11 @@
<el-table-column prop="theOutboundQuantity" label="本次出库数量">
<template slot-scope="scope">
<div v-if="outDialogType != 'details'">
<el-input-number
size="mini"
v-model="scope.row.theOutboundQuantity"
:min="0"
style="width: 100%"
@change="syncInboundQuantity(scope.row)"
:disabled="outDialogType == 'details'"
v-if="
<el-input-number size="mini" v-model="scope.row.theOutboundQuantity" :min="0" style="width: 100%"
@change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'" v-if="
sizeForm.optionType === 'YH' ||
(sizeForm.options == 1 && inBatchForm.optionType === 'YH')
"
></el-input-number>
"></el-input-number>
<span v-else>{{ scope.row.theOutboundQuantity }}</span>
</div>
<span v-else>{{ scope.row.theOutboundQuantity }}</span>
@ -215,23 +134,14 @@
scope.row.type === "NY"
? "耐用品"
: scope.row.type === "YH"
? "易耗品"
: ""
? "易耗品"
: ""
}}
</template>
</el-table-column>
<el-table-column
label="操作"
style="text-align: center"
width="100"
v-if="outDialogType != 'details'"
>
<el-table-column label="操作" style="text-align: center" width="100" v-if="outDialogType != 'details'">
<template slot-scope="scope">
<el-button
type="text"
size="mini"
@click="handleDelete(scope.$index, scope.row)"
>
<el-button type="text" size="mini" @click="handleDelete(scope.$index, scope.row)">
删除
</el-button>
</template>
@ -240,12 +150,7 @@
<div class="form-title" v-if="outDialogType !== 'details'">
出库账目表格
</div>
<el-table
:data="statisticsList"
border
style="width: 100%"
v-if="outDialogType !== 'details'"
>
<el-table :data="statisticsList" 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>
@ -258,8 +163,8 @@
scope.row.type === "NY"
? "耐用品"
: scope.row.type === "YH"
? "易耗品"
: ""
? "易耗品"
: ""
}}
</template>
</el-table-column>
@ -269,8 +174,8 @@
scope.row.type === "NY"
? "出库单"
: scope.row.type === "YH"
? "发放单"
: ""
? "发放单"
: ""
}}
</template>
</el-table-column>
@ -288,8 +193,7 @@
<el-table-column prop="date" label="出库后库存">
<el-table-column prop="totalQuantity" label="数量">
<template slot-scope="scope">
{{ scope.row.totalQuantity<0?0: scope.row.totalQuantity}}
</template>
{{ scope.row.totalQuantity < 0 ? 0 : scope.row.totalQuantity }} </template>
</el-table-column>
</el-table-column>
<el-table-column prop="date" label="出库信息">
@ -311,55 +215,24 @@
</el-table>
</el-form>
</div>
<span
slot="footer"
class="dialog-footer"
v-if="outDialogType != 'details'"
>
<el-button @click="handleCloseDetail()" :loading="saveLoading"
> </el-button
>
<el-button type="primary" @click="submit(1)" :loading="saveLoading"
>暂存</el-button
>
<el-button type="primary" @click="submit(2)" :loading="saveLoading"
>提交</el-button
>
<span slot="footer" class="dialog-footer" v-if="outDialogType != 'details'">
<el-button @click="handleCloseDetail()" :loading="saveLoading"> </el-button>
<el-button type="primary" @click="submit(1)" :loading="saveLoading">暂存</el-button>
<el-button type="primary" @click="submit(2)" :loading="saveLoading">提交</el-button>
</span>
</el-dialog>
<!-- 批量出库 选择数据源弹窗 -->
<el-dialog
:close-on-click-modal="false"
title="选择数据来源"
:visible.sync="inBatchDialogVisible"
:append-to-body="true"
width="40%"
@close="handleBatchClose"
@open="getQuarterList"
>
<el-form
:model="inBatchForm"
ref="dynamicValidateForm"
label-width="100px"
class="demo-dynamic"
>
<el-dialog :close-on-click-modal="false" title="选择数据来源" :visible.sync="inBatchDialogVisible" :append-to-body="true"
width="40%" @close="handleBatchClose" @open="getQuarterList">
<el-form :model="inBatchForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<el-row>
<el-col :span="24">
<el-form-item label="需求单">
<template slot-scope="scope">
<el-select
v-model="inBatchForm.batchType"
placeholder="请选择需求单"
style="width: 100%"
@change="onQuarterSelectChange"
>
<el-option
v-for="item in quarterList"
:key="item.ids"
:label="item.quarterName"
:value="item.ids"
:clearable="true"
>
<el-select v-model="inBatchForm.batchType" placeholder="请选择需求单" style="width: 100%"
@change="onQuarterSelectChange">
<el-option v-for="item in quarterList" :key="item.ids" :label="item.quarterName" :value="item.ids"
:clearable="true">
</el-option>
</el-select>
</template>
@ -367,29 +240,17 @@
</el-col>
<el-col :span="24">
<el-form-item label="部门">
<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-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>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="选项">
<el-radio-group
v-model="inBatchForm.optionType"
:disabled="outDialogType == 'details'"
>
<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>
@ -405,25 +266,13 @@
</el-dialog>
<!-- 单条新增耐用品弹窗 -->
<consumableDialog
v-if="consumableVisible"
:consumableVisible="consumableVisible"
:demandDialogTitle="demandDialogTitle"
@handleCloseDetail="closeDialog"
@confirm="confirm"
>
<consumableDialog v-if="consumableVisible" :consumableVisible="consumableVisible"
:demandDialogTitle="demandDialogTitle" @handleCloseDetail="closeDialog" @confirm="confirm">
</consumableDialog>
<!-- 批量耐用品弹窗 -->
<batchSelectionDialog
v-if="batchSelectionVisible"
:batchSelectionVisible="batchSelectionVisible"
:batchSelectionTitle="batchSelectionTitle"
:tableData="batchTableData"
@batchclose="batchclose"
:inBatchForm="inBatchForm"
@confirm-selection="handleConfirmSelection"
@selectionChange="selectionChange"
>
<batchSelectionDialog v-if="batchSelectionVisible" :batchSelectionVisible="batchSelectionVisible"
:batchSelectionTitle="batchSelectionTitle" :tableData="batchTableData" @batchclose="batchclose"
:inBatchForm="inBatchForm" @confirm-selection="handleConfirmSelection" @selectionChange="selectionChange">
</batchSelectionDialog>
</div>
</template>
@ -469,6 +318,10 @@ export default {
type: Number,
default: 0,
},
rowItem: {
type: Object,
default: () => { }
}
},
data() {
return {
@ -532,7 +385,7 @@ export default {
} else {
this.inInit();
}
this.sizeForm.userInfoVO = this.userInfo;
// this.getMaterialList()
},
@ -541,7 +394,7 @@ export default {
if (this.sizeForm.options == 1 && this.inBatchForm.optionType == "NY") {
if (
columnIndex === 0 ||
columnIndex === 1
columnIndex === 1
) {
const key = `${row.materialCode}-${row.materialName}`;
const rows = this.sizeForm.inTableData.filter(
@ -571,7 +424,7 @@ export default {
},
getStatistics() {
let arr = JSON.parse(JSON.stringify(this.sizeForm.inTableData));
arr.forEach((row) => {
row.id = row.oneFormId;
});
@ -592,13 +445,13 @@ export default {
item.materialCode === stat.materialCode &&
item.materialName === stat.materialName
);
console.log(8989898989,detailList)
console.log(8989898989, detailList)
detail.theOutboundQuantity = detailList.reduce(
(acc, cur) => acc + cur.theOutboundQuantity,
0
);
}
return {
...stat,
theOutboundQuantity: detail.theOutboundQuantity, //
@ -796,10 +649,10 @@ export default {
const appQty = Number(item.applicationQuantity || 0);
const outQty = Number(item.outboundQuantity || 0);
const defaultQty = appQty - outQty;
if (this.inBatchForm.optionType === "YH"){
if (this.inBatchForm.optionType === "YH") {
item.department = selectedDept.departmentId
item.departmentName = selectedDept.department
}
}
return {
...item,
IdDemandEndld: this.inBatchForm.batchType,
@ -840,8 +693,7 @@ export default {
}
} catch (error) {
this.$message.error(
`获取${
this.inBatchForm.optionType === "YH" ? "易耗品" : "耐用品"
`获取${this.inBatchForm.optionType === "YH" ? "易耗品" : "耐用品"
}数据失败${error.message}`
);
}
@ -850,8 +702,11 @@ export default {
async getDetailedItems() {
this.loading = true;
try {
const res = await getDetailedItems();
this.list = res.data.result;
// const res = await ;
// this.list = res.data.result;
getDetailedItems().then(res=>{
this.list = res.data.result;
})
} catch (error) {
this.$message.error("获取数据来源失败,请重试");
} finally {
@ -1090,6 +945,7 @@ export default {
overflow-y: auto;
padding-right: 10px;
}
::v-deep.el-table th.el-table__cell {
background: #f5f7fa;
font-weight: 500;

@ -65,6 +65,7 @@
type="一级库"
@submitSuccess="handleSubmitSuccess"
:id="id"
:rowItem = "rowItem"
>
</outDialog>
@ -91,6 +92,7 @@ export default {
},
data() {
return {
rowItem:{},
form: { outDate: [] },
selectionList: [],
query: {},
@ -264,6 +266,7 @@ export default {
//
handleDetails(row) {
console.log(row, "row详情");
this.rowItem = row
this.outDialogVisible = true;
this.outDialogType = "details";
this.outDialogTiltle = "详情";

@ -80,7 +80,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="handleCloseDetail()"> </el-button>
<el-button type="primary" @click="sumbit()"> </el-button>
<el-button type="primary" @click="sumbit()" v-if="inDialogTiltle=='入库'"> </el-button>
</span>
</template>
</el-dialog>

@ -1,59 +1,28 @@
<template>
<basic-container>
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
ref="crud"
v-model="form"
:page.sync="page"
:permission="permissionList"
@search-change="searchChange"
@search-reset="searchReset"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page"
:permission="permissionList" @search-change="searchChange" @search-reset="searchReset"
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
<template slot-scope="scope" slot="menuLeft">
</template>
<template slot-scope="scope" slot="menu">
<el-button
type="text"
v-if="scope.row.status == 1"
@click="rowSelect(scope.row)"
>入库</el-button
>
<el-button type="text" @click="detailsFn(scope.row)">详情</el-button>
<el-button type="text" v-if="scope.row.status == 1" @click="rowSelect(scope.row)">入库</el-button>
</template>
<template slot-scope="scope" slot="caigoudanmingcheng">
<el-button
type="text"
@click.stop="purchaseFn(scope.row)"
v-if="scope.row.caigoudanmingcheng != ''"
>{{ scope.row.caigoudanmingcheng }}</el-button
>
<el-button type="text" @click.stop="purchaseFn(scope.row)" v-if="scope.row.caigoudanmingcheng != ''">{{
scope.row.caigoudanmingcheng }}</el-button>
<span v-else></span>
</template>
</avue-crud>
<!-- 入库 -->
<inDialog
v-if="inDialogVisible"
:repairVisible="inDialogVisible"
:inDialogTiltle="inDialogTiltle"
:inDialogType="inDialogType"
:inDialogData="inDialogData"
@handleCloseDetail="handleCloseDetail"
type="二级库"
>
<inDialog v-if="inDialogVisible" :repairVisible="inDialogVisible" :inDialogTiltle="inDialogTiltle"
:inDialogType="inDialogType" :inDialogData="inDialogData" @handleCloseDetail="handleCloseDetail" type="二级库">
</inDialog>
<!-- 采购单详情 -->
<purchaseDialog
:showDialog="purchaseOpen"
v-if="purchaseOpen"
@closeDialog="closeDialog"
:purchaseTitle="purchaseTitle"
></purchaseDialog>
<purchaseDialog :showDialog="purchaseOpen" v-if="purchaseOpen" @closeDialog="closeDialog"
:purchaseTitle="purchaseTitle"></purchaseDialog>
</basic-container>
</template>
@ -160,7 +129,7 @@ export default {
label: "部门",
prop: "demandDepartmentName",
search: true,
hide:true,
hide: true,
headerAlign: "center",
align: "center",
},
@ -206,6 +175,11 @@ export default {
this.inDialogVisible = false;
this.onLoad(this.page);
},
detailsFn(row){
this.inDialogVisible = true;
this.inDialogTiltle = "详情";
this.inDialogData = row;
},
//
rowSelect(row) {
this.inDialogVisible = true;

Loading…
Cancel
Save