领料任务详情接口对接 对接

This commit is contained in:
wlikett 2023-12-22 15:33:24 +08:00
parent 9fa297de47
commit 9d8bd6d94b
4 changed files with 164 additions and 58 deletions

View File

@ -105,6 +105,7 @@ export function getAgreementInfoById(params = {}){
}) })
} }
//提交 领料申请
export function submitLeaseApply(params = {}){ export function submitLeaseApply(params = {}){
return request({ return request({
url:'/base/tm_task/submitLeaseApply', url:'/base/tm_task/submitLeaseApply',
@ -113,6 +114,23 @@ export function submitLeaseApply(params = {}){
}) })
} }
// 参数 领料任务
export function deleteTask( taskId ){
return request({
url:`/base/tm_task/${taskId}`,
method:'delete'
})
}
// 根据 领料任务id 获取详情数据
export function getTaskDetail( params = {} ){
return request({
url: '/base/tm_task/getLeaseListAll',
method:'get',
params:params
})
}
@ -143,9 +161,6 @@ export function submitLeaseApply(params = {}){

View File

@ -104,14 +104,12 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['store:labelType:edit']"
>编辑</el-button> >编辑</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['store:labelType:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -171,7 +169,7 @@
<script> <script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type"; import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { getLeaseAuditListAll,getUnitData,getProData } from "@/api/claimAndRefund/receive"; import { getLeaseAuditListAll,getUnitData,getProData,deleteTask } from "@/api/claimAndRefund/receive";
export default { export default {
@ -251,8 +249,6 @@ export default {
async getList() { async getList() {
this.loading = true; this.loading = true;
console.log( 'this.queryParams =============',this.queryParams )
const params = { const params = {
unitId:this.queryParams.unitId, unitId:this.queryParams.unitId,
projectId:this.queryParams.proId, projectId:this.queryParams.proId,
@ -266,7 +262,6 @@ export default {
const res = await getLeaseAuditListAll(params) const res = await getLeaseAuditListAll(params)
this.loading = false; this.loading = false;
console.log('res ============',res)
this.leaseAuditList = res.data.rows; this.leaseAuditList = res.data.rows;
this.total = res.data.total; this.total = res.data.total;
@ -336,13 +331,12 @@ export default {
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.$router.push({
const dictId = row.dictId || this.ids path:'/claimAndRefund/receive/receiveApplyAdd',
getType(dictId).then(response => { query:{
this.form = response.data; taskId:row.taskId
this.open = true; }
this.title = "验收"; })
});
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
@ -365,14 +359,25 @@ export default {
}); });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { async handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除该数据项?').then(function() { this.$confirm('此操作将永久删除该领料任务, 是否继续?', '提示', {
return delType(dictIds); confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.getList(); type: 'warning'
this.$modal.msgSuccess("删除成功"); }).then( async () => {
}).catch(() => {}); const res = await deleteTask(row.taskId)
if(res.code == 200){
this.$message({
type:'success',
message:'删除成功'
})
this.getList()
}
})
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {

View File

@ -22,6 +22,9 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="协议号" prop="agreementCode">
<el-input v-model="queryParams.agreementCode" disabled></el-input>
</el-form-item>
<el-form-item label="物品类型" prop="status"> <el-form-item label="物品类型" prop="status">
<el-cascader <el-cascader
placeholder="请输入物品类型" placeholder="请输入物品类型"
@ -98,7 +101,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="queryParams.leaseApplyDetails" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="leaseApplyDetails" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="120" /> <el-table-column label="序号" type="index" width="120" />
<el-table-column label="类型名称" prop="typeCn" width="200" :show-overflow-tooltip="true" /> <el-table-column label="类型名称" prop="typeCn" width="200" :show-overflow-tooltip="true" />
@ -156,12 +159,18 @@
<script> <script>
import { getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"; import { getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"; import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import { getProData, getUnitData,getDeviceTypeTree,getAgreementInfoById,submitLeaseApply } from '@/api/claimAndRefund/receive' import {
getProData,
getUnitData,
getDeviceTypeTree,
getAgreementInfoById,
submitLeaseApply,
getTaskDetail
} from '@/api/claimAndRefund/receive'
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
name: "Role", name: "Role",
dicts: ['sys_normal_disable'],
data() { data() {
return { return {
// //
@ -225,6 +234,7 @@ export default {
unitId:null, unitId:null,
proId:null, proId:null,
agreementId:null, //id agreementId:null, //id
agreementCode: null, //code
companyId:'', // companyId:'', //
createBy: '', // createBy: '', //
taskType: 29, taskType: 29,
@ -238,6 +248,8 @@ export default {
// //
leaseApplyDetails:[] leaseApplyDetails:[]
}, },
leaseApplyDetails:[],
// //
@ -303,7 +315,10 @@ export default {
this.GetDeviceTypeTree() this.GetDeviceTypeTree()
// this.getList(); // this.getList();
console.log('this.$route.query.taskId',this.$route.query.taskId)
if(this.$route.query.taskId){
this.GetTaskDetail(this.$route.query.taskId)
}
}, },
computed:{ computed:{
...mapState(['user']) ...mapState(['user'])
@ -329,6 +344,8 @@ export default {
this.GetAgreementInfoById() this.GetAgreementInfoById()
}, },
//
async GetDeviceTypeTree(){ async GetDeviceTypeTree(){
const params = { const params = {
level:4 level:4
@ -337,7 +354,7 @@ export default {
this.deviceTypeTree = res.data this.deviceTypeTree = res.data
}, },
// id
async GetAgreementInfoById(){ async GetAgreementInfoById(){
if(this.queryParams.unitId && this.queryParams.proId){ if(this.queryParams.unitId && this.queryParams.proId){
const params = { const params = {
@ -354,10 +371,51 @@ export default {
this.GetProData() this.GetProData()
}else{ }else{
this.queryParams.agreementId = res.data.agreementId this.queryParams.agreementId = res.data.agreementId
this.queryParams.agreementCode = res.data.agreementCode
} }
} }
}, },
//
async GetTaskDetail(taskId){
const res = await getTaskDetail({taskId})
const data = res.rows[0]
console.log('GetTaskDetail =================',data)
// unitId:null,
// proId:null,
// agreementId:null, //id
// agreementCode: null,
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.agreementCode = data.agreementCode
this.queryParams.leaseApplyInfo.remark = data.leaseApplyInfo.remark
this.leaseApplyDetails = data.leaseApplyDetails.map(item => {
return this.handelEchoData(item)
})
},
//
handelEchoData(item){
const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem))
template.createBy = item.createBy
template.companyId = item.companyId
template.typeId = item.typeId
template.unitCn = item.unitName
template.typeCn = item.typeName
template.guigeCn = item.typeModelName
template.remark = item.remark
template.preNum = item.preNum
template.status = item.status
return template
},
/** 查询角色列表 */ /** 查询角色列表 */
async getList() { async getList() {
@ -450,9 +508,7 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.roleId) this.queryParams.leaseApplyDetails = selection
this.single = selection.length!=1
this.multiple = !selection.length
}, },
// //
handleCommand(command, row) { handleCommand(command, row) {
@ -481,6 +537,7 @@ export default {
this.queryParams.createBy = this.user.name this.queryParams.createBy = this.user.name
this.queryParams.companyId = this.user.id this.queryParams.companyId = this.user.id
const res = await submitLeaseApply(this.queryParams) const res = await submitLeaseApply(this.queryParams)
if(res.code == 200){ if(res.code == 200){
this.$message({ this.$message({
@ -546,7 +603,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.queryParams.leaseApplyDetails.splice(row.index,1) this.leaseApplyDetails.splice(row.index,1)
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -560,14 +617,17 @@ export default {
/////// ///////
deviceTypeChange(val){ deviceTypeChange(val){
let nodes = null;
// nodes = this.$refs.deviceTypeCascader.getCheckedNodes().length > 0 ? this.$refs.deviceTypeCascader.getCheckedNodes() : this.$refs.deviceTypeCascader.panel.getNodeByValue(val)
//
nodes = this.$refs.deviceTypeCascader.getCheckedNodes()
console.log(nodes)
const nodes = this.$refs.deviceTypeCascader.getCheckedNodes()
console.log('this.deviceType1 =============',this.deviceType)
if(nodes[0].level != 4){ if(nodes[0].level != 4){
return return
} }
this.queryParams.leaseApplyDetails.push( this.leaseApplyDetails.push(
this.handelTableItemData(nodes[0]) this.handelTableItemData(nodes[0])
) )
@ -576,7 +636,9 @@ export default {
// this.$refs.cascader.$refs.panel.activePath = [] // this.$refs.cascader.$refs.panel.activePath = []
this.deviceType = {} this.deviceType = {}
console.log('this.deviceType2 =============',this.deviceType)
}, },
//// ////
handelTableItemData(node){ handelTableItemData(node){

View File

@ -56,7 +56,6 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['store:labelType:add']"
>新建</el-button> >新建</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -84,41 +83,46 @@
<el-table v-loading="loading" :data="leaseAuditList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="leaseAuditList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="dictId" /> <el-table-column label="序号" align="center" type="index" />
<el-table-column label="领料单号" align="center" prop="dictName" :show-overflow-tooltip="true" /> <el-table-column label="领料单号" align="center" prop="code" :show-overflow-tooltip="true" />
<el-table-column label="领料单位" align="center" prop="dictName" :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="proName" :show-overflow-tooltip="true" />
<el-table-column label="协议号" align="center" prop="dictName" :show-overflow-tooltip="true" /> <el-table-column label="协议号" align="center" prop="agreementCode" :show-overflow-tooltip="true" />
<el-table-column label="领料人" align="center" prop="dictName" :show-overflow-tooltip="true" /> <el-table-column label="领料人" align="center" prop="leasePerson" :show-overflow-tooltip="true" />
<el-table-column label="联系电话" align="center" prop="dictName" :show-overflow-tooltip="true" /> <el-table-column label="联系电话" align="center" prop="leasePhone" :show-overflow-tooltip="true" />
<el-table-column label="申请人" align="center" prop="dictName" :show-overflow-tooltip="true" /> <el-table-column label="申请人" align="center" prop="applyFor" :show-overflow-tooltip="true" />
<el-table-column label="申请时间" align="center" prop="dictName" :show-overflow-tooltip="true" /> <el-table-column label="申请时间" align="center" prop="createTimes" :show-overflow-tooltip="true" />
<el-table-column label="任务状态" align="center" prop="dictName" :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="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"> <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['store:labelType:edit']"
>编辑</el-button> >编辑</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['store:labelType:remove']"
>删除</el-button> >删除</el-button>
<el-button
v-if=" scope.row "
size="mini"
type="text"
icon="el-icon-document-checked"
@click="handleExamine(scope.row)"
>审批</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-document"
@click="handleExamine(scope.row)" @click="handleExamine(scope.row)"
v-hasPermi="['store:labelType:edit']" >领料单</el-button>
>审批</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -180,7 +184,6 @@ import { listType, getType, delType, addType, updateType, refreshCache } from "@
import { getLeaseAuditListAll,getUnitData,getProData } from "@/api/claimAndRefund/receive"; import { getLeaseAuditListAll,getUnitData,getProData } from "@/api/claimAndRefund/receive";
export default { export default {
name: "Dict", name: "Dict",
dicts: ['sys_normal_disable'],
data() { data() {
return { return {
// //
@ -248,13 +251,15 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.GetUnitData()
this.GetProData()
}, },
methods: { methods: {
/** 查询字典类型列表 */ /** 查询字典类型列表 */
async getList() { async getList() {
this.loading = true; this.loading = true;
console.log( 'this.queryParams =============',this.queryParams )
const params = { const params = {
unitId:this.queryParams.unitId, unitId:this.queryParams.unitId,
@ -269,10 +274,29 @@ export default {
const res = await getLeaseAuditListAll(params) const res = await getLeaseAuditListAll(params)
this.loading = false; this.loading = false;
console.log('res ============',res) console.log('getList ============',res)
this.leaseAuditList = res.data.rows; this.leaseAuditList = res.data.rows;
this.total = res.data.total; this.total = res.data.total;
}, },
//
async GetUnitData(){
const params = {
id:this.queryParams.proId
}
const res = await getUnitData(params)
this.unitList = res.data
},
//
async GetProData(){
const params = {
id:this.queryParams.unitId
}
const res = await getProData(params)
this.proList = res.data
},
// //
cancel() { cancel() {
this.open = false; this.open = false;