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

View File

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

File diff suppressed because it is too large Load Diff