设备领用审核代码提交

20231126-yw
郑明梁 2 years ago
parent 37e59aa571
commit d074ff5bea

@ -1,68 +1,83 @@
<template>
<div>
<el-card class="el-card">
<el-form :model="filterQuery" class="query-form" size="mini" :inline="true">
<el-form-item class="query-form-item" label="领用记录号:">
<el-input v-model="filterQuery.orderId" placeholder="请输入领用记录号"
clearable="true"></el-input>
</el-form-item>
<el-form-item class="query-form-item" label="领用部门:">
<el-select v-model="filterQuery.fromDeptCode" placeholder="请选择部门" clearable="true"
@change="deptChange"
>
<el-option
v-for="item in deptList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item" label="领用仓库:">
<el-select v-model="filterQuery.fromInvCode" placeholder="请选择仓库" clearable="true"
>
<el-option
v-for="item in invList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item class="query-form-item" label="领用货位:">
<el-select v-model="filterQuery.fromInvSpaceCode" placeholder="请选择货位" clearable="true"
>
<el-option
v-for="item in spaceList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>-->
<el-form-item>
<el-button-group style="margin-left: 10px;display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit"></el-button>
</el-button-group>
</el-form-item>
<el-form :model="filterQuery" class="query-form" size="mini" label-width="100px" v-show="showSearch">
<el-row>
<el-col :span="8">
<el-form-item class="query-form-item" label="登记记录号:">
<el-input v-model="filterQuery.orderId" placeholder="请输入登记记录号" style="width: 90%"
clearable="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="query-form-item" label="登记部门:">
<el-select v-model="filterQuery.fromDeptCode" placeholder="请选择登记部门" clearable="true"
style="width: 90%"
@change="getDeptList"
>
<el-option
v-for="item in deptList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="query-form-item" label="登记人:">
<el-input v-model="filterQuery.receiveUserName" placeholder="请输入登记人" style="width: 90%"
clearable="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="单据状态:" class="query-form-item">
<el-select v-model="filterQuery.status" style="width: 90%" placeholder="请选择任务类型" clearable>
<el-option label="未审核" :value=1></el-option>
<el-option label="已审核" :value=2></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="登记时间:">
<el-date-picker
:picker-options="pickerOptions"
v-model="actDateRange"
type="daterange"
format="yyyy 年 MM 月 dd 日"
style="width: 90%"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group style="margin-left: 10px;display:flex;">
<el-button icon="el-icon-view" type="primary" @click="hideSearch">/</el-button>
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit"></el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row
@current-change="handleChange"
border>
@current-change="handleChange" border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="设备领用记录号" prop="orderId"></el-table-column>
<el-table-column label="领用部门" prop="fromDeptName"></el-table-column>
<el-table-column label="领用仓库" prop="fromInvName"></el-table-column>
<!-- <el-table-column label="领用货位" prop="fromInvSpaceName"></el-table-column>-->
<el-table-column label="领用日期" prop="createTime"></el-table-column>
<el-table-column label="领用人" prop="receiveUserName"></el-table-column>
<el-table-column label="创建人" prop="createUser"></el-table-column>
<el-table-column label="状态" prop="status" show-overflow-tooltip width="120">
<el-table-column label="登记记录号" prop="orderId"></el-table-column>
<el-table-column label="登记部门" prop="fromDeptName"></el-table-column>
<!-- <el-table-column label="登记货位" prop="fromInvSpaceName"></el-table-column>-->
<el-table-column label="登记人" prop="receiveUserName"></el-table-column>
<el-table-column label="登记时间" prop="createTime"></el-table-column>
<el-table-column label="单据状态" prop="status" show-overflow-tooltip width="120">
<template slot-scope="scope">
<el-tag>{{ statusMap[scope.row.status] }}</el-tag>
</template>
@ -70,16 +85,25 @@
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="auditOrder(scope.row)"
type="text"
size="small"
v-if="scope.row.status == 1"
@click.native.stop="auditOrder(scope.row)"
>审核
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="deleteDialog(scope.row.id)"
type="text"
size="small"
v-if="scope.row.status == 2"
@click.native.stop="detailOrder(scope.row)"
>详情
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="deleteDialog(scope.row.id)"
>删除
</el-button
>
@ -87,37 +111,52 @@
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:limit.sync="filterQuery.limit"
:page.sync="filterQuery.page"
@pagination="getList"
v-show="total>0"
:total="total"
:limit.sync="filterQuery.limit"
:page.sync="filterQuery.page"
@pagination="getList"
></pagination>
</el-card>
<el-card>
<el-table v-loading="detailLoading" :data="detailList" style="width: 100%; margin-top: 10px;">
<el-table v-loading="detailLoading" :data="detailList" style="width: 100%; margin-top: 10px;" border>
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="条码" width="200" prop="code" show-overflow-tooltip></el-table-column>
<el-table-column label="产品通用名" prop="productName" width="200"></el-table-column>
<el-table-column label="产品通用名称" prop="productName" width="200"></el-table-column>
<el-table-column label="规格型号" prop="ggxh" width="200" show-overflow-tooltip></el-table-column>
<el-table-column label="DI/物资编码" prop="nameCode" width="200"></el-table-column>
<el-table-column label="批次号" prop="batchNo" width="200"></el-table-column>
<el-table-column label="序列号" prop="serialNo" width="150"></el-table-column>
<el-table-column label="领用日期" prop="createTime" width="150"></el-table-column>
<el-table-column label="生产日期" prop="productionDate" width="150"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" width="150"></el-table-column>
<el-table-column label="注册/备案凭证号" prop="zczbhhzbapzbh" show-overflow-tooltip></el-table-column>
<el-table-column label="生产企业" prop="ylqxzcrbarmc" show-overflow-tooltip></el-table-column>
<el-table-column label="注册/备案号" prop="zczbhhzbapzbh" show-overflow-tooltip></el-table-column>
<el-table-column label="供应商" prop="supName" show-overflow-tooltip></el-table-column>
</el-table>
<pagination
v-show="detailTotal>0"
:total="detailTotal"
:limit.sync="detailQuery.limit"
:page.sync="detailQuery.page"
@pagination="getDetailList"
v-show="detailTotal>0"
:total="detailTotal"
:limit.sync="detailQuery.limit"
:page.sync="detailQuery.page"
@pagination="getDetailList"
></pagination>
<el-dialog
:title=formMap[formName]
:visible.sync="deviceReceiveOrderAuditMoifyVisible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="80%"
v-if="deviceReceiveOrderAuditMoifyVisible"
>
<DeviceReceiveOrderAuditMoify
:receiveQuery="receiveQuery"
:closeDialog="closeDialog"
:formName="formName"
>
</DeviceReceiveOrderAuditMoify>
</el-dialog>
</el-card>
</div>
@ -133,6 +172,7 @@ import {
deleteDeviceReceiveOrder,
getDeviceReceiveOrderList
} from "@/api/inventory/deviceReceiveOrder";
import DeviceReceiveOrderAuditMoify from "@/views/inventory/DeviceReceiveOrderAuditMoify";
export default {
name: "DeviceReceiveOrderAudit",
@ -143,15 +183,18 @@ export default {
fromDeptCode: this.$store.getters.locDeptCode,
fromInvCode: null,
fromInvSpaceCode: null,
status: 1,
statusList: [1, 2],
page: 1,
limit: 20,
},
list: [],
total: 0,
deptList: [],
receiveQuery: {},
showSearch: true,
invList: [],
spaceList: [],
actDateRange: [],
loading: false,
statusMap: {
0: "草稿",
@ -163,12 +206,52 @@ export default {
page: 1,
limit: 20,
},
formName: null,
formMap: {
audit: "设备登记-审核",
detail: "设备登记-详情"
},
detailList: [],
detailLoading: false,
detailTotal: 0
detailTotal: 0,
deviceReceiveOrderAuditMoifyVisible: false,
pickerOptions: {
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
};
},
methods: {
hideSearch() {
this.showSearch = !this.showSearch;
},
onReset() {
this.$router.push({
path: "",
@ -178,11 +261,12 @@ export default {
fromDeptCode: this.$store.getters.locDeptCode,
fromInvCode: null,
fromInvSpaceCode: null,
status: 1,
statusList: [1, 2],
page: 1,
limit: 20,
};
this.spaceList = [];
this.actDateRange = []
// this.getList();
this.getDeptList();
},
@ -192,6 +276,14 @@ export default {
},
getList() {
this.loading = true;
if (this.actDateRange !== null) {
this.filterQuery.startTime = this.actDateRange[0];
this.filterQuery.endTime = this.actDateRange[1];
} else {
this.filterQuery.startTime = null;
this.filterQuery.endTime = null;
}
this.detailList = []
getDeviceReceiveOrderList(this.filterQuery).then((res) => {
this.loading = false;
if (res.code === 20000) {
@ -231,64 +323,33 @@ export default {
getInvList() {
let params = {deptCode: this.filterQuery.fromDeptCode};
findInvByUser(params)
.then((response) => {
this.invList = response.data || [];
this.getList();
})
.catch(() => {
});
.then((response) => {
this.invList = response.data || [];
this.getList();
})
.catch(() => {
});
},
getSpaceList() {
let params = {invWarehouseCode: this.filterQuery.fromInvCode,invStorageCode:this.filterQuery.fromInvCode.fromDeptCode, status: 1};
let params = {
invWarehouseCode: this.filterQuery.fromInvCode,
invStorageCode: this.filterQuery.fromInvCode.fromDeptCode,
status: 1
};
getInvSpaceList(params).then((res) => {
this.spaceList = res.data.list || [];
this.getList();
})
},
auditOrder(row) {
this.$confirm('请选择审核意见', '提示', {
confirmButtonText: '通过',
cancelButtonText: '驳回',
type: 'warning',
center: true,
closeOnPressEscape: false,// ESC
closeOnClickModal: false,//
distinguishCancelAndClose: true,//
}).then(() => {
let params = {
id: row.id,
status: 2
};
updateDeviceReceiveOrderStatus(params).then((res) => {
if (res.code === 20000) {
this.$message.success("审核通过!");
this.getList();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
}).catch((action) => {
if (action === "cancel") {
let params = {
id: row.id,
status: 0
};
updateDeviceReceiveOrderStatus(params).then((res) => {
if (res.code === 20000) {
this.$message.success("已驳回!")
this.getList();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
});
} else {
return;
}
});
this.formName = "audit"
this.receiveQuery = row
this.deviceReceiveOrderAuditMoifyVisible = true
},
detailOrder(row) {
this.formName = "detail"
this.receiveQuery = row
this.deviceReceiveOrderAuditMoifyVisible = true
},
handleChange(row) {
this.detailQuery.orderIdFk = row.orderId;
@ -310,7 +371,7 @@ export default {
});
},
deleteDialog(rowId) {
this.$confirm('此操作将永久删除该领用记录, 是否继续?', '提示', {
this.$confirm('此操作将永久删除该登记记录, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@ -331,7 +392,7 @@ export default {
});
},
closeDialog() {
this.formVisible = false;
this.deviceReceiveOrderAuditMoifyVisible = false;
this.getList();
},
},
@ -344,6 +405,9 @@ export default {
created() {
this.getDeptList();
},
components: {
DeviceReceiveOrderAuditMoify
}
};
</script>

@ -0,0 +1,191 @@
<template>
<el-card style="margin: 5px;margin-top: -20px">
<el-form :model="formData" ref="dataForm" label-width="100px" style="margin-bottom: -15px">
<el-button-group style="display: flex;margin: 0px 0 10px 80%; height: 35px" v-if="formData == 'audit'">
<el-button type="primary" @click.native="AuditSubmit(2)">审核通过</el-button>
<el-button type="primary" @click.native="AuditSubmit(3)">审核拒绝</el-button>
</el-button-group>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="登记记录号:">
<el-input v-model="formData.orderId" auto-complete="off" :disabled="true" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item class="query-form-item" label="登记时间:">
<el-input v-model="formData.createTime" auto-complete="off" :disabled="true" style="width: 90%"
clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item class="query-form-item" label="登记部门:">
<el-select v-model="formData.fromDeptCode" placeholder="请选择登记部门信息" style="width: 90%;" disabled
clearable>
<el-option
v-for="item in deptList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.parentName }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10" v-if="paramValue == 0">
<el-form-item class="query-form-item" label="出库仓库:">
<el-select v-model="formData.fromInvCode" placeholder="请选择出库仓库信息" style="width: 90%" disabled
clearable>
<el-option
v-for="item in invList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.code }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-table :data="detailList" style="width: 100%;margin-top: 20px;" highlight-current-row border max-height="300"
height="300">
<el-table-column label="序号" type="index" width="50"></el-table-column>
<!-- <el-table-column label="条码" width="180" prop="originCode" show-overflow-tooltip></el-table-column>-->
<el-table-column width="150" label="产品通用名称" prop="productName" show-overflow-tooltip></el-table-column>
<el-table-column width="150" label="规格型号" prop="ggxh" show-overflow-tooltip></el-table-column>
<el-table-column width="150" label="DI/物资编码" prop="nameCode" show-overflow-tooltip></el-table-column>
<el-table-column label="批次号" prop="batchNo" width="200"></el-table-column>
<el-table-column label="生产日期" prop="productionDate" width="150"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" width="150"></el-table-column>
<el-table-column label="生产企业" prop="ylqxzcrbarmc" show-overflow-tooltip></el-table-column>
<el-table-column label="注册/备案号" prop="zczbhhzbapzbh" show-overflow-tooltip></el-table-column>
<el-table-column label="供应商" prop="supName" show-overflow-tooltip></el-table-column>
</el-table>
<pagination
style="margin-bottom: 30px"
v-show="detailTotal>0"
:total="detailTotal"
:limit.sync="detailQuery.limit"
:page.sync="detailQuery.page"
@pagination="getDetailList"
></pagination>
</el-form>
</el-card>
</template>
<script>
import {getDeptListByUser} from "@/api/auth/authDept";
import {isBlank} from "@/utils/strUtil";
import {filterSubAll} from "@/api/system/invSubWarehouse";
import {getDeviceReceiveOrderDetailList, updateDeviceReceiveOrderStatus} from "@/api/inventory/deviceReceiveOrder";
export default {
name: "DeviceReceiveOrderAuditMoify",
props: {
receiveQuery: {
type: Object,
required: true,
},
closeDialog: {
type: Function,
required: true,
},
formName: {
type: Function,
required: true,
}
},
data() {
return {
formData: {
id: null,
orderId: null,
createTime: null,
fromInvCode: null,
fromInvSpaceCode: null,
receiveUser: null,
status: 0,
code: null,
},
detailQuery: {
orderIdFk: null,
page: 1,
limit: 20,
},
detailList: [],
invList: [],
deptList: [],
detailTotal: 0,
paramValue: null
}
},
methods: {
getDeptList() {
getDeptListByUser().then((res) => {
this.deptList = res.data || [];
});
},
getInvList() {
filterSubAll().then((res) => {
if (res.code === 20000) {
this.invList = res.data || [];
}
});
},
getDetailList() {
getDeviceReceiveOrderDetailList(this.detailQuery).then((res) => {
if (res.code === 20000) {
this.detailList = res.data.list || [];
this.detailTotal = res.data.total || 0;
} else {
this.detailList = [];
this.detailTotal = 0;
}
}).catch(() => {
this.detailList = [];
this.detailTotal = 0;
});
},
AuditSubmit(status) {
let params = {
id: this.formData.id,
status: status
};
updateDeviceReceiveOrderStatus(params).then((res) => {
if (res.code === 20000) {
this.$message.success("审核通过!");
this.closeDialog();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error(error.message);
})
}
},
created() {
this.formData.id = this.receiveQuery.id
this.formData.orderId = this.receiveQuery.orderId
this.formData.fromDeptCode = this.receiveQuery.fromDeptCode
this.formData.fromInvCode = this.receiveQuery.fromInvCode
this.formData.createTime = this.receiveQuery.createTime
this.getDeptList();
this.getInvList()
this.detailQuery.orderIdFk = this.formData.orderId
this.getDetailList()
},
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save