领料申请管理

This commit is contained in:
wlikett 2023-12-23 18:42:25 +08:00
parent 3718c45b4d
commit fd12bca625
3 changed files with 327 additions and 130 deletions

View File

@ -165,14 +165,15 @@ import {
getDeviceTypeTree,
getAgreementInfoById,
submitLeaseApply,
getTaskDetail
getTaskDetail,
editLeaseApply
} from '@/api/claimAndRefund/receive'
import { mapState } from 'vuex'
import { getInfo } from '@/api/login'
export default {
name: "Role",
data() {
return {
user:null, //
//
loading: false,
//
@ -250,10 +251,11 @@ export default {
},
leaseApplyDetails:[],
leaseApplyInfoList:[],
//
leaseApplyDetailsItem:{
parenntId:null,
createBy: null,
companyId: null,
status: 0,
@ -280,6 +282,9 @@ export default {
unitList:[], //
proList:[], //
deviceTypeTree: [], //
taskId:null, //
//
deviceTypeTreeProps: {
multiple:false,
@ -309,21 +314,27 @@ export default {
};
},
created() {
this.GetUserInfo()
this.GetUnitData()
this.GetProData()
this.GetDeviceTypeTree()
// this.getList();
console.log('this.$route.query.taskId',this.$route.query.taskId)
if(this.$route.query.taskId){
this.GetTaskDetail(this.$route.query.taskId)
this.taskId = this.$route.query.taskId
}
},
computed:{
...mapState(['user'])
},
methods: {
//
async GetUserInfo(){
const res = await getInfo()
this.user = res.user
},
//
async GetUnitData(){
const params = {
@ -381,7 +392,6 @@ export default {
const res = await getTaskDetail({taskId})
const data = res.rows[0]
console.log('GetTaskDetail =================',data)
// unitId:null,
// proId:null,
@ -390,11 +400,12 @@ export default {
this.queryParams.unitId = data.unitId
this.queryParams.proId = data.projectId
this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfo.phone
this.queryParams.leaseApplyInfo.leasePerson = data.leaseApplyInfo.leasePerson
this.queryParams.leaseApplyInfo.phone = data.leaseApplyInfoList[0].phone
this.queryParams.leaseApplyInfo.leasePerson = data.leaseApplyInfoList[0].leasePerson
this.queryParams.agreementCode = data.agreementCode
this.queryParams.leaseApplyInfo.remark = data.leaseApplyInfo.remark
this.queryParams.agreementId = data.agreementId
this.queryParams.leaseApplyInfo.remark = data.leaseApplyInfoList[0].remark
this.leaseApplyInfoList = data.leaseApplyInfoList
this.leaseApplyDetails = data.leaseApplyDetails.map(item => {
return this.handelEchoData(item)
})
@ -412,7 +423,7 @@ export default {
template.remark = item.remark
template.preNum = item.preNum
template.status = item.status
template.parenntId = item.parenntId
return template
},
@ -534,11 +545,27 @@ export default {
this.$message.error('请添加数据');
return
}
this.queryParams.createBy = this.user.name
this.queryParams.companyId = this.user.id
this.queryParams.createBy = this.user.userName
this.queryParams.companyId = this.user.companyId
const res = await submitLeaseApply(this.queryParams)
let res;
if(this.taskId){
this.leaseApplyInfoList.forEach(v => {
v = Object.assign(v,this.queryParams.leaseApplyInfo)
this.$set(v,'leaseApplyDetails',this.queryParams.leaseApplyDetails)
})
const params = {
...this.queryParams,taskId:this.taskId,
leaseApplyInfoList:this.leaseApplyInfoList
}
res = await editLeaseApply(params)
}else {
res = await submitLeaseApply(this.queryParams)
}
if(res.code == 200){
this.$message({
type:'success',
@ -623,7 +650,7 @@ export default {
if(nodes[0].level != 4){
return
}
console.log('nodes[0]',nodes[0],this.user)
this.leaseApplyDetails.push(
this.handelTableItemData(nodes[0])
)
@ -641,11 +668,17 @@ export default {
handelTableItemData(node){
const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem))
template.createBy = this.user.name
template.companyId = this.user.id
template.companyId = node.data.companyId
template.typeId = node.data.id
template.unitCn = node.data.unitName
template.typeCn = node.pathLabels[2]
template.guigeCn = node.pathLabels[3]
if(this.taskId){
const index = this.leaseApplyInfoList.find(key => key.companyId == node.data.companyId)
template.parenntId = index ? index.id : ''
}
return template
}
}

View File

@ -1,54 +1,50 @@
<template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<h3>肖洁提交的领料申请</h3>
<div>领料单号L20231122-001</div>
<h3>{{ queryParams.applyFor }}提交的领料申请</h3>
<div>领料单号{{ queryParams.code }}</div>
</el-row>
<el-row :gutter="24" class="mb8">
<el-col :span="18">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="领料工程" prop="dictName">
<el-input
v-model="queryParams.dictName"
v-model="queryParams.proName"
placeholder="请输入领料工程"
clearable
style="width: 240px"
disabled
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="领料人" prop="dictName">
<el-input
v-model="queryParams.dictName"
v-model="queryParams.leaseApplyInfo.leasePerson"
placeholder="请输入领料人"
clearable
style="width: 240px"
disabled
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系电话" prop="dictName">
<el-input
v-model="queryParams.dictName"
v-model="queryParams.leaseApplyInfo.phone"
placeholder="请输入联系电话"
clearable
style="width: 240px"
disabled
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="dictId" />
<el-table-column label="类型名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table v-loading="loading" :data="queryParams.leaseApplyDetails" @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="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="当前库存" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="预览数量" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="出库数量" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="申请人" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="申请时间" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="任务状态" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="当前库存" align="center" prop="num" :show-overflow-tooltip="true" />
<el-table-column label="预领数量" align="center" prop="preNum" :show-overflow-tooltip="true" />
<el-table-column label="申请人" align="center" prop="applyFor" :show-overflow-tooltip="true" />
<el-table-column label="申请时间" align="center" prop="updateTimes" :show-overflow-tooltip="true" />
<el-table-column label="任务状态" align="center" prop="taskName" :show-overflow-tooltip="true" />
<!-- <el-table-column label="审批结果 " align="center" prop="dictName" :show-overflow-tooltip="true" />-->
<el-table-column label="备注" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
@ -69,13 +65,13 @@
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- <pagination-->
<!-- v-show="total>0"-->
<!-- :total="total"-->
<!-- :page.sync="queryParams.pageNum"-->
<!-- :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"-->
<!-- />-->
</el-col>
<el-col :span="6">
@ -88,48 +84,76 @@
<!-- </el-timeline-item>-->
<!-- </el-timeline>-->
<el-timeline>
<el-timeline-item timestamp="2018/4/12" placement="top">
<el-timeline-item color="#0bbd87" icon="el-icon-check" placement="top">
<el-card>
<h4>提交审批</h4>
<p>肖洁 提交于 2018/4/12 20:46</p>
<p class="title">提交审批</p>
<p class="author">申请人{{queryParams.applyFor}}</p>
<p class="time">申请时间{{queryParams.updateTimes}}</p>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="2018/4/3" placement="top">
<el-timeline-item v-for="(v,i) in flowPath" :type="v.type" :color="v.color" :icon="v.icon" :key="i" placement="top">
<el-card>
<h4>公司审批</h4>
<p>肖洁 提交于 2018/4/3 20:46</p>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="2018/4/2" placement="top">
<el-card>
<h4>部门审批</h4>
<p>肖洁 提交于 2018/4/2 20:46</p>
<p class="title">{{v.name}}</p>
<p class="author" v-if="queryParams[v.authorKey]">审核人{{queryParams[v.authorKey]}}</p>
<p class="time" v-if="queryParams[v.timeKey]">审核时间{{queryParams[v.timeKey]}}</p>
<p class="remark" v-if="queryParams[v.remarkKey]">审核意见{{ queryParams[v.remarkKey] }}</p>
</el-card>
</el-timeline-item>
</el-timeline>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer" style="text-align: right;margin-right: 200px;">
<el-button type="primary" >同意</el-button>
<el-button >拒绝</el-button>
<el-button type="primary" @click="agree">同意</el-button>
<!-- <el-button >拒绝</el-button>-->
</div>
<el-dialog title="审核意见" :visible.sync="examineVisible">
<el-input placeholder="请输入审核意见" v-model="queryParams.companyAuditRemarks "></el-input>
<div slot="footer" class="dialog-footer">
<el-button @click="handelExamine(false)"> </el-button>
<el-button type="primary" @click="handelExamine(true)"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { auditLeaseByCompany, getTaskDetail } from '@/api/claimAndRefund/receive'
import {mapState} from 'vuex'
export default {
name: "Dict",
dicts: ['sys_normal_disable'],
data() {
return {
flowPath:[
{
id:30,
name:'待分公司审核',
remarkKey:'companyAuditRemark',
authorKey:'companyAuditBy',
timeKey:'companyAuditTime'
},{
id:31,
name:'待分管部门审核',
remarkKey:'deptAuditRemark',
authorKey:'deptAuditBy',
timeKey:'deptAuditTime'
},{
id:32,
name:'待内部审核',
remarkKey:'directAuditRemark',
authorKey:'directAuditBy',
timeKey:'directAuditTime'
}
],
examineVisible:false,
//
loading: true,
loading: false,
//
ids: [],
//
@ -150,11 +174,11 @@ export default {
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined
leaseApplyInfo:{
},
leaseApplyDetails:[],
companyAuditRemarks:''
},
//
form: {},
@ -187,22 +211,72 @@ export default {
}, {
content: '部门审批',
timestamp: '2018-04-11'
}]
}],
};
},
computed:{
...mapState(['user'])
},
created() {
this.getList();
let taskId = this.$route.query.taskId
if(taskId){
this.getData(taskId)
}
},
methods: {
/** 查询字典类型列表 */
getList() {
this.loading = true;
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.typeList = response.rows;
this.total = response.total;
this.loading = false;
agree(){
this.examineVisible = true
},
handelExamine(type){
if(type){
this.subAuditLeaseByCompany()
}else {
this.queryParams.companyAuditRemarks = ''
}
this.examineVisible = type
},
//
async subAuditLeaseByCompany(){
const params = JSON.parse(JSON.stringify(this.queryParams))
params.taskStatus ++
params.leaseApplyInfoList.forEach(v => {
this.$set(v,'companyAuditRemark',params.companyAuditRemarks)
this.$set(v,'companyAuditBy',this.user.id)
})
const res = await auditLeaseByCompany(params)
if(res.code == 200){
this.examineVisible = false
this.$router.back()
}
console.log('subAuditLeaseByCompany ==================',res)
},
/** 查询字典类型列表 */
async getData(taskId) {
const res = await getTaskDetail({
taskId
})
this.queryParams = {...this.queryParams,...res.rows[0]}
this.$set(this.queryParams,'leaseApplyInfo',this.queryParams.leaseApplyInfoList[0])
this.queryParams.leaseApplyDetails.forEach(v => {
this.$set(v,'applyFor',this.queryParams.applyFor)
this.$set(v,'updateTimes',this.queryParams.updateTimes)
this.$set(v,'taskName',this.queryParams.taskName)
})
for (let i=0; i < this.flowPath.length; i++ ){
if(this.flowPath[i].id == this.queryParams.examineStatusId){
this.flowPath[i].type = 'primary'
this.flowPath[i].icon = 'el-icon-more'
break
}else {
this.flowPath[i].color = '#0bbd87'
this.flowPath[i].icon = 'el-icon-check'
}
}
);
},
//
cancel() {
@ -302,3 +376,28 @@ export default {
}
};
</script>
<style lang="scss" scoped>
::v-deep .el-card__body{
padding: 10px !important;
p{
margin: 0 !important;
}
.title{
color: #848484;
font-weight: 700;
}
.author{
font-size: 13px;
margin-top: 5px;
}
.time{
font-size: 12px;
}
.remark{
margin-top: 10px;
word-break: break-all;
font-size: 13px;
}
}
</style>

View File

@ -97,18 +97,7 @@
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-button
v-if=" scope.row "
size="mini"
@ -121,7 +110,7 @@
size="mini"
type="text"
icon="el-icon-document"
@click="handleExamine(scope.row)"
@click="openLld(scope.row)"
>领料单</el-button>
</template>
</el-table-column>
@ -135,53 +124,72 @@
@pagination="getList"
/>
<!-- 新增编辑弹窗 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="往来单位:" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入往来单位" />
</el-form-item>
<el-form-item label="工程名称" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入工程名称" />
</el-form-item>
<el-form-item label="开始日期" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入开始日期" />
</el-form-item>
<el-form-item label="租赁期限" prop="dictName">
<el-input-number v-model="form.dictName" style="width:100%;" controls-position="right" :min="0" />
</el-form-item>
<el-form-item label="授权人" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入授权人" />
</el-form-item>
<el-form-item label="授权人" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入授权人" />
</el-form-item>
<el-form-item label=" 联系方式" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入联系方式" />
</el-form-item>
<!-- 领料单弹窗 -->
<el-dialog :visible.sync="open" width="800px" append-to-body>
<vue-easy-print tableShow ref="remarksPrintRef" class="print">
<div class="title" style="text-align: center;font-weight: 600;font-size: 16px;">
领料单
</div>
<div class="info" style="margin-top: 10px;display: flex;flex-wrap: wrap;">
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>领料单位</span>{{ leaseApplyData.unitName }}
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>工程名称</span>{{ leaseApplyData.proName }}
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>时间</span>{{ leaseApplyData.updateTimes }}
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>编号</span>{{ leaseApplyData.agreementCode }}
</div>
</div>
<el-table :data="leaseApplyDetails" class="table" style="margin-top: 20px">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="类型名称" align="center" prop="typeName" />
<el-table-column label="规格型号" align="center" prop="typeModelName" />
<el-table-column label="计量单位" align="center" prop="unitName" />
<el-table-column label="预领数量" align="center" prop="preNum" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="出库方式" align="center" prop="manageTypeName" />
</el-table>
<div class="fillIn" style="margin-top: 20px;display: flex;justify-content: space-between;">
<div class="item" style="width: 25%;">
<span>审核</span>
</div>
<div class="item" style="width: 25%;">
<span>领料</span>
</div>
<div class="item" style="width: 25%;">
<span>仓库</span>
</div>
<div class="item" style="width: 25%;">
<span>操作人</span>
</div>
</div>
</vue-easy-print>
<el-form-item label="合同照片" prop="dictName">
<el-input v-model="form.dictName" placeholder="图片上传" />
</el-form-item>
<el-form-item label="备注" prop="dictName">
<el-input v-model="form.dictName" type="textarea" placeholder="图片上传" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="print"> </el-button>
<el-button @click="open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { getLeaseAuditListAll,getUnitData,getProData } from "@/api/claimAndRefund/receive";
import { getLeaseAuditListAll, getUnitData, getProData, getTaskDetail } from '@/api/claimAndRefund/receive'
import vueEasyPrint from 'vue-easy-print';
export default {
name: "Dict",
data() {
@ -247,6 +255,11 @@ export default {
]
},
deptName: undefined,
//
leaseApplyDetails:[],
//
leaseApplyData:{}
};
},
created() {
@ -255,6 +268,7 @@ export default {
this.GetUnitData()
this.GetProData()
},
components:{vueEasyPrint},
methods: {
/** 查询字典类型列表 */
async getList() {
@ -335,8 +349,30 @@ export default {
// this.title = "";
},
handleExamine(row) {
this.$router.push("/claimAndRefund/receive/receiveExamine");
this.$router.push({
path:"/claimAndRefund/receive/receiveExamine",
query: {
taskId:row.taskId
}
});
},
//
async openLld(row){
this.open = true
const res = await getTaskDetail({taskId:row.taskId})
this.leaseApplyDetails = res.rows[0].leaseApplyDetails
this.leaseApplyData = res.rows[0]
console.log('this.leaseApplyData ============',this.leaseApplyData)
},
//
print(){
this.$refs.remarksPrintRef.print();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.dictId)
@ -399,3 +435,32 @@ export default {
}
};
</script>
<style lang="scss" scoped>
.print{
.title{
text-align: center;
font-weight: 600;
font-size: 16px;
}
.info{
margin-top: 10px;
display: flex;
flex-wrap: wrap;
.item{
width: 50%;
flex-shrink: 0;
margin-bottom: 5px;
font-size: 14px;
}
}
.fillIn{
margin-top: 15px;
display: flex;
justify-content: space-between;
}
}
</style>