基础管理导出接口,重庆退料审批领料修改

This commit is contained in:
zhouzy062 2024-03-22 15:25:38 +08:00
parent 18b0804b2c
commit 2dba2b1314
12 changed files with 1616 additions and 21 deletions

View File

@ -103,6 +103,15 @@ export function submitBackApplyApi(data) {
data: data
})
}
// 退料审核新增
export function submitBackApplyApiByCq(data) {
return request({
url: '/material/backApply/submitBackApplyByCq',
method: 'post',
data: data
})
}
// 退料审核-驳回重新提交
export function submitRefuseBackApply(data) {
return request({

View File

@ -373,9 +373,9 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
// this.download('system/user/export', {
// ...this.queryParams
// }, `user_${new Date().getTime()}.xlsx`)
this.download('base/maPropInfo/exportConfig', {
...this.queryParams
}, `资产属性配置_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {

View File

@ -283,9 +283,9 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
// this.download('system/dict/type/export', {
// ...this.queryParams
// }, `type_${new Date().getTime()}.xlsx`)
this.download('base/maPropInfo/export', {
...this.queryParams
}, `资产属性_${new Date().getTime()}.xlsx`)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {

View File

@ -403,9 +403,9 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
// this.download('system/dict/type/export', {
// ...this.queryParams
// }, `type_${new Date().getTime()}.xlsx`)
this.download('base/bmUnitInfo/export', {
...this.queryParams
}, `往来单位_${new Date().getTime()}.xlsx`)
},
}

View File

@ -315,9 +315,9 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
// this.download('system/dict/type/export', {
// ...this.queryParams
// }, `type_${new Date().getTime()}.xlsx`)
this.download('base/bmProjectInfo/export', {
...this.queryParams
}, `工程项目_${new Date().getTime()}.xlsx`)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {

View File

@ -410,9 +410,9 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
// this.download('system/dict/type/export', {
// ...this.queryParams
// }, `type_${new Date().getTime()}.xlsx`)
this.download('base/bmProjectLot/export', {
...this.queryParams
}, `标段工程_${new Date().getTime()}.xlsx`)
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {

View File

@ -248,9 +248,9 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
// this.download('system/dict/type/export', {
// ...this.queryParams
// }, `type_${new Date().getTime()}.xlsx`)
this.download('/base/dic/export', {
...this.queryParams
}, `单位类型_${new Date().getTime()}.xlsx`)
},
}
};

View File

@ -85,7 +85,7 @@
<el-table v-loading="loading" :data="leaseAuditList" @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="code" :show-overflow-tooltip="true" width="150"/>
<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="agreementCode" :show-overflow-tooltip="true" />

View File

@ -47,6 +47,15 @@
ref="deviceTypeCascader"
filterable></el-cascader>
</el-form-item>
<el-form-item label="预计领料时间" prop="estimateLeaseTime">
<el-date-picker
v-model="queryParams.estimateLeaseTime"
style="width: 180px"
value-format="yyyy-MM-dd"
type="date"
placeholder="预计领料时间"
></el-date-picker>
</el-form-item>
<el-form-item label="领料人" prop="leasePerson">
<el-input maxlength="50"
v-model="queryParams.leaseApplyInfo.leasePerson"

View File

@ -162,13 +162,13 @@ export default {
// },
{
id:31,
name:'待分管部门审核',
name:'机具分公司审核',
remarkKey:'deptAuditRemark',
authorKey:'deptAuditBy',
timeKey:'deptAuditTime'
},{
id:32,
name:'待内部审核',
name:'施工管理部审核',
remarkKey:'directAuditRemark',
authorKey:'directAuditBy',
timeKey:'directAuditTime'

View File

@ -0,0 +1,810 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:rules="queryRules"
:inline="true"
v-show="showSearch"
>
<el-row>
<el-form-item label="退料单位" prop="unitId">
<el-select
v-model="queryParams.unitId"
clearable filterable
@change="GetProData"
style="width: 240px"
placeholder="请选择"
>
<el-option
v-for="item in unitList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="退料工程" prop="proId">
<el-select
v-model="queryParams.proId"
clearable filterable
@change="GetUnitData"
style="width: 240px"
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="agreementCode">
<el-input v-model="queryParams.agreementCode" disabled></el-input>
</el-form-item>
<el-form-item label="物品类型" prop="status">
<el-cascader
placeholder="请输入物品类型"
:options="deviceTypeTree"
:props="deviceTypeTreeProps"
v-model="deviceType"
@change="deviceTypeChange"
ref="deviceTypeCascader"
filterable
></el-cascader>
</el-form-item>
<el-form-item label="退料人" prop="backPerson">
<el-input
v-model="queryParams.backPerson"
placeholder="请输入退料人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="退料时间" prop="backTime">
<el-date-picker
v-model="queryParams.backTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="退料人电话" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入退料人电话"
clearable
style="width: 240px"
/>
</el-form-item>
<el-form-item label="备注" prop="roleName">
<el-input
v-model="queryParams.remark"
placeholder="请输入备注"
clearable
rows="1"
type="textarea"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-row>
<el-row> </el-row>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-back"
size="mini"
@click="handleBack"
>退料管理</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>保存</el-button
>
</el-col>
<el-col :span="1.5">
<!-- <el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:role:export']"
>导出</el-button> -->
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="leaseApplyDetails"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" min-width="55" align="center" />
<el-table-column label="序号" type="index" min-width="120" />
<el-table-column
label="类型名称"
prop="typeName"
min-width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
prop="typeCode"
min-width="200"
:show-overflow-tooltip="true"
/>
<el-table-column label="计量单位" prop="unitNames" min-width="100" />
<el-table-column
label="当前在用量"
align="center"
prop="preNum"
min-width="180"
>
</el-table-column>
<el-table-column
label="退料数量"
align="center"
prop="createTime"
min-width="180"
>
<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
label="备注"
align="center"
prop="remark"
min-width="180"
>
<template slot-scope="scope">
<el-input
v-model="scope.row.remark"
placeholder="请输入备注"
clearable
style="width: 100%"
@keyup.enter.native="handleQuery"
/>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
fixed="right"
class-name="small-padding fixed-width"
width="160px"
>
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleBack(scope.row)"-->
<!-- v-hasPermi="['system:role:edit']"-->
<!-- >修改</el-button>-->
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete({ ...scope.row, index: scope.$index })"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import {
getProData,
getUnitData,
getDeviceTypeTree,
getAgreementInfoById,
submitLeaseApply,
getUseTypeTreee
} from '@/api/claimAndRefund/receive'
import { ApiSubmitBackApply } from "@/api/claimAndRefund/return"
import { submitBackApplyApiByCq,materialReturnNoteByApply,submitRefuseBackApply } from "@/api/claimAndRefund/return.js"
import { mapState } from 'vuex'
import {
getInfo, h
} from "@/api/login";
export default {
name: "ReturnApplyAdd",
data() {
const validatePhone = (rule, value, callback) => {
if (!value) {
callback(new Error("退料人电话不能为空"));
// this.$message.error("");
} else if (value.length < 11) {
callback(new Error("电话号码格式不正确"));
// this.$message.error("");
} else {
callback();
}
};
return {
//
loading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
roleList: [],
//
title: "",
//
open: false,
//
openDataScope: false,
menuExpand: false,
menuNodeAll: false,
deptExpand: true,
deptNodeAll: false,
//
dateRange: [],
//
dataScopeOptions: [
{
value: "1",
label: "全部数据权限"
},
{
value: "2",
label: "自定数据权限"
},
{
value: "3",
label: "本部门数据权限"
},
{
value: "4",
label: "本部门及以下数据权限"
},
{
value: "5",
label: "仅本人数据权限"
}
],
//
menuOptions: [],
//
deptOptions: [],
//
queryParams: {
types: 2,
unitId: null,
proId: null,
agreementId: null, //id
agreementCode: null, //code
companyId: '', //
createBy: '', //
taskType: 29,
taskStatus: 30,
backTime: '',//
//退
leaseApplyInfo: {
backPerson: '',
phone: '',
remark: ''
},
//退
leaseApplyDetails: []
},
leaseApplyDetails: [],
//退
leaseApplyDetailsItem: {
createBy: null,
companyId: null,
status: 0,
typeId: null, // 4 id
typeName: '', //
typeCode: '', //
unitNames: '', //
remark: '', //
preNum: 1, //
},
//
queryRules: {
unitId: [
{
required: true, message: '请选择退料单位', trigger: 'change', type: 'number'
}
],
proId: [
{
required: true, message: '请选择退料工程', trigger: 'change', type: 'number'
}
],
backPerson: [
{
required: true, message: '请输入退料人', trigger: 'blur',
}
],
backTime: [
{
required: true, message: '请选择退料时间', trigger: 'change',
}
],
phone: [
{required: true, message: '请输入退料人手机号', trigger: 'change'},
{ validator: validatePhone, trigger: "blur" },
{ min: 11, message: "手机号不足11位", trigger: "blur" },
],
},
unitList: [], //
proList: [], //
deviceTypeTree: [], //
//
deviceTypeTreeProps: {
children: 'children',
label: 'typeName',
// multiple: false,
value: 'typeId'
},
//
deviceType: null,
//
form: {},
// defaultProps: {
// children: "children",
// label: "label"
// },
//
rules: {
roleName: [
{ required: true, message: "角色名称不能为空", trigger: "blur" }
],
roleKey: [
{ required: true, message: "权限字符不能为空", trigger: "blur" }
],
roleSort: [
{ required: true, message: "角色顺序不能为空", trigger: "blur" }
]
},
companyId: '',
createBy: '',
isEdit:'true',
rowId:''
};
},
created() {
this.GetUnitData()
this.GetProData()
this.GetDeviceTypeTreeFn()
// this.getList();
// console.log('this.$route.query.isEdit', this.$route.query.isEdit)
this.isEdit = this.$route.query.isEdit;
if (this.$route.query.Id) {
this.rowId = this.$route.query.Id
this.GetViewByApply(this.$route.query.Id)
}
getInfo().then(res => {
this.companyId = res.user.companyId
this.createBy = res.user.userName
})
},
computed: {
...mapState(['user'])
},
methods: {
//
async GetUnitData() {
const params = {
id: this.queryParams.proId/* */
}
const res = await getUnitData(params)
this.unitList = res.data
this.GetAgreementInfoById()
},
//
async GetProData() {
const params = {
id: this.queryParams.unitId
}
const res = await getProData(params)
this.proList = res.data
this.GetAgreementInfoById()
},
//
async GetDeviceTypeTreeFn(agreementId) {
const params = {
agreementId: agreementId
// this.agreementId
}
const res = await getUseTypeTreee(params)
console.log("resgetUseTypeTreee==========", res)
this.deviceTypeTree = res.data
},
// id
async GetAgreementInfoById() {
if (this.queryParams.unitId && this.queryParams.proId) {
const params = {
unitId: this.queryParams.unitId,
projectId: this.queryParams.proId
}
const res = await getAgreementInfoById(params)
if (!(res.data && res.data.agreementId)) {
this.$message.error('当前单位和工程未上传');
this.queryParams.unitId = null
this.queryParams.proId = null
this.GetUnitData()
this.GetProData()
} else {
this.queryParams.agreementId = res.data.agreementId
this.queryParams.agreementCode = res.data.agreementCode
this.GetDeviceTypeTreeFn(res.data.agreementId)
}
}
},
//
async GetViewByApply(Id) {
const res = await materialReturnNoteByApply({ id:Id })
const data = res.data[0]
// console.log(data)
// this.queryParams.taskId = data.taskId
this.queryParams.unitId = data.unitId
this.queryParams.proId = Number(data.proId)
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
this.GetDeviceTypeTreeFn(data.agreementId)
},
//
handelEchoData(item) {
console.log('item======', item);
const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem))
template.createBy = item.createBy
template.parentId = item.data.parentId
template.typeId = item.data.typeId
template.companyId = item.companyId
// template.typeId = item.typeId
template.unitNames = item.unitNames
template.typeCn = item.typeName
template.guigeCn = item.typeModelName
template.remark = item.remark
template.preNum = item.preNum
template.status = item.status
return template
},
/** 查询角色列表 */
async getList() {
},
/** 查询菜单树结构 */
getMenuTreeselect() {
menuTreeselect().then(response => {
this.menuOptions = response.data;
});
},
//
getMenuAllCheckedKeys() {
//
let checkedKeys = this.$refs.menu.getCheckedKeys();
//
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
},
//
getDeptAllCheckedKeys() {
//
let checkedKeys = this.$refs.dept.getCheckedKeys();
//
let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then(response => {
this.menuOptions = response.menus;
return response;
});
},
/** 根据角色ID查询部门树结构 */
getDeptTree(roleId) {
return deptTreeSelect(roleId).then(response => {
this.deptOptions = response.depts;
return response;
});
},
//
//
cancel() {
this.open = false;
this.reset();
},
//
cancelDataScope() {
this.openDataScope = false;
this.reset();
},
//
reset() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([]);
}
this.menuExpand = false,
this.menuNodeAll = false,
this.deptExpand = true,
this.deptNodeAll = false,
this.form = {
roleId: undefined,
roleName: undefined,
roleKey: undefined,
roleSort: 0,
status: "0",
menuIds: [],
deptIds: [],
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.queryParams.leaseApplyDetails = selection
},
//
handleCommand(command, row) {
switch (command) {
case "handleDataScope":
this.handleDataScope(row);
break;
case "handleAuthUser":
this.handleAuthUser(row);
break;
default:
break;
}
},
/** 保存按钮操作 */
handleAdd() {
this.$refs.queryForm.validate(async (valid) => {
if (!valid) {
return false
} else {
let backApplyInfo = []
if (this.queryParams.leaseApplyDetails.length == 0) {
this.$message.error('请添加数据');
return
}
// const isRemark = this.queryParams.leaseApplyDetails.some(
// (item) => item.remark == '' || item.remark == undefined
// );
const isNum = this.queryParams.leaseApplyDetails.some(
(item) => item.num == '' || item.num == undefined
);
if (isNum) {
this.$message.error('退料数量不能为空!');
return;
}
this.queryParams.createBy = this.user.name
this.queryParams.companyId = this.companyId
this.queryParams.backApplyInfo = {
backPerson: this.queryParams.backPerson,
phone: this.queryParams.phone,
remark: this.queryParams.remark,
backTime: this.queryParams.backTime,
companyId: this.companyId,
}
if(this.rowId!=''){
let params = {
companyId: this.companyId,
createBy: this.createBy,
id:this.rowId,
agreementId: this.queryParams.agreementId,
backApplyInfo: this.queryParams.backApplyInfo,
backApplyDetails: this.queryParams.leaseApplyDetails,
}
const res = await submitRefuseBackApply(params)
if (res.code == 200) {
this.$message({ type: 'success', message: '申请成功'})
setTimeout(() => {
this.$tab.closeOpenPage({ path: "/claimAndRefund/return/returnApplyByCq"});
}, 1000)
}
}else{
let params = {
companyId: this.companyId,
createBy: this.createBy,
agreementId: this.queryParams.agreementId,
backApplyInfo: this.queryParams.backApplyInfo,
backApplyDetails: this.queryParams.leaseApplyDetails,
}
const res = await submitBackApplyApiByCq(params)
if (res.code == 200) {
this.$message({ type: 'success', message: '申请成功'})
setTimeout(() => {
this.$tab.closeOpenPage({ path: "/claimAndRefund/return/returnApplyByCq"});
}, 1000)
}
}
}
})
},
/** 修改按钮操作 */
handleBack(row) {
this.$tab.closeOpenPage({ path: "/claimAndRefund/return/returnApplyByCq"});
},
/** 分配数据权限操作 */
handleDataScope(row) {
this.reset();
const deptTreeSelect = this.getDeptTree(row.roleId);
getRole(row.roleId).then(response => {
this.form = response.data;
this.openDataScope = true;
this.$nextTick(() => {
deptTreeSelect.then(res => {
this.$refs.dept.setCheckedKeys(res.checkedKeys);
});
});
this.title = "分配数据权限";
});
},
/** 分配用户操作 */
handleAuthUser: function (row) {
const roleId = row.roleId;
this.$router.push("/system/role-auth/user/" + roleId);
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.roleId != undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys();
updateRole(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
this.form.menuIds = this.getMenuAllCheckedKeys();
addRole(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.leaseApplyDetails.splice(row.index, 1)
},
/** 导出按钮操作 */
handleExport() {
this.download('system/role/export', {
...this.queryParams
}, `role_${new Date().getTime()}.xlsx`)
},
checkNum(row){
if(row.num>=0){
row.num = row.num
}else{
row.num = 0
}
// if(row.num>=0){
// if(row.num>=row.preNum){
// row.num = Number(row.preNum)
// }else{
// row.num = row.num
// }
// }else{
// row.num = 0
// }
},
///////
deviceTypeChange(val) {
let nodes = null;
console.log("vall1211221122", this.$refs.deviceTypeCascader.getCheckedNodes().length, this.$refs.deviceTypeCascader.getCheckedNodes(), [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)])
nodes = this.$refs.deviceTypeCascader.getCheckedNodes().length > 0 ? this.$refs.deviceTypeCascader.getCheckedNodes() : [this.$refs.deviceTypeCascader.panel.getNodeByValue(val)]
console.log("nodes", nodes)
if (nodes[0].level != 4) {
return
}
this.leaseApplyDetails.push(
this.handelTableItemData(nodes[0])
)
// this.$refs.cascader.$refs.panel.clearCheckedNodes()
// //
// this.$refs.cascader.$refs.panel.activePath = []
this.deviceType = {}
},
////
handelTableItemData(node) {
const template = JSON.parse(JSON.stringify(this.leaseApplyDetailsItem))
template.createBy = this.createBy
template.typeId = node.data.typeId
template.companyId = node.data.companyId
// template.typeId = node.data.id
template.unitNames = node.data.unitNames
template.preNum = node.data.num
template.typeName = node.pathLabels[2]
template.typeCode = node.pathLabels[3]
return template
}
}
};
</script>

View File

@ -0,0 +1,767 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="关键字" prop="keyWord">
<el-input maxlength="50" v-model="queryParams.keyWord" placeholder="请输入关键字" clearable style="width: 240px" />
</el-form-item>
<el-form-item label="单位名称" prop="unitId">
<el-select v-model="queryParams.unitId"
clearable filterable
@change="getAgreementByUnit"
style="width: 240px"
placeholder="请选择"
>
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
</el-select>
</el-form-item>
<el-form-item label="工程名称" prop="proId">
<el-select v-model="queryParams.proId" clearable filterable @change="getAgreementByProId"
style="width: 240px" 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="typeId">
<el-cascader
v-model="queryParams.typeId"
:options="deptOptions"
:props="{
expandTrigger: 'hover',
label: 'typeName',
value: 'typeId',
checkStrictly: true,
}"
@change="handleNodeClick"
aria-placeholder="请选择极具类型"
>
</el-cascader>
</el-form-item>
<el-form-item label="退料申请时间" prop="time">
<el-date-picker
v-model="queryParams.time"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
type="date"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</el-form-item>
<el-form-item label="退料状态" prop="taskStatus">
<el-select
v-model="queryParams.taskStatus"
clearable filterable
style="width: 240px"
placeholder="请选择"
>
<el-option v-for="item in taskStatusList" :key="item.id" :label="item.name" :value="item.id" > </el-option>
</el-select>
</el-form-item>
<el-form-item label="协议号" prop="agreementCode">
<el-input maxlength="50" v-model="queryParams.agreementCode" placeholder="请选择协议号" clearable style="width: 240px" />
</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="primary"
plain
size="mini"
@click="handleAdd"
>退料申请</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
size="mini"
@click="handleSubmit()"
v-hasPermi="['store:labelType:add']"
>批量提交</el-button
>
</el-col> -->
<el-col :span="1.5">
<el-button
type="success"
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="typeList" @selection-change="handleSelectionChange" >
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="序号" sortable 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="lotName" :show-overflow-tooltip="true"/>
<el-table-column label="退料机具" align="center" prop="typeName" :show-overflow-tooltip="true"/>
<el-table-column label="退料人员" align="center" prop="backPerson" :show-overflow-tooltip="true"/>
<el-table-column label="联系方式" align="center" prop="phone" :show-overflow-tooltip="true"/>
<el-table-column label="退料申请时间" align="center" prop="backTime" :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" >
<template slot-scope="scope">
<div> <!-- 暂时全部未否 -->
</div>
</template>
</el-table-column>
<el-table-column label="退料状态" align="center" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<!-- 状态 37-待审核 38-已审核 -->
<el-button type="text" v-if="scope.row.taskStatus == '37'">
待审核
</el-button>
<el-button type="text" style="color: #67c23a" v-if="scope.row.taskStatus == '38'">
已审核
</el-button>
<el-button type="text" v-if="scope.row.taskStatus == '39'">
退料核查
</el-button>
<el-button type="text" style="color: #67c23a" v-if="scope.row.taskStatus == '40'">
退料完成
</el-button>
<el-button type="text" style="color: #67c23a" v-if="scope.row.taskStatus == '101'">
退料驳回
</el-button>
</template>
</el-table-column>
<el-table-column label="不通过原因" align="center" prop="dictName" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250">
<template slot-scope="scope">
<el-button
size="mini"
plain
icon="el-icon-zoom-in"
@click="handleSee(scope.row, 'see')"
>查看</el-button>
<!-- <el-button
size="mini"
type="warning"
plain
icon="el-icon-edit"
@click="handlUpdate(scope.row, 'update')"
v-hasPermi="['store:labelType:edit']"
>编辑</el-button
> -->
<el-button
size="mini"
type="info"
v-if="scope.row.taskStatus=='101'"
@click="handleUpdate(scope.row)"
>驳回提交</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-button
size="mini"
type="info"
@click="handlePrint(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="open" width="1000px" append-to-body :close-on-click-modal="false">
<el-form :model="dialogQueryParams" ref="queryForm1" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-row>
<el-form-item label="退料单位" prop="unitName">
<el-input
disabled
v-model="dialogQueryParams.unitName"
placeholder="请输入退料单位"
clearable
style="width: 240px"
/>
</el-form-item>
<el-form-item label="退料工程" prop="lotName">
<el-input
disabled
v-model="dialogQueryParams.lotName"
placeholder="请输入退料工程"
clearable
style="width: 240px"
/>
</el-form-item>
<el-form-item label="退料协议编号" prop="agreementCode">
<el-input
disabled
v-model="dialogQueryParams.agreementCode"
placeholder="请输入退料协议编号"
clearable
style="width: 240px"
/>
</el-form-item>
<el-form-item label="预退料时间" prop="backTime">
<el-date-picker
style="width: 240px"
disabled
v-model="dialogQueryParams.backTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择时间"
>
</el-date-picker>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="退料人" prop="backPerson">
<el-input
disabled
v-model="dialogQueryParams.backPerson"
placeholder="请输入退料人"
clearable
style="width: 240px"
/>
</el-form-item>
<el-form-item label="退料人电话" prop="phone">
<el-input
disabled
v-model="dialogQueryParams.phone"
placeholder="请输入退料人电话"
clearable
style="width: 240px"
/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="dialogQueryParams.keyWord"
placeholder="请输入关键字"
clearable
style="width: 240px"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery1"
>查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery1"
>重置</el-button>
</el-form-item>
</el-row>
</el-form>
<el-table v-loading="loading" :data="loadingList" height="500px" @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="typeCode" :show-overflow-tooltip="true"/>
<el-table-column label="编码" align="center" prop="maCode" :show-overflow-tooltip="true"/>
<el-table-column label="当前在用量" align="center" prop="useNum" :show-overflow-tooltip="true"/>
<el-table-column label="退料数量" align="center" prop="num" class-name="small-padding fixed-width" width="200">
<!-- <template slot-scope="scope">
<el-input
v-model="scope.row.num"
:disabled="true"
placeholder="请输入退料数量"
clearable
/>
</template> -->
</el-table-column>
</el-table>
<pagination
v-show="loadingTotal > 0"
:total="loadingTotal"
:page.sync="dialogQueryParams.pageNum"
:limit.sync="dialogQueryParams.pageSize"
@pagination="getDialogList"
/>
<div
slot="footer"
class="dialog-footer"
style="text-align: center"
v-if="loadingType == 'update'"
>
<el-button type="primary" @click="submitForm">确定</el-button>
<el-button @click="cancel">取消</el-button>
</div>
</el-dialog>
<!-- 退料单 -->
<dialogForm :dialogTitle="title" :isShowFlag.sync="isShowOneFlag" :priKey="priKey" :rowObj="rowObj" ></dialogForm>
<!-- 提交 -->
<el-dialog v-loading.fullscreen.lock="fullscreenLoading" :title="title" :visible.sync="openOne" append-to-body width="400px">
<div class="submit_box">
<div>
<i class="el-icon-circle-check" style="color: #ff9900; font-size: 30px" ></i>
</div>
<div class="submit_box_title">
<div>{{ openTextOne }}</div>
<div>{{ openTextTwo }}</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">返回</el-button>
<el-button type="primary" @click="submitOpenOneForm()">确定</el-button>
</div>
</el-dialog>
<el-dialog v-loading.fullscreen.lock="fullscreenLoading" :title="title" :visible.sync="openTwo" append-to-body width="400px">
<div class="submit_box_two">
<div>
<i class="el-icon-circle-check" style="color: #00c196; font-size: 30px" ></i>
</div>
<div class="submit_box_title">{{ openTextThree }}</div>
</div>
<div slot="footer" class="dialog-footer"></div>
</el-dialog>
</div>
</template>
<script>
import { listType, getType, delType, addType, updateType, refreshCache ,getUseTypeTree} from "@/api/system/dict/type";
import { ApiGetBackApplyList, getViewByApply, backApplyDelApi, submitBackApplyApi } from "@/api/claimAndRefund/return.js"
import {
getInfo, h
} from "@/api/login";
import { getUnitData, getProData, getAgreementInfoById, } from "@/api/claimAndRefund/receive.js"
import dialogForm from "./dialogForm.vue";
// 10:42startTime,endTime typeId
// http://localhost/claimAndRefund/return/returnApply
export default {
name: "ReturnApply",
dicts: ['sys_normal_disable'],
components: { dialogForm, },
data() {
return {
fullscreenLoading: false,
type: '',
isShowOneFlag: false,
priKey: '',
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
typeList: [],
//
title: "",
//
open: false,
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '',//
unitId: "",//id
lotId: '',//id
taskStatus: '',//
typeId: '',//
time: '',
agreementCode: '',//
startTime: '',
endTime: ''
},
dialogQueryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: {},
//
rules: {
dictName: [
{ required: true, message: "字典名称不能为空", trigger: "blur" }
],
dictType: [
{ required: true, message: "字典类型不能为空", trigger: "blur" }
]
},
openOne: false,
openTwo: false,
openTextOne: '',
openTextTwo: '',
openTextThree: '',
companyId: '',
deptOptions: [],
unitList: [],
proList: [],
taskStatusList: [
{
name: '待审核',
id: '37'
},
{
name: '已审核',
id: '38'
}
],
rowObj: {},
loadingType: '',
loadingTotal: 0,
loadingList: [],
};
},
created() {
// this.getList();
this.initSelectData()
this.InitIGetInfo()
},
methods: {
// claimAndRefund/return/returnApplyAdd
// claimAndRefund/return/returnApplyAdd
/** 查询字典类型列表 startTime,结束日期endTime */
async getList() {
this.loading = true;
if(this.queryParams.time&&this.queryParams.time.length>0){
this.queryParams.startTime = this.queryParams.time[0]
this.queryParams.endTime = this.queryParams.time[1]
}
try {
let params = {
companyId: this.companyId,
...this.queryParams
}
const res = await ApiGetBackApplyList(params)
this.typeList = res.data.rows;
this.total = res.data.total;
this.loading = false;
} catch (error) {
}
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
dictId: undefined,
dictName: undefined,
dictType: undefined,
status: "0",
remark: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
// this.resetForm("queryForm");
this.$refs.queryForm.resetFields()
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.$tab.closeOpenPage("/claimAndRefund/return/returnApplyAddByCq");
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.dictId)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$tab.closeOpenPage({
path:'/claimAndRefund/return/returnApplyAddByCq',
query:{
Id:row.id,
isEdit:true,
}
})
},
// 退
handleUpdateOrder() {
this.title = "查看";
this.isShowOneFlag = true
},
//
handleSubmit() {
this.title = "确认操作";
this.openTextOne = "确认提交申请么?";
this.openTextTwo = "确认提交申请么?";
this.openOne = true
},
submitOpenOneForm() {
this.openTextThree = "提交成功!";
this.openTwo = true
},
/** 提交按钮 */
submitForm: function () {
this.$refs["queryForm1"].validate(valid => {
if (valid) {
let backApplyInfo = []
for (let i = 0; i < this.loadingList.length; i++) {
this.loadingList[i].companyId = this.companyId;
}
backApplyInfo.push(
{
backPerson: '张三',
phone: '1234578988',
remark: '1425备注',
backTime: '2023-12-14',
// backPerson: this.dialogQueryParams.backPerson,
// phone: this.dialogQueryParams.phone,
// remark: this.dialogQueryParams.remark,
// backTime: this.dialogQueryParams.backTime,
companyId: this.companyId
}
)
let params = {
companyId: this.companyId,
agreementId: this.rowObj.agreementId,
backApplyInfo: JSON.stringify(backApplyInfo),
backApplyDetails: JSON.stringify(this.loadingList)
}
console.log('param----', params);
submitBackApplyApi(params).then(res => {
})
// if (this.form.dictId != undefined) {
// updateType(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
// } else {
// addType(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
// }
} else {
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
let param = {
id: row.id + ''
};
this.$modal.confirm('是否确认删除该数据项?').then(() => {
return backApplyDelApi(param);
}).then(() => {
this.getList();
// this.$modal.msgSuccess('');
this.$message.success('操作成功!')
}).catch(() => {
// this.$modal.msgError('');
});
},
handlePrint(row) {
this.isShowOneFlag = true
this.rowObj = row
},
handleSee(row, type) {
this.dialogQueryParams.unitName = row.unitName
this.dialogQueryParams.lotName = row.lotName
this.dialogQueryParams.agreementCode = row.agreementCode
this.dialogQueryParams.backPerson = row.backPerson
this.dialogQueryParams.phone = row.phone
this.dialogQueryParams.backTime = row.backTime + ''
this.$set(this.dialogQueryParams,'keyWord','')
this.loadingType = type
this.rowObj = row
this.open = true
this.getDialogList()
},
handlUpdate(row, type) {
this.loadingType = type
this.rowObj = row
this.open = true
this.getDialogList()
},
/** 导出按钮操作 */
handleExport() {
this.download('material/backApply/export', {
...this.queryParams
}, `退料申请单_${new Date().getTime()}.xlsx`)
},
getDialogList() {
let params = {
id: this.rowObj.id,
agreementId: this.rowObj.agreementId,
keyWord:this.dialogQueryParams.keyWord,
pageNum: this.dialogQueryParams.pageNum,
pageSize: this.dialogQueryParams.pageSize,
}
getViewByApply(params).then(res => {
console.log(res)
this.loadingList = res.rows
this.loadingTotal = res.total
})
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功");
this.$store.dispatch('dict/cleanDict');
});
},
InitIGetInfo() {
getInfo().then(res => {
this.companyId = res.user.companyId
this.getList();
})
// this.initGetUseTypeTree()
},
handleNodeClick(ev) {
},
initSelectData() {
this.GetUnitData()
this.GetProData()
},
//
async GetUnitData() {
const params = {
}
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
},
//
async InitGetAgreementInfoById() {
const {
unitId,
proId
} = this.queryParams
if (!unitId || !proId) {
return
}
const params = {
unitId: unitId,
projectId: proId
}
const res = await getAgreementInfoById(params)
// this.proList = res.data
this.queryParams.agreementCode = res.data.agreementCode
this.initGetUseTypeTree(res.data.agreementId)
},
getAgreementByUnitAndProId() {
this.InitGetAgreementInfoById()
},
getAgreementByProId() {
this.InitGetAgreementInfoById()
},
getAgreementByUnit() {
this.GetProData()
},
handleQuery1() {
this.getDialogList()
},
resetQuery1() {
this.dialogQueryParams.keyWord = ''
this.getDialogList()
},
async initGetUseTypeTree(id){
let params ={
agreementId:id
}
const res = await getUseTypeTree(params)
console.log("res-getUseTypeTree",res)
this.deptOptions = res.data
}
}
};
</script>
<style lang="scss" scoped>
.submit_box {
display: flex;
justify-content: flex-start;
align-items: center;
.submit_box_title {
display: flex;
flex-direction: column;
margin-left: 15px;
:first-child {
font-size: 14px;
font-weight: 600;
}
:last-child {
margin-top: 6px;
font-size: 12px;
}
}
}
.submit_box_two {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
margin-left: 30%;
.submit_box_title {
display: flex;
flex-direction: column;
margin-left: 10px;
font-size: 18px;
font-weight: 600;
}
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
.dialog-footer {
display: flex;
justify-content: flex-end;
align-items: center;
}
</style>