退料接收
This commit is contained in:
parent
17c9fe9185
commit
d17634a4ca
|
|
@ -333,3 +333,22 @@ export function getLeaseOutDetailRecordApi(data) {
|
|||
export const getHoldingPoleSelListApi = () => {
|
||||
return request.get('/material/maWhole/selectWholeList')
|
||||
}
|
||||
|
||||
|
||||
// 退料接收编辑 获取详情数据
|
||||
export function getTaskDetail(data) {
|
||||
return request({
|
||||
url: '/material/base/backReceive/getDetailsReceiveList',
|
||||
method: 'get',
|
||||
params: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 退料接收编辑 保存
|
||||
export function submitUpdateBackApply(data) {
|
||||
return request({
|
||||
url: '/material/backApply/updateBackApply',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
|
@ -190,17 +190,17 @@
|
|||
<el-table-column
|
||||
label="退料数量"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
prop="num"
|
||||
min-width="180"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model.number="scope.row.num"
|
||||
v-model="scope.row.num"
|
||||
placeholder="请输入退料数量"
|
||||
type="number"
|
||||
min="1"
|
||||
clearable
|
||||
@input="checkNum(scope.row)"
|
||||
@change="checkNum(scope.row)"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</template>
|
||||
|
|
@ -273,6 +273,8 @@ import {
|
|||
submitLeaseApply,
|
||||
getUseTypeTreee,
|
||||
getUseNumByTypeId,
|
||||
getTaskDetail,
|
||||
submitUpdateBackApply,
|
||||
} from '@/api/claimAndRefund/receive'
|
||||
import { submitBackApplyApi } from '@/api/claimAndRefund/return'
|
||||
import {
|
||||
|
|
@ -295,6 +297,9 @@ export default {
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
rejectTaskId: {
|
||||
type: [String, Number],
|
||||
},
|
||||
},
|
||||
data() {
|
||||
const validatePhone = (rule, value, callback) => {
|
||||
|
|
@ -372,6 +377,8 @@ export default {
|
|||
taskType: 29,
|
||||
taskStatus: 30,
|
||||
backTime: '', //申请时间
|
||||
backPerson: '', //退料人
|
||||
remark: '', //备注
|
||||
//退料人信息
|
||||
leaseApplyInfo: {
|
||||
backPerson: '',
|
||||
|
|
@ -493,6 +500,7 @@ export default {
|
|||
// isEdit: 'true',
|
||||
rowId: '',
|
||||
propsKey: 2000,
|
||||
taskId:'',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -506,17 +514,38 @@ export default {
|
|||
// this.rowId = this.$route.query.Id
|
||||
// this.GetViewByApply(this.$route.query.Id)
|
||||
// }
|
||||
if (this.rejectId) {
|
||||
this.rowId = this.rejectId
|
||||
this.GetViewByApply({
|
||||
id: this.rejectId,
|
||||
agreementId: this.agreementId,
|
||||
})
|
||||
}
|
||||
// if (this.rejectTaskId && this.isEdit) {
|
||||
// this.rowId = this.rejectTaskId
|
||||
// this.GetViewByApply({
|
||||
// id: this.rejectId,
|
||||
// agreementId: this.agreementId,
|
||||
// })
|
||||
// }
|
||||
getInfo().then((res) => {
|
||||
this.companyId = res.user.companyId
|
||||
this.createBy = res.user.userName
|
||||
})
|
||||
this.taskId = this.rejectTaskId
|
||||
this.rowId = this.rejectId
|
||||
if(this.taskId && this.isEdit){
|
||||
Promise.all([
|
||||
this.GetTaskDetail(this.taskId),
|
||||
// this.GetDeviceTypeTree(),
|
||||
])
|
||||
// .then(() => {
|
||||
// let selectList = []
|
||||
// this.leaseApplyDetails.forEach((e) => {
|
||||
// selectList.push(
|
||||
// this.getParentsById(this.deviceTypeTree, e.typeId),
|
||||
// )
|
||||
// })
|
||||
// console.log( 'selectList', selectList)
|
||||
// this.$nextTick(() => {
|
||||
// this.deviceType = selectList
|
||||
// this.propsKey++
|
||||
// })
|
||||
// })
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
|
|
@ -543,9 +572,10 @@ export default {
|
|||
},
|
||||
|
||||
// 获取 设备树结构数据
|
||||
async GetDeviceTypeTreeFn(agreementId) {
|
||||
async GetDeviceTypeTreeFn(agreementId,id) {
|
||||
const params = {
|
||||
agreementId: agreementId,
|
||||
id: id,
|
||||
// this.agreementId
|
||||
}
|
||||
|
||||
|
|
@ -604,8 +634,28 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
//编辑获取信息
|
||||
async GetTaskDetail(taskId) {
|
||||
const res = await getTaskDetail({
|
||||
taskId: taskId,
|
||||
})
|
||||
const data = res.data.backApplyInfo
|
||||
// console.log(data)
|
||||
// this.queryParams.taskId = data.taskId
|
||||
this.queryParams.unitId = data.unitId
|
||||
this.queryParams.proId = Number(data.projectId)
|
||||
this.$set(this.queryParams, 'phone', data.phone)
|
||||
this.queryParams.backPerson = data.backPerson
|
||||
this.queryParams.backTime = data.backTime
|
||||
this.queryParams.agreementCode = data.agreementCode
|
||||
this.queryParams.agreementId = data.agreementId
|
||||
this.queryParams.remark = data.remark
|
||||
this.leaseApplyDetails = res.data.backApplyDetails
|
||||
this.GetDeviceTypeTreeFn(data.agreementId,data.id)
|
||||
},
|
||||
|
||||
// 获取 任务详情数据
|
||||
async GetViewByApply(params) {
|
||||
async GetViewByApply(taskId) {
|
||||
const res = await materialReturnNoteByApply({
|
||||
id: params.id,
|
||||
agreementId: params.agreementId,
|
||||
|
|
@ -782,13 +832,14 @@ export default {
|
|||
this.queryParams.createBy = this.user.name
|
||||
this.queryParams.companyId = this.companyId
|
||||
this.queryParams.backApplyInfo = {
|
||||
id: this.rowId,
|
||||
backPerson: this.queryParams.backPerson,
|
||||
phone: this.queryParams.phone,
|
||||
remark: this.queryParams.remark,
|
||||
backTime: this.queryParams.backTime,
|
||||
companyId: this.companyId,
|
||||
}
|
||||
if (this.rowId != '') {
|
||||
if (this.taskId != '') {
|
||||
let params = {
|
||||
companyId: this.companyId,
|
||||
createBy: this.createBy,
|
||||
|
|
@ -798,7 +849,7 @@ export default {
|
|||
backApplyDetails:
|
||||
this.queryParams.leaseApplyDetails,
|
||||
}
|
||||
const res = await submitRefuseBackApply(params)
|
||||
const res = await submitUpdateBackApply(params)
|
||||
if (res.code == 200) {
|
||||
this.$message({ type: 'success', message: res.msg })
|
||||
setTimeout(() => {
|
||||
|
|
@ -905,11 +956,12 @@ export default {
|
|||
},
|
||||
|
||||
checkNum(row) {
|
||||
let maxNum = row.useNum
|
||||
let maxNum = Number(row.useNum)
|
||||
console.log('maxNum', maxNum)
|
||||
if (row.num <= 1) {
|
||||
row.num = 1
|
||||
this.$set(row, 'num', 1);
|
||||
} else if (row.num >= maxNum) {
|
||||
row.num = maxNum
|
||||
this.$set(row, 'num', maxNum);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -820,6 +820,12 @@ export default {
|
|||
},
|
||||
//完成退料接收
|
||||
async completeBack() {
|
||||
// 显示确认操作弹窗
|
||||
this.$confirm('该操作后进行退料的数据之后无法再次修改和删除,是否确认?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
let param1 = {
|
||||
parentId: this.queryParams.id,
|
||||
}
|
||||
|
|
@ -838,6 +844,33 @@ export default {
|
|||
}
|
||||
})
|
||||
}
|
||||
}).catch(() => {
|
||||
// this.$message({
|
||||
// type: 'info',
|
||||
// message: '已取消操作'
|
||||
// });
|
||||
});
|
||||
|
||||
// let param1 = {
|
||||
// parentId: this.queryParams.id,
|
||||
// }
|
||||
|
||||
|
||||
// const res1 = await getRecord(param1)
|
||||
// if (res1.code == 200) {
|
||||
// let param = {
|
||||
// createBy: this.createBy,
|
||||
// parentId: this.queryParams.id,
|
||||
// taskId: this.queryParams.taskId,
|
||||
// }
|
||||
// endBack(param).then((response) => {
|
||||
// if (response.code == 200) {
|
||||
// this.$modal.msgSuccess('操作成功')
|
||||
// // this.back()
|
||||
// this.$emit('goBackPage')
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
},
|
||||
//查看数据
|
||||
handleViewCode(row) {
|
||||
|
|
|
|||
|
|
@ -223,6 +223,16 @@
|
|||
@click="handleSee(scope.row, 'see')"
|
||||
>查看</el-button
|
||||
>
|
||||
<el-button
|
||||
size="medium"
|
||||
type="text"
|
||||
@click="handleEdit(scope.row, 'see')"
|
||||
icon="el-icon-edit"
|
||||
v-hasPermi="['return:receive:handler']"
|
||||
v-if="scope.row.taskStatus != '40'"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="medium"
|
||||
type="text"
|
||||
|
|
@ -462,6 +472,10 @@ export default {
|
|||
this.$emit('returnApply')
|
||||
},
|
||||
|
||||
handleEdit(row) {
|
||||
this.$emit('returnEdit',row.id, row.taskId)
|
||||
},
|
||||
|
||||
//打开退料单
|
||||
handlePrint(row) {
|
||||
// this.title = "退料单";
|
||||
|
|
@ -489,7 +503,7 @@ export default {
|
|||
// taskId: row.taskId,
|
||||
// },
|
||||
// })
|
||||
this.$emit('receiveReturn', row.id, row.taskId)
|
||||
this.$emit('receiveReturn', row.id, row.taskId,row.agreementId)
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@
|
|||
:isView="isView"
|
||||
:rejectId="rejectId"
|
||||
:rejectTaskId="rejectTaskId"
|
||||
:rejectAgreementId="rejectAgreementId"
|
||||
:isEdit="isEdit"
|
||||
@returnApply="returnApply"
|
||||
@returnEdit="returnEdit"
|
||||
@receiveView="receiveView"
|
||||
@receiveReturn="receiveReturn"
|
||||
@goBackPage="goBack"
|
||||
|
|
@ -40,6 +42,7 @@ export default {
|
|||
rejectTaskId: '',
|
||||
isView: false,
|
||||
isEdit: false,
|
||||
rejectAgreementId: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -50,6 +53,14 @@ export default {
|
|||
this.isShowComponent = 'AddReturn'
|
||||
this.isEdit = false
|
||||
},
|
||||
// 退料编辑
|
||||
returnEdit(id,taskId) {
|
||||
this.rejectId = id
|
||||
this.rejectTaskId = taskId
|
||||
this.pageContent = '编辑退料任务'
|
||||
this.isShowComponent = 'AddReturn'
|
||||
this.isEdit = true
|
||||
},
|
||||
// 查看
|
||||
receiveView(id) {
|
||||
this.pageContent = '退料详情'
|
||||
|
|
@ -58,9 +69,10 @@ export default {
|
|||
this.isShowComponent = 'HandlePage'
|
||||
},
|
||||
// 退料操作
|
||||
receiveReturn(id, taskId) {
|
||||
receiveReturn(id, taskId,agreementId) {
|
||||
this.rejectId = id
|
||||
this.rejectTaskId = taskId
|
||||
this.rejectAgreementId = agreementId
|
||||
this.isView = false
|
||||
this.pageContent = '退料处理'
|
||||
this.isShowComponent = 'HandlePage'
|
||||
|
|
|
|||
Loading…
Reference in New Issue