前端问题修改

This commit is contained in:
zhouzy062 2024-03-25 16:04:51 +08:00
parent 369b8f08b0
commit 54c25d1997
5 changed files with 540 additions and 2 deletions

View File

@ -0,0 +1,500 @@
<template>
<div class="app-container" id="secondStore">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="领料单号" prop="keyword">
<el-input
v-model="queryParams.keyword"
placeholder="请输入关键字"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单位名称" prop="unitId">
<el-select v-model="queryParams.unitId" placeholder="请选择单位名称" clearable>
<el-option
v-for="item in unitList" filterable
:key="item.id" :label="item.name" :value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工程名称">
<el-select v-model="queryParams.proId" filterable clearable placeholder="请选择工程名称">
<el-option
v-for="item in proList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="出库状态" prop="leaseStatus">
<el-select v-model="queryParams.leaseStatus" placeholder="请选择出库状态" clearable>
<el-option
v-for="item in statusList" filterable
:key="item.id" :label="item.name" :value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="leaseList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="领料单号" align="center" prop="code" :show-overflow-tooltip="true" />
<el-table-column label="领料申请单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="领料申请工程" align="center" prop="proName" :show-overflow-tooltip="true" />
<el-table-column label="申请数量" align="center" prop="" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="申请时间" align="center" prop="createTimes" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="已出库数量" align="center" prop="" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="出库状态" align="center" prop="" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
@click="handle(scope.row)"
></el-button>
<el-button
size="mini"
type="warning"
@click="handleOut(scope.row)"
>出库</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 出库弹窗 -->
<el-dialog :title="title" :visible.sync="openOut" width="600px" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="类型名称:" prop="typeName">
<el-input v-model="form.typeName" placeholder="请输入类型名称" disabled/>
</el-form-item>
<el-form-item label="规格型号" prop="modelName">
<el-input v-model="form.modelName" placeholder="请输入规格型号" disabled/>
</el-form-item>
<el-form-item label="在库数量" prop="zkNum">
<el-input v-model="form.zkNum" placeholder="请输入在库数量" disabled/>
</el-form-item>
<el-form-item label="出库数量" prop="num">
<el-input v-model="form.num" placeholder="请输入出库数量" />
</el-form-item>
<el-form-item label="班组名称" prop="teamName">
<el-input v-model="form.teamName" placeholder="请输入班组名称" maxlength="50" />
</el-form-item>
<el-form-item label="领用人员" prop="leaseMan">
<el-input v-model="form.leaseMan" placeholder="请输入领用人员" maxlength="50" />
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="submitForm(1)"> </el-button>
<el-button @click="openOut=false"> </el-button>
</div>
</el-dialog>
<!-- 进库弹窗 -->
<el-dialog :title="title" :visible.sync="openIn" width="600px" append-to-body :close-on-click-modal="false">
<el-form ref="nform" :model="nform" :rules="nrules" label-width="120px">
<el-form-item label="类型名称:" prop="typeName">
<el-input v-model="nform.typeName" placeholder="请输入类型名称" disabled/>
</el-form-item>
<el-form-item label="规格型号" prop="modelName">
<el-input v-model="nform.modelName" placeholder="请输入规格型号" disabled/>
</el-form-item>
<el-form-item label="退库数量" prop="num">
<el-input v-model="nform.num" placeholder="请输入退库数量"/>
</el-form-item>
<el-form-item label="班组名称" prop="teamName">
<el-input v-model="nform.teamName" placeholder="请输入班组名称" maxlength="50" />
</el-form-item>
<el-form-item label="退库人员" prop="leaseMan">
<el-input v-model="nform.leaseMan" placeholder="请输入退库人员" maxlength="50" />
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="nform.phone" placeholder="请输入联系电话" maxlength="11" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="submitForm(2)"> </el-button>
<el-button @click="openIn=false"> </el-button>
</div>
</el-dialog>
<!-- 记录弹窗 -->
<el-dialog :title="title" :visible.sync="openRecord" width="1200px" append-to-body>
<el-form :model="dialogQuery" ref="dialogQuery" size="small" :inline="true" label-width="80px">
<el-form-item label="记录时间" prop="startTime">
<el-date-picker
v-model="dialogQuery.startTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="date"
placeholder="记录时间"
></el-date-picker>
</el-form-item>
<el-form-item label="类型名称" prop="typeName">
<el-input
v-model="dialogQuery.typeName"
disabled
/>
</el-form-item>
<el-form-item label="规格型号" prop="modelName">
<el-input v-model="dialogQuery.modelName" disabled />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleDialogQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetDialogQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="dialogList">
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="类型名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="modelName" :show-overflow-tooltip="true" />
<el-table-column label="数量" align="center" prop="num" :show-overflow-tooltip="true" />
<el-table-column label="记录时间" align="center" prop="startTime" :show-overflow-tooltip="true" />
<el-table-column label="操作类型" align="center" prop="" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="dialogTotal>0"
:total="dialogTotal"
:page.sync="dialogQuery.pageNum"
:limit.sync="dialogQuery.pageSize"
@pagination="getDialogList"
/>
</el-dialog>
</div>
</template>
<script>
import { operate,getRecords } from "@/api/claimAndRefund/secondStore";
import { getUnitData,getProData,getLeaseAuditListAll } from "@/api/claimAndRefund/receive.js"
import { getTypeList } from "@/api/store/warehousing";
import { equipmentTypeTree } from "@/api/store/tools";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "SecondStore",
dicts: ['sys_normal_disable'],
components: { Treeselect },
data() {
return {
//
loading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
leaseList: [],
//
title: "",
//
openOut: false,
openIn: false,
//
dateRange: [],
//
unitList: [],
proList:[], //
statusList:[{id:'0',name:'未出库'},{id:'1',name:'出库中'},{id:'2',name:'已出库'}], //
//
typeList: [],
equipmentTypeList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
unitId: undefined,
modelId: undefined,
typeId: undefined
},
//
form: {},
//
rules: {
num: [
{ required: true, message: "出库数量不能为空", trigger: "blur" }
],
teamName: [
{ required: true, message: "班组名称不能为空", trigger: "blur" }
]
},
// 退
nform:{},
nrules: {
num: [
{ required: true, message: "退库数量不能为空", trigger: "blur" }
],
teamName: [
{ required: true, message: "班组名称不能为空", trigger: "blur" }
]
},
//
openRecord:false,
dialogQuery: {
pageNum: 1,
pageSize: 10,
startTime: undefined,
unitId: undefined,
modelId: undefined,
typeId: undefined
},
dialogList:[],
queryType:1,
dialogTotal: 0,
};
},
created() {
this.getTypeList();
this.getUnitList();
this.getProList()
this.equipmentType();
this.getList();
},
methods: {
//
getUnitList(){
getUnitData().then(response => {
this.unitList = response.data;
})
},
//
getProList(){
getProData().then(response => {
this.proList = response.data;
})
},
getTypeList() {
getTypeList({level:'3'}).then(response => {
this.typeList = response.data;
}
)
},
//
equipmentType() {
equipmentTypeTree().then(response => {
this.equipmentTypeList = response.data;
this.equipmentTypeList.forEach((item,index)=>{
if(item.children.length>0){
item.children.forEach((item2,index2)=>{
if(item2.children.length>0){
item2.children.forEach(item3=>{
if(item3.children.length>0){
item3.children.forEach(item4=>{
item4.machineTypeName = item3.typeName
item4.specificationType = item4.typeName
// item4.purchasePrice = 1
// item4.purchaseNum = 1
this.$set(item4, 'purchasePrice', 0);
this.$set(item4, 'purchaseNum', 1);
})
}
})
}
})
}
})
});
},
/** 查询列表 */
getList() {
this.loading = true;
getLeaseAuditListAll(this.queryParams).then(response => {
this.leaseList = response.data.rows;
this.total = response.data.total;
this.loading = false;
}
);
},
//
cancel() {
this.openOut = false;
this.openIn = false;
this.reset();
},
//
reset() {
this.form = {
};
this.resetForm("form");
this.nform = {
};
this.resetForm("nform");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
handleDialogQuery() {
this.dialogQuery.pageNum = 1;
this.getDialogList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
resetDialogQuery() {
this.resetForm("dialogQuery");
this.handleDialogQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.dictId)
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 按钮操作 */
handleOut(row) {//1
this.reset();
// this.form = row;
console.log(row)
this.$set(this.form,'unitId',row.unitId)
this.$set(this.form,'typeId',row.typeId)
this.$set(this.form,'unitName',row.unitName)
this.$set(this.form,'typeName',row.typeName)
this.$set(this.form,'modelName',row.modelName)
this.$set(this.form,'zkNum',row.zkNum)
console.log(this.form)
this.openOut = true;
this.title = "出库";
},
handleIn(row) {//2
this.reset();
// this.nform = row;
this.$set(this.nform,'unitId',row.unitId)
this.$set(this.nform,'typeId',row.typeId)
this.$set(this.nform,'unitName',row.unitName)
this.$set(this.nform,'typeName',row.typeName)
this.$set(this.nform,'modelName',row.modelName)
this.openIn = true;
this.title = "退库";
},
/** 提交按钮 */
submitForm: function(type) {
if(type==1){
this.$refs["form"].validate(valid => {
if (valid) {
let param = {}
param = this.form
param.type=1
operate(param).then(response => {
this.$modal.msgSuccess("操作成功");
this.openOut = false;
this.getList();
});
}
});
}
if(type==2){
this.$refs["nform"].validate(valid => {
if (valid) {
let param = {}
param = this.nform
param.type=2
operate(param).then(response => {
this.$modal.msgSuccess("操作成功");
this.openIn = false;
this.getList();
});
}
});
}
},
//
openRecords(row,type){
this.openRecord = true;
this.queryType = type
this.dialogQuery.typeName = row.typeName;
this.dialogQuery.modelName = row.modelName;
this.dialogQuery.unitId = row.unitId;
this.dialogQuery.typeId = row.typeId;
this.getDialogList();
},
/** 查询列表 */
getDialogList() {
this.dialogQuery.queryType = this.queryType;
getRecords(this.dialogQuery).then(response => {
this.dialogList = response.rows;
this.dialogTotal = response.total;
}
);
},
/** 导出按钮操作 */
handleExport() {
this.downloadJson('material/secondaryWarehouse/exportList',JSON.stringify(this.queryParams), `二级库_${new Date().getTime()}.xlsx`)
},
}
};
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
.clickText{
color: #02A7F0;
cursor: pointer;
}
</style>

View File

@ -433,6 +433,16 @@
width="200" width="200"
prop="num" prop="num"
> >
<template slot-scope="scope">
<el-input
v-model.number="scope.row.num"
placeholder="请输入退料数量"
type="number"
min="1"
clearable @input="checkNum(scope.row)"
style="width: 100%"
/>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -730,6 +740,14 @@ export default {
}, },
/** 提交按钮 同意 */ /** 提交按钮 同意 */
submitForm() { submitForm() {
const isNum = this.loadingList.some(
(item) => item.num == '' || item.num == undefined
);
if (isNum) {
this.$message.error('退料数量不能为空!');
return;
}
let params = { let params = {
ids: this.rowObj.id ids: this.rowObj.id
} }
@ -742,6 +760,13 @@ export default {
}, },
/** 提交按钮 拒绝 */ /** 提交按钮 拒绝 */
submitForm2() { submitForm2() {
const isNum = this.loadingList.some(
(item) => item.num == '' || item.num == undefined
);
if (isNum) {
this.$message.error('退料数量不能为空!');
return;
}
let params = { let params = {
ids: this.rowObj.id ids: this.rowObj.id
} }
@ -771,6 +796,13 @@ export default {
return false return false
} }
}, },
checkNum(row){
if(row.num>=0){
row.num = row.num
}else{
row.num = 0
}
},
handleExam() { handleExam() {
let params = { let params = {
ids: this.ids.join(',') ids: this.ids.join(',')

View File

@ -12,6 +12,7 @@
}, },
created () { created () {
this.openNewWindow() this.openNewWindow()
this.$tab.closePage().then(() => { });
}, },
methods: { methods: {
openNewWindow() { openNewWindow() {

View File

@ -94,7 +94,7 @@
size="mini" size="mini"
type="primary" type="primary"
icon="el-icon-edit" icon="el-icon-edit"
v-show="scope.row.status==0" v-show="scope.row.checkNum<scope.row.purchaseNum"
@click="handleCheck(scope.row)" @click="handleCheck(scope.row)"
>验收</el-button> >验收</el-button>
<!-- <el-button <!-- <el-button

View File

@ -661,7 +661,12 @@ export default {
this.upload.open = false; this.upload.open = false;
this.upload.isUploading = false; this.upload.isUploading = false;
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true }); if(response.code==200){
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
}else{
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + '导入失败' + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
}
this.getList(); this.getList();
}, },
// //