fix:配件新购入库bug修改

This commit is contained in:
jackal 2024-04-20 13:41:35 +08:00
parent 66f8df4fba
commit 5a88bafd89
3 changed files with 939 additions and 1041 deletions

View File

@ -216,6 +216,13 @@
v-if="!isCheck && scope.row.status==0" v-if="!isCheck && scope.row.status==0"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>删除</el-button> >删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
v-if="isShow"
@click="handleDelete(scope.row)"
>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -343,6 +350,7 @@ export default {
}, },
taskId: '', taskId: '',
isView: false, isView: false,
isShow: false,
isEdit: false, isEdit: false,
isCheck: false, isCheck: false,
addForm: { addForm: {
@ -397,6 +405,12 @@ export default {
}, },
}, },
created() { created() {
const isShow = this.$route.query && this.$route.query.isShow
if (isShow && isShow == 'true') {
this.isShow = true
} else {
this.isShow = false
}
const taskId = this.$route.query && this.$route.query.taskId const taskId = this.$route.query && this.$route.query.taskId
this.taskId = taskId this.taskId = taskId
if (this.taskId == '' || !this.taskId) { if (this.taskId == '' || !this.taskId) {
@ -406,14 +420,12 @@ export default {
this.getTaskInfo() this.getTaskInfo()
} }
const isView = this.$route.query && this.$route.query.isView const isView = this.$route.query && this.$route.query.isView
console.log(this.isView, 'isView')
if (isView && isView == 'true') { if (isView && isView == 'true') {
this.isView = true this.isView = true
} else { } else {
this.isView = false this.isView = false
} }
const isCheck = this.$route.query && this.$route.query.isCheck const isCheck = this.$route.query && this.$route.query.isCheck
console.log(this.isCheck, 'isCheck')
if (isCheck && isCheck == 'true') { if (isCheck && isCheck == 'true') {
this.isCheck = true this.isCheck = true
} else { } else {

View File

@ -1,11 +1,19 @@
<template> <template>
<div class="app-container" id="newAccessoryList"> <div class="app-container" id="newAccessoryList">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="80px"
>
<el-form-item label="关键字" prop="keyWord"> <el-form-item label="关键字" prop="keyWord">
<el-input <el-input
v-model="queryParams.keyWord" v-model="queryParams.keyWord"
placeholder="请输入关键字" placeholder="请输入关键字"
clearable maxlength="50" clearable
maxlength="50"
style="width: 240px" style="width: 240px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
@ -19,13 +27,7 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAccept">新增</el-button>
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAccept"
>新增</el-button>
</el-col> </el-col>
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
@ -35,15 +37,9 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
>发布入库</el-button> >发布入库</el-button>
</el-col> --> </el-col>-->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -52,11 +48,36 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" type="index" width="55px" /> <el-table-column label="序号" align="center" type="index" width="55px" />
<el-table-column label="采购单号" align="center" prop="code" :show-overflow-tooltip="true" /> <el-table-column label="采购单号" align="center" prop="code" :show-overflow-tooltip="true" />
<el-table-column label="采购日期" align="center" prop="purchaseTime" :show-overflow-tooltip="true" /> <el-table-column
<el-table-column label="到货日期" align="center" prop="arrivalTime" :show-overflow-tooltip="true" /> label="采购日期"
<el-table-column label="采购配件" align="center" prop="purchasingTypeName" :show-overflow-tooltip="true" /> align="center"
<el-table-column label="采购员" align="center" prop="purchaserName" :show-overflow-tooltip="true" /> prop="purchaseTime"
<el-table-column label="采购状态" align="center" prop="purchasingStatus" :show-overflow-tooltip="true" /> :show-overflow-tooltip="true"
/>
<el-table-column
label="到货日期"
align="center"
prop="arrivalTime"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购配件"
align="center"
prop="purchasingTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购员"
align="center"
prop="purchaserName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="采购状态"
align="center"
prop="purchasingStatus"
:show-overflow-tooltip="true"
/>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<!-- <el-table-column label="状态" align="center" prop="createTime" width="180">--> <!-- <el-table-column label="状态" align="center" prop="createTime" width="180">-->
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
@ -67,13 +88,8 @@
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" icon="el-icon-zoom-in" @click="handleView(scope.row)">查看</el-button>
size="mini"
icon="el-icon-zoom-in"
@click="handleView(scope.row)"
>查看</el-button>
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
@ -86,21 +102,21 @@
type="success" type="success"
icon="el-icon-edit" icon="el-icon-edit"
v-if="scope.row.taskStatus==68" v-if="scope.row.taskStatus==68"
@click="handleCheck(scope.row)" @click="handleCheck(scope.row)"
>验收</el-button> >验收</el-button>
<el-button <el-button
size="mini" size="mini"
type="info" type="info"
icon="el-icon-edit" icon="el-icon-edit"
v-if="scope.row.taskStatus!=68" v-if="scope.row.taskStatus!=68"
@click="handleBuy(scope.row)" @click="handleBuy(scope.row)"
>验收单</el-button> >验收单</el-button>
<el-button <el-button
size="mini" size="mini"
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
v-if="scope.row.taskStatus==68" v-if="scope.row.taskStatus==68"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -113,84 +129,90 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<!-- 验收单弹窗 --> <!-- 验收单弹窗 -->
<el-dialog :title="title" :visible.sync="openPrint" width="1100px" append-to-body> <el-dialog :title="title" :visible.sync="openPrint" width="1100px" append-to-body>
<div style="height: 400px;overflow-y: scroll;"> <div style="height: 400px;overflow-y: scroll;">
<vue-easy-print tableShow ref="remarksPrintRef" class="print"> <vue-easy-print tableShow ref="remarksPrintRef" class="print">
<div class="title" style="text-align: center;font-weight: 600;font-size: 16px;"> <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> <div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<div class="info" style="margin-top: 10px;display: flex;flex-wrap: wrap;"> <span>工程名称</span>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>工程名称</span>
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>验收单编号</span>{{ printData.code }}
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>合同名称</span>
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>合同编号</span>
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>验收地点</span>
</div>
<div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>供应商</span><span v-if="printTableData.length>0">{{ printTableData[0].supplier }}</span>
</div>
</div>
<el-table :data="printTableData" class="table" style="margin-top: 20px;width: 1000px;padding-bottom: 1px;" border>
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="类型名称" align="center" prop="machineTypeName" />
<el-table-column label="规格型号" align="center" prop="specificationType" />
<el-table-column label="计量单位" align="center" prop="unitName" />
<el-table-column label="采购数量" align="center" prop="purchaseNum" />
<el-table-column label="已验收数量" align="center" prop="" />
<el-table-column label="本次验收数量" align="center" prop="checkNum" />
<el-table-column label="累积验收数量" align="center" prop="" />
<el-table-column label="验收日期" align="center" prop="" />
<el-table-column label="合格证及技术资料" align="center" prop="" />
<el-table-column label="包装" align="center" prop="" />
</el-table>
<div class="fillIn" style="margin-top: 20px;display: flex;justify-content: space-between;">
<div class="item" style="width: 50%;">
<div>
<span>接收单位验收意见</span>
</div> </div>
<div> <div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>验收人</span> <span>验收单编号</span>
{{ printData.code }}
</div> </div>
<div> <div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>接收单位</span> <span>合同名称</span>
</div> </div>
<div> <div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>验收负责人 </span> <span>合同编号</span>
</div> </div>
</div> <div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>验收地点</span>
<div class="item" style="width: 50%;"> </div>
<div> <div class="item" style="width: 50%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>供应商</span> <span>供应商</span>
</div> <span v-if="printTableData.length>0">{{ printTableData[0].supplier }}</span>
<div>
<span>供应商</span>
</div>
<div>
<span>验收负责人 </span>
</div> </div>
</div> </div>
<!-- <div class="item" style="width: 25%;"> <el-table
<span>经办人</span> :data="printTableData"
</div> --> class="table"
</div> style="margin-top: 20px;width: 1000px;padding-bottom: 1px;"
border
>
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="类型名称" align="center" prop="machineTypeName" />
<el-table-column label="规格型号" align="center" prop="specificationType" />
<el-table-column label="计量单位" align="center" prop="unitName" />
<el-table-column label="采购数量" align="center" prop="purchaseNum" />
</vue-easy-print> <el-table-column label="已验收数量" align="center" prop />
<el-table-column label="本次验收数量" align="center" prop="checkNum" />
<el-table-column label="累积验收数量" align="center" prop />
<el-table-column label="验收日期" align="center" prop />
<el-table-column label="合格证及技术资料" align="center" prop />
<el-table-column label="包装" align="center" prop />
</el-table>
<div
class="fillIn"
style="margin-top: 20px;display: flex;justify-content: space-between;"
>
<div class="item" style="width: 50%;">
<div>
<span>接收单位验收意见</span>
</div>
<div>
<span>验收人</span>
</div>
<div>
<span>接收单位</span>
</div>
<div>
<span>验收负责人 </span>
</div>
</div>
<div class="item" style="width: 50%;">
<div>
<span>供应商</span>
</div>
<div>
<span>供应商</span>
</div>
<div>
<span>验收负责人 </span>
</div>
</div>
<!-- <div class="item" style="width: 25%;">
<span>经办人</span>
</div>-->
</div>
</vue-easy-print>
</div> </div>
<div slot="footer" class="dialog-footer" style="text-align: center"> <div slot="footer" class="dialog-footer" style="text-align: center">
@ -198,19 +220,22 @@
<el-button @click="openPrint = false"> </el-button> <el-button @click="openPrint = false"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<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 { listPurchaseAccessory,getPurchaseCheckInfo,delPurchaseAccessory,getAccessoryAcceptanceForm } from "@/api/store/newBuy"; import {
import vueEasyPrint from 'vue-easy-print'; listPurchaseAccessory,
getPurchaseCheckInfo,
delPurchaseAccessory,
getAccessoryAcceptanceForm,
} from '@/api/store/newBuy'
import vueEasyPrint from 'vue-easy-print'
export default { export default {
// name: "NewAccessoryList", // name: "NewAccessoryList",
dicts: ['sys_normal_disable'], dicts: ['sys_normal_disable'],
components:{vueEasyPrint}, components: { vueEasyPrint },
data() { data() {
return { return {
// //
@ -228,7 +253,7 @@ export default {
// //
accessoryList: [], accessoryList: [],
// //
title: "", title: '',
// //
open: false, open: false,
// //
@ -239,42 +264,37 @@ export default {
pageSize: 10, pageSize: 10,
dictName: undefined, dictName: undefined,
dictType: undefined, dictType: undefined,
status: undefined status: undefined,
}, },
// //
form: {}, form: {},
openPrint: false, openPrint: false,
printData:{}, printData: {},
printTableData:[], printTableData: [],
// //
rules: { rules: {
dictName: [ dictName: [{ required: true, message: '字典名称不能为空', trigger: 'blur' }],
{ required: true, message: "字典名称不能为空", trigger: "blur" } dictType: [{ required: true, message: '字典类型不能为空', trigger: 'blur' }],
], },
dictType: [ }
{ required: true, message: "字典类型不能为空", trigger: "blur" }
]
}
};
}, },
created() { created() {
this.getList(); this.getList()
}, },
methods: { methods: {
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true
listPurchaseAccessory(this.queryParams).then(response => { listPurchaseAccessory(this.queryParams).then(response => {
this.accessoryList = response.rows; this.accessoryList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
} })
);
}, },
// //
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
// //
reset() { reset() {
@ -282,53 +302,53 @@ export default {
taskId: undefined, taskId: undefined,
dictName: undefined, dictName: undefined,
dictType: undefined, dictType: undefined,
status: "0", status: '0',
remark: undefined remark: undefined,
}; }
this.resetForm("form"); this.resetForm('form')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = []
this.resetForm("queryForm"); this.resetForm('queryForm')
this.handleQuery(); this.handleQuery()
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset()
this.open = true; this.open = true
this.title = "添加字典类型"; this.title = '添加字典类型'
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.taskId) this.ids = selection.map(item => item.taskId)
this.single = selection.length!=1 this.single = selection.length != 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 编辑按钮操作 */ /** 编辑按钮操作 */
handleUpdate(row) { handleUpdate(row) {
let query = { taskId:row.taskId } let query = { taskId: row.taskId }
this.$tab.closeOpenPage({ path: "/store/newBuy/newAccessoryAccept", query }); this.$tab.closeOpenPage({ path: '/store/newBuy/newAccessoryAccept', query })
}, },
/** 查看按钮操作 */ /** 查看按钮操作 */
handleView(row) { handleView(row) {
let query = { taskId:row.taskId,isView:true } let query = { taskId: row.taskId, isView: true }
this.$tab.closeOpenPage({ path: "/store/newBuy/newAccessoryAccept", query }); this.$tab.closeOpenPage({ path: '/store/newBuy/newAccessoryAccept', query })
}, },
/** 验收按钮操作 */ /** 验收按钮操作 */
handleCheck(row) { handleCheck(row) {
let query = { taskId:row.taskId,isCheck:true} let query = { taskId: row.taskId, isCheck: true }
this.$tab.closeOpenPage({ path: "/store/newBuy/newAccessoryAccept", query }); this.$tab.closeOpenPage({ path: '/store/newBuy/newAccessoryAccept', query })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
// if (this.form.taskId != undefined) { // if (this.form.taskId != undefined) {
// updateType(this.form).then(response => { // updateType(this.form).then(response => {
@ -344,56 +364,64 @@ export default {
// }); // });
// } // }
} }
}); })
}, },
// //
getPrintTable(taskId){ getPrintTable(taskId) {
getAccessoryAcceptanceForm({taskId:taskId}).then(response => { getAccessoryAcceptanceForm({ taskId: taskId }).then(response => {
this.printData = response.data; this.printData = response.data
this.printTableData = response.data.partDetailsList; this.printTableData = response.data.partDetailsList
} })
);
}, },
// //
handleBuy(row) { handleBuy(row) {
// this.query.taskId = row.taskId // this.query.taskId = row.taskId
this.getPrintTable(row.taskId) this.getPrintTable(row.taskId)
this.openPrint = true this.openPrint = true
this.title = "新购工机具验收单"; this.title = '新购工机具验收单'
}, },
// //
print(){ print() {
this.$refs.remarksPrintRef.print(); this.$refs.remarksPrintRef.print()
}, },
/** 新增 */ /** 新增 */
handleAccept() { handleAccept() {
this.$tab.closeOpenPage("/store/newBuy/newAccessoryAccept"); let query = { isShow: true }
this.$tab.closeOpenPage({ path: '/store/newBuy/newAccessoryAccept', query })
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const taskId = row.taskId || this.ids; const taskId = row.taskId || this.ids
this.$modal.confirm('是否确认删除该数据项?').then(function() { this.$modal
return delPurchaseAccessory(taskId); .confirm('是否确认删除该数据项?')
}).then(() => { .then(function() {
this.getList(); return delPurchaseAccessory(taskId)
this.$modal.msgSuccess("删除成功"); })
}).catch(() => {}); .then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('material/purchaseAccessory/export', { this.download(
...this.queryParams 'material/purchaseAccessory/export',
}, `新购配件_${new Date().getTime()}.xlsx`) {
...this.queryParams,
},
`新购配件_${new Date().getTime()}.xlsx`
)
}, },
/** 刷新缓存按钮操作 */ /** 刷新缓存按钮操作 */
handleRefreshCache() { handleRefreshCache() {
refreshCache().then(() => { refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功"); this.$modal.msgSuccess('刷新成功')
this.$store.dispatch('dict/cleanDict'); this.$store.dispatch('dict/cleanDict')
}); })
} },
} },
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini { ::v-deep.el-table .fixed-width .el-button--mini {

File diff suppressed because it is too large Load Diff