4 changed files with 613 additions and 9 deletions
-
102src/api/warehouse/countingReport.js
-
20src/views/modules/qc/IPQCResultEntry.vue
-
4src/views/modules/shopOrder/shopOrder/shopOrderList.vue
-
496src/views/modules/warehouse/countingReport.vue
@ -0,0 +1,102 @@ |
|||
import http from '@/utils/httpRequest' |
|||
|
|||
/** |
|||
* 查询盘点单列表 |
|||
*/ |
|||
export function countingReportList(data) { |
|||
return http({ |
|||
url: http.adornUrl('/warehouse/countingReport/list'), |
|||
method: 'post', |
|||
data: http.adornData(data) |
|||
}) |
|||
} |
|||
|
|||
/** |
|||
* 根据主键查询盘点单 |
|||
*/ |
|||
export function countingReportInfo(data) { |
|||
return http({ |
|||
url: http.adornUrl('/warehouse/countingReport/info'), |
|||
method: 'post', |
|||
data: http.adornData(data) |
|||
}) |
|||
} |
|||
|
|||
/** |
|||
* 新增盘点单 |
|||
*/ |
|||
export function countingReportSave(data) { |
|||
return http({ |
|||
url: http.adornUrl('/warehouse/countingReport/save'), |
|||
method: 'post', |
|||
data: http.adornData(data) |
|||
}) |
|||
} |
|||
|
|||
/** |
|||
* 修改盘点单 |
|||
*/ |
|||
export function countingReportUpdate(data) { |
|||
return http({ |
|||
url: http.adornUrl('/warehouse/countingReport/update'), |
|||
method: 'post', |
|||
data: http.adornData(data) |
|||
}) |
|||
} |
|||
|
|||
/** |
|||
* 删除盘点单 |
|||
*/ |
|||
export function countingReportDelete(data) { |
|||
return http({ |
|||
url: http.adornUrl('/warehouse/countingReport/delete'), |
|||
method: 'post', |
|||
data: http.adornData(data) |
|||
}) |
|||
} |
|||
|
|||
/** |
|||
* 批量删除盘点单 |
|||
*/ |
|||
export function countingReportBatchDelete(data) { |
|||
return http({ |
|||
url: http.adornUrl('/warehouse/countingReport/batchDelete'), |
|||
method: 'post', |
|||
data: http.adornData(data) |
|||
}) |
|||
} |
|||
|
|||
/** |
|||
* 更新盘点单状态 |
|||
*/ |
|||
export function countingReportUpdateStatus(data) { |
|||
return http({ |
|||
url: http.adornUrl('/warehouse/countingReport/updateStatus'), |
|||
method: 'post', |
|||
data: http.adornData(data) |
|||
}) |
|||
} |
|||
|
|||
/** |
|||
* 批量更新盘点单状态(审核) |
|||
*/ |
|||
export function countingReportBatchUpdateStatus(data) { |
|||
return http({ |
|||
url: http.adornUrl('/warehouse/countingReport/batchUpdateStatus'), |
|||
method: 'post', |
|||
data: http.adornData(data) |
|||
}) |
|||
} |
|||
|
|||
/** |
|||
* 查询盘点单明细列表 |
|||
*/ |
|||
export function countingReportDetailList(data) { |
|||
return http({ |
|||
url: http.adornUrl('/warehouse/countingReport/detailList'), |
|||
method: 'post', |
|||
data: http.adornData(data) |
|||
}) |
|||
} |
|||
|
|||
|
|||
@ -0,0 +1,496 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<!-- 条件查询 --> |
|||
<el-form :inline="true" label-position="top" :model="searchData"> |
|||
<el-form-item label="BU"> |
|||
<el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 100px"> |
|||
<el-option |
|||
v-for="i in userBuList" |
|||
:key="i.buNo" |
|||
:label="i.buDesc" |
|||
:value="i.buDesc"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="盘点任务单号"> |
|||
<el-input v-model="searchData.reportId" clearable style="width: 150px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="盘点维度"> |
|||
<el-select v-model="searchData.checkDimension" placeholder="请选择" clearable style="width: 100px"> |
|||
<el-option label="按仓库" value="按仓库"></el-option> |
|||
<el-option label="按货位" value="按货位"></el-option> |
|||
<el-option label="按物料" value="按物料"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="状态"> |
|||
<el-select v-model="searchData.status" placeholder="请选择" clearable style="width: 100px"> |
|||
<el-option label="草稿" :value="0"></el-option> |
|||
<el-option label="盘点中" :value="1"></el-option> |
|||
<el-option label="待核销" :value="2"></el-option> |
|||
<el-option label="已完成" :value="3"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-button type="primary" @click="getDataList()">查询</el-button> |
|||
<el-button type="primary" @click="addModal()">新增</el-button> |
|||
<el-button type="primary" @click="batchDelete()">删除</el-button> |
|||
<el-button type="primary" @click="batchAudit()">审核</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<!-- 展示列表 --> |
|||
<el-table |
|||
:height="height" |
|||
:data="dataList" |
|||
border |
|||
v-loading="dataListLoading" |
|||
@selection-change="selectionChangeHandle" |
|||
style="width: 100%;"> |
|||
<el-table-column |
|||
type="selection" |
|||
header-align="center" |
|||
align="center" |
|||
width="50"> |
|||
</el-table-column> |
|||
<el-table-column prop="buNo" label="BU" header-align="center" align="center" min-width="80"></el-table-column> |
|||
<el-table-column prop="reportId" label="盘点任务单号" header-align="center" align="left" min-width="150"></el-table-column> |
|||
<el-table-column prop="checkDimension" label="盘点维度" header-align="center" align="center" min-width="100"></el-table-column> |
|||
<el-table-column prop="warehouseDesc" label="盘点仓库" header-align="center" align="left" min-width="120"></el-table-column> |
|||
<el-table-column prop="locationDesc" label="盘点货位" header-align="center" align="left" min-width="120"></el-table-column> |
|||
<el-table-column prop="partDesc" label="盘点物料" header-align="center" align="left" min-width="200"></el-table-column> |
|||
<el-table-column prop="statusDesc" label="状态" header-align="center" align="center" min-width="80"></el-table-column> |
|||
<el-table-column prop="createBy" label="创建人" header-align="center" align="center" min-width="100"></el-table-column> |
|||
<el-table-column prop="createDate" label="创建时间" header-align="center" align="center" min-width="150"></el-table-column> |
|||
<el-table-column |
|||
fixed="right" |
|||
header-align="center" |
|||
align="center" |
|||
width="180" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<el-link style="cursor: pointer" v-if="scope.row.status === 0" @click="updateStatus(scope.row, 1)">下达</el-link> |
|||
<el-link style="cursor: pointer" v-if="scope.row.status === 1" @click="updateStatus(scope.row, 2)">结束</el-link> |
|||
<el-link style="cursor: pointer" v-if="scope.row.status === 2" @click="updateStatus(scope.row, 3)">核销</el-link> |
|||
<el-link style="cursor: pointer" v-if="scope.row.status === 0" @click="updateModal(scope.row)">编辑</el-link> |
|||
<el-link style="cursor: pointer" @click="viewDetail(scope.row)">盘点清单</el-link> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<!-- 分页 --> |
|||
<el-pagination |
|||
style="margin-top: 0px" |
|||
@size-change="sizeChangeHandle" |
|||
@current-change="currentChangeHandle" |
|||
:current-page="pageIndex" |
|||
:page-sizes="[20, 50, 100, 200, 500]" |
|||
:page-size="pageSize" |
|||
:total="totalPage" |
|||
layout="total, sizes, prev, pager, next, jumper"> |
|||
</el-pagination> |
|||
|
|||
<!-- 新增/修改对话框 --> |
|||
<el-dialog :title="modalTitle" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="500px"> |
|||
<el-form ref="modalForm" :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="BU" prop="bu"> |
|||
<el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 120px"> |
|||
<el-option |
|||
v-for="i in userBuList" |
|||
:key="i.buNo" |
|||
:label="i.sitename" |
|||
:value="i.buNo"> |
|||
<span style="float: left;width: 100px">{{ i.sitename }}</span> |
|||
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px"> |
|||
{{ i.buDesc }} |
|||
</span> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="盘点维度" prop="checkDimension"> |
|||
<el-select v-model="modalData.checkDimension" placeholder="请选择" @change="dimensionChange" style="width: 120px"> |
|||
<el-option label="按仓库" value="按仓库"></el-option> |
|||
<el-option label="按货位" value="按货位"></el-option> |
|||
<el-option label="按物料" value="按物料"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px"> |
|||
<el-form-item> |
|||
<span style="cursor: pointer" slot="label" @click="getBaseList(506)"><a href="#">盘点仓库</a></span> |
|||
<el-input v-model="modalData.warehouseId" @change="supplierBlur(506)" style="width: 100px"></el-input> |
|||
<el-input v-model="modalData.warehouseName" disabled style="width: 300px"></el-input> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px"> |
|||
<el-form-item label="盘点货位" prop="locationId" style="width: 100%"> |
|||
<el-input v-model="modalData.locationId" placeholder="请选择盘点货位(盘点维度:按仓库、按货位)" style="width: 100%"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="盘点物料" prop="partNo" style="width: 100%"> |
|||
<el-input v-model="modalData.partNo" placeholder="请选择盘点物料(盘点维度:按仓库、按货位、按物料)" style="width: 100%"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="备注" style="width: 100%"> |
|||
<el-input type="textarea" v-model="modalData.remark" :rows="3" style="width: 100%"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-footer style="height:35px;margin-top: 55px;text-align:center"> |
|||
<el-button type="primary" :loading="saveLoading" @click="saveData">确定</el-button> |
|||
<el-button type="primary" @click="modalFlag = false">取消</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
|
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
countingReportList, |
|||
countingReportSave, |
|||
countingReportUpdate, |
|||
countingReportBatchDelete, |
|||
countingReportUpdateStatus, |
|||
countingReportBatchUpdateStatus |
|||
} from '@/api/warehouse/countingReport.js' |
|||
import {getSiteAndBuByUserName} from "@/api/qc/qc.js" |
|||
import Chooselist from '@/views/modules/common/Chooselist_eam' |
|||
import {verifyData} from "@/api/chooselist/chooselist.js" |
|||
|
|||
export default { |
|||
components: { |
|||
Chooselist, |
|||
}, |
|||
data() { |
|||
return { |
|||
searchData: { |
|||
buNo: '', |
|||
reportId: '', |
|||
checkDimension: '', |
|||
status: null |
|||
}, |
|||
dataList: [], |
|||
dataListLoading: false, |
|||
dataListSelections: [], |
|||
pageIndex: 1, |
|||
pageSize: 20, |
|||
totalPage: 0, |
|||
height: window.innerHeight - 170, |
|||
// BU列表 |
|||
userBuList: [], |
|||
// 新增/修改对话框 |
|||
modalFlag: false, |
|||
modalTitle: '', |
|||
modalDisableFlag: false, |
|||
modalData: { |
|||
flag: 'add', |
|||
bu: '', |
|||
site: '', |
|||
buNo: '', |
|||
reportId: '', |
|||
checkDimension: '', |
|||
warehouseId: '', |
|||
warehouseName: '', |
|||
locationId: '', |
|||
locationName: '', |
|||
partNo: '', |
|||
partDesc: '', |
|||
remark: '' |
|||
}, |
|||
saveLoading: false, |
|||
rules: { |
|||
bu: [{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: ['blur','change'] |
|||
}], |
|||
checkDimension: [{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: ['blur','change'] |
|||
}], |
|||
warehouseId: [{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: ['blur','change'] |
|||
}], |
|||
partNo: [{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: ['blur','change'] |
|||
}] |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.getSiteAndBuByUserName() |
|||
this.getDataList() |
|||
}, |
|||
methods: { |
|||
// 获取用户BU列表 |
|||
getSiteAndBuByUserName() { |
|||
let tempData = { |
|||
username: this.$store.state.user.name |
|||
} |
|||
getSiteAndBuByUserName(tempData).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.userBuList = data.rows |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
// 获取数据列表 |
|||
getDataList() { |
|||
this.dataListLoading = true |
|||
this.searchData.page = this.pageIndex |
|||
this.searchData.limit = this.pageSize |
|||
countingReportList(this.searchData).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.dataList = data.page.list |
|||
this.totalPage = data.page.totalCount |
|||
} else { |
|||
this.dataList = [] |
|||
this.totalPage = 0 |
|||
} |
|||
this.dataListLoading = false |
|||
}) |
|||
}, |
|||
|
|||
// 每页数 |
|||
sizeChangeHandle(val) { |
|||
this.pageSize = val |
|||
this.pageIndex = 1 |
|||
this.getDataList() |
|||
}, |
|||
|
|||
// 当前页 |
|||
currentChangeHandle(val) { |
|||
this.pageIndex = val |
|||
this.getDataList() |
|||
}, |
|||
|
|||
// 多选 |
|||
selectionChangeHandle(val) { |
|||
this.dataListSelections = val |
|||
}, |
|||
|
|||
// 新增 |
|||
addModal() { |
|||
this.modalFlag = true |
|||
this.modalTitle = '盘点任务生成' |
|||
this.modalDisableFlag = false |
|||
this.modalData = { |
|||
flag: 'add', |
|||
bu: this.userBuList.length > 0 ? this.userBuList[0].buNo : '', |
|||
site: '', |
|||
buNo: '', |
|||
reportId: '', |
|||
checkDimension: '', |
|||
warehouseId: '', |
|||
warehouseName: '', |
|||
locationId: '', |
|||
locationName: '', |
|||
partNo: '', |
|||
partDesc: '', |
|||
remark: '' |
|||
} |
|||
this.$nextTick(() => { |
|||
if (this.$refs.modalForm) { |
|||
this.$refs.modalForm.clearValidate() |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
// 修改 |
|||
updateModal(row) { |
|||
this.modalFlag = true |
|||
this.modalTitle = '修改盘点任务' |
|||
this.modalDisableFlag = true |
|||
this.modalData = { |
|||
flag: 'update', |
|||
bu: row.site + '_' + row.buNo, |
|||
site: row.site, |
|||
buNo: row.buNo, |
|||
reportId: row.reportId, |
|||
checkDimension: row.checkDimension, |
|||
warehouseId: row.warehouseId, |
|||
warehouseName: row.warehouseName, |
|||
locationId: row.locationId, |
|||
locationName: row.locationName, |
|||
partNo: row.partNo, |
|||
partDesc: row.partDesc, |
|||
remark: row.remark |
|||
} |
|||
this.$nextTick(() => { |
|||
if (this.$refs.modalForm) { |
|||
this.$refs.modalForm.clearValidate() |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
// 盘点维度变化 |
|||
dimensionChange() { |
|||
// 根据维度清空不需要的字段 |
|||
if (this.modalData.checkDimension === '按物料') { |
|||
this.modalData.locationId = '' |
|||
this.modalData.locationName = '' |
|||
} |
|||
}, |
|||
|
|||
// 保存 |
|||
saveData() { |
|||
this.$refs.modalForm.validate((valid) => { |
|||
if (valid) { |
|||
this.saveLoading = true |
|||
const apiMethod = this.modalData.flag === 'add' ? countingReportSave : countingReportUpdate |
|||
apiMethod(this.modalData).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success(data.msg) |
|||
this.modalFlag = false |
|||
this.getDataList() |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
this.saveLoading = false |
|||
}).catch(() => { |
|||
this.saveLoading = false |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
// 批量删除 |
|||
batchDelete() { |
|||
if (this.dataListSelections.length === 0) { |
|||
this.$message.warning('请选择要删除的盘点单') |
|||
return |
|||
} |
|||
// 检查是否有已下达的单据 |
|||
const hasIssued = this.dataListSelections.some(item => item.status !== 0) |
|||
if (hasIssued) { |
|||
this.$message.error('已下达的盘点单不允许删除') |
|||
return |
|||
} |
|||
this.$confirm('确定要删除选中的盘点单吗?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
const reportIds = this.dataListSelections.map(item => item.reportId) |
|||
countingReportBatchDelete({ reportIds }).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success(data.msg) |
|||
this.getDataList() |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
// 批量审核 |
|||
batchAudit() { |
|||
if (this.dataListSelections.length === 0) { |
|||
this.$message.warning('请选择要审核的盘点单') |
|||
return |
|||
} |
|||
this.$confirm('确定要审核选中的盘点单吗?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
const reportIds = this.dataListSelections.map(item => item.reportId) |
|||
countingReportBatchUpdateStatus({ reportIds, status: 3 }).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success(data.msg) |
|||
this.getDataList() |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
// 更新状态 |
|||
updateStatus(row, status) { |
|||
let statusText = '' |
|||
if (status === 1) statusText = '下达' |
|||
else if (status === 2) statusText = '结束' |
|||
else if (status === 3) statusText = '核销' |
|||
|
|||
this.$confirm(`确定要${statusText}该盘点单吗?`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
const params = { |
|||
site: row.site, |
|||
buNo: row.buNo, |
|||
reportId: row.reportId, |
|||
status: status |
|||
} |
|||
countingReportUpdateStatus(params).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success(data.msg) |
|||
this.getDataList() |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
// 查看盘点清单 |
|||
viewDetail(row) { |
|||
this.$message.info('盘点清单功能待开发') |
|||
// TODO: 打开盘点清单对话框 |
|||
}, |
|||
|
|||
// 输入校验 |
|||
supplierBlur (tagNo) { |
|||
let tempData = { |
|||
tagno: tagNo, |
|||
conditionSql: " and SupplierID = '" + this.modalData.supplierId + "'" + " and site = '" + this.modalData.site + "'" |
|||
} |
|||
verifyData(tempData).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
if (data.baseListData.length > 0) { |
|||
this.modalData.supplierId = data.baseListData[0].SupplierID |
|||
this.modalData.supplierName = data.baseListData[0].SupplierName |
|||
} else { |
|||
this.modalData.supplierName = '' |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
// 获取基础数据列表S |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.tagType = type |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if (val === 506) { |
|||
strVal = this.modalData.supplierId |
|||
this.$refs.baseList.init(val, strVal) |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
// 列表方法的回调 |
|||
getBaseData (val) { |
|||
if (this.tagNo === 506) { |
|||
this.modalData.supplierId = val.SupplierID |
|||
this.modalData.supplierName = val.SupplierName |
|||
} |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
|
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue