Browse Source

接收对账 2022年8月19日 sxm

master
[li_she] 3 years ago
parent
commit
67c2a21656
  1. 40
      src/api/knifemold/tool-info.js
  2. 33
      src/views/modules/knifemold/tool-oi-record.vue
  3. 768
      src/views/modules/knifemold/tool-receipt.vue

40
src/api/knifemold/tool-info.js

@ -1,43 +1,53 @@
import { createAPI } from "@/utils/httpRequest.js";
import {createAPI} from "@/utils/httpRequest.js";
// 获取工具主信息信息
export const getToolHeaderData = data => createAPI(`toolInfo/getToolHeaderData`,'POST',data)
export const getToolHeaderData = data => createAPI(`toolInfo/getToolHeaderData`, 'POST', data)
// 获取工具明细信息信息
export const getToolDetailList = data => createAPI(`toolInfo/getToolDetailList`,'POST',data)
export const getToolDetailList = data => createAPI(`toolInfo/getToolDetailList`, 'POST', data)
// 获取工具维护记录
export const getToolInstanceIdUseHist = data => createAPI(`toolInfo/getToolInstanceIdUseHist`,'POST',data)
export const getToolInstanceIdUseHist = data => createAPI(`toolInfo/getToolInstanceIdUseHist`, 'POST', data)
// 获取工具使用记录
export const getSfdcToolingHistList = data => createAPI(`toolInfo/getSfdcToolingHistList`,'POST',data)
export const getSfdcToolingHistList = data => createAPI(`toolInfo/getSfdcToolingHistList`, 'POST', data)
// 获取工具使用记录
export const getToolHeaderList = data => createAPI(`toolInfo/getToolHeaderList`,'POST',data)
export const getToolHeaderList = data => createAPI(`toolInfo/getToolHeaderList`, 'POST', data)
// 编辑 工具主表信息
export const editToolHeader = data => createAPI(`toolInfo/editToolHeader`,'POST',data)
export const editToolHeader = data => createAPI(`toolInfo/editToolHeader`, 'POST', data)
// 保存 工具主表信息
export const saveToolHeader = data => createAPI(`toolInfo/saveToolHeader`,'POST',data)
export const saveToolHeader = data => createAPI(`toolInfo/saveToolHeader`, 'POST', data)
// deleteToolHeader
export const deleteToolHeader = data => createAPI(`toolInfo/deleteToolHeader`,'POST',data)
export const deleteToolHeader = data => createAPI(`toolInfo/deleteToolHeader`, 'POST', data)
// 获取工具使用记录
export const updateToolDetail = data => createAPI(`toolInfo/updateToolDetail`,'POST',data)
export const updateToolDetail = data => createAPI(`toolInfo/updateToolDetail`, 'POST', data)
// 添加工具实例
export const saveToolInfoDetail = data => createAPI(`toolInfo/saveToolInfoDetail`,'POST',data)
export const saveToolInfoDetail = data => createAPI(`toolInfo/saveToolInfoDetail`, 'POST', data)
// 获取工具打印
export const printTool = data => createAPI(`toolMan/printTool`,'POST',data)
export const printTool = data => createAPI(`toolMan/printTool`, 'POST', data)
// 获取工具信息
export const getToolInfoList = data => createAPI(`toolInfo/getToolInfoList`,'POST',data)
export const getToolInfoList = data => createAPI(`toolInfo/getToolInfoList`, 'POST', data)
// 获取出入库信息
export const getToolTransInfoList = data => createAPI(`toolInfo/getToolTransInfoList`,'POST',data)
export const getToolTransInfoList = data => createAPI(`toolInfo/getToolTransInfoList`, 'POST', data)
// 工具接收信息
export const getPoReceiptList = data => createAPI(`toolInfo/getPoReceiptList`, 'POST', data)
// 接收对账
export const updatePoReceiptList = data => createAPI(`toolInfo/updatePoReceiptList`, 'POST', data)
// 取消对账
export const updatePoReceiptListR = data => createAPI(`toolInfo/updatePoReceiptListR`, 'POST', data)

33
src/views/modules/knifemold/tool-oi-record.vue

@ -43,7 +43,7 @@
<el-input style="width: 100px" v-model="queryTool.supplierId"></el-input>
</el-form-item>
<el-form-item :label="'类型'">
<el-select style="width: 180px" multiple collapse-tags v-model="queryTool.transTypes">
<el-select style="width: 180px" multiple collapse-tags v-model="queryTool.transTypes">
<el-option value="" label="全部"></el-option>
<el-option value="订单接收" label="订单接收"></el-option>
<el-option value="采购入库" label="采购入库"></el-option>
@ -450,6 +450,7 @@
exportHeader: [this.$route.meta.title],
exportFooter: [],
exportDefaultValue: "",
exportDataList: []
// end
}
@ -464,6 +465,7 @@
},
methods: {
// --------------- -------------------
//
getDataList() {
this.dataListLoading = true
this.queryTool.limit = this.pageSize
@ -478,6 +480,29 @@
this.dataListLoading = false
})
},
//
async getExportDataList() {
this.dataListLoading = true
let queryTool = {
limit: 9999999,
page: 1,
supplierId: this.queryTool.supplierId,
toolId: this.queryTool.toolId,
toolInstanceId: this.queryTool.toolInstanceId,
locationId: this.queryTool.locationId,
toolDescription: this.queryTool.toolDescription,
startDate: this.queryTool.startDate,
endDate: this.queryTool.endDate,
transNo: this.queryTool.transNo,
transTypes: this.queryTool.transTypes
}
await getToolTransInfoList(queryTool).then(({data}) => {
if (data.code == 0) {
this.exportDataList = data.data.list
}
this.dataListLoading = false
})
},
getBaseData(val) {
if (this.tagNo === 3) {
this.queryTool.supplierId = val.SupplierID
@ -620,11 +645,13 @@
let s = eval("(" + json + ")")
return s
},
createExportData() {
async createExportData() {
await this.getExportDataList()
// ,,
return this.dataList;
return this.exportDataList;
},
startDownload() {
},
finishDownload() {
}

768
src/views/modules/knifemold/tool-receipt.vue

@ -0,0 +1,768 @@
<template>
<div class="mod-config">
<el-row>
<el-col :span="24">
<el-button @click="getDataList()" type="primary">{{ buttons.search }}</el-button>
<el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{ buttons.defaultTable }}
</el-button>
<el-button @click="userSetting" type="primary">{{ buttons.settingTable }}</el-button>
<el-button type="primary" @click="editPoReceiptList" :disabled="selectReceipts.length <= 0">{{ buttons.receiveList }}</el-button>
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ buttons.download }}
</download-excel>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form :inline="true" label-position="top">
<el-form-item :label="'单号'">
<el-input style="width: 140px" v-model="queryTool.orderref1"></el-input>
</el-form-item>
<el-form-item :label="'工具编码'">
<el-input style="width: 120px" v-model="queryTool.partNo"></el-input>
</el-form-item>
<el-form-item :label="'工具名称'">
<el-input style="width: 120px" v-model="queryTool.toolDescription"></el-input>
</el-form-item>
<el-form-item>
<span slot="label" @click="getBaseList(3,1)"><el-link>{{'供应商编码'}}</el-link> </span>
<el-input style="width: 120px" v-model="queryTool.supplierId"></el-input>
</el-form-item>
<el-form-item :label="'状态'">
<el-select style="width: 120px" v-model="queryTool.status">
<el-option value="" label="全部"></el-option>
<el-option value="已对账" label="已对账"></el-option>
<el-option value="未对账" label="未对账"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'接收人'">
<el-input style="width: 100px" v-model="queryTool.receiver"></el-input>
</el-form-item>
<el-form-item :label="'接收日期'">
<el-date-picker style="width: 120px" v-model="queryTool.startDate"
value-format='yyyy-MM-dd 00:00:00'
format='yyyy-MM-dd'
></el-date-picker>
-
<el-date-picker style="width: 120px" v-model="queryTool.endDate"
value-format='yyyy-MM-dd 23:59:59'
format='yyyy-MM-dd'
></el-date-picker>
</el-form-item>
<el-form-item :label="'对账人'">
<el-input style="width: 100px" v-model="queryTool.inspector"></el-input>
</el-form-item>
<el-form-item :label="'对账日期'">
<el-date-picker style="width: 120px" v-model="queryTool.rStartDate"
value-format='yyyy-MM-dd 00:00:00'
format='yyyy-MM-dd'
></el-date-picker>
-
<el-date-picker style="width: 120px" v-model="queryTool.rEndDate"
value-format='yyyy-MM-dd 23:59:59'
format='yyyy-MM-dd'
></el-date-picker>
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-table
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
highlight-current-row
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="30">
</el-table-column>
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
:label="'操作'">
<template slot-scope="scope">
<el-link @click="editPoReceipt(scope.row)" v-if="scope.row.invoiceQty != scope.row.arriveQty ">完成对账 </el-link>
<el-link v-else @click="editPoReceiptR(scope.row)"> 取消对账</el-link>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-col>
</el-row>
<!-- 动态列 -->
<column v-if="visible" ref="column" @refreshData="getTableUserColumn" v-drag></column>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import column from "../common/column";
import Chooselist from '@/views/modules/common/Chooselist'
import {
searchSysLanguagePackList,
searchSysLanguageParam,
searchFunctionButtonList,
saveButtonList,
searchSysLanguage,
searchLanguageListByLanguageCode,
saveSysLanguageOne
} from "@/api/sysLanguage.js"
import {
saveTableDefaultList,
saveTableUser,
getTableDefaultListLanguage,
getTableUserListLanguage,
removerDefault,
removerUser
} from "@/api/table.js"
import {
getToolInfoList,
getPoReceiptList,
updatePoReceiptList,
updatePoReceiptListR
} from '@/api/knifemold/tool-info.js'
export default {
components: {
column,
Chooselist
},
data() {
return {
height: 0,
//
visible: false,
showDefault: this.$store.state.user.userDev,
//
tagNo: '',
dataListLoading: false,
queryTool: {
limit: 100,
page: 1,
site: this.$store.state.user.site,
inspector: '',
supplierId: '',
partNo: '',
toolInstanceId: '',
locationId: '',
toolDescription: '',
startDate: '',
endDate: '',
rStartDate: '',
rEndDate: '',
orderref1: '',
status: ''
},
pageIndex: 1,
pageSize: 100,
totalPage: 0,
//
dataList: [],
// ------------ ----------
// table
queryTable: {
functionId: this.$route.meta.menuId,
tableId: "toolReceipt",
languageCode: this.$i18n.locale
},
// table
queryTableUser: {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: "toolReceipt",
status: true,
languageCode: this.$i18n.locale
},
//
queryButton: {
functionId: this.$route.meta.menuId,
table_id: 'toolReceipt',
languageCode: this.$i18n.locale,
objectType: 'button'
},
selectReceipts: [],
//
columnList: [
{
userId: this.$store.state.user.name,
serialNumber: 'toolReceipt',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "orderref1",
headerAlign: "center",
align: "left",
columnLabel: "单号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: 'left',
columnWidth: 160,
},
{
userId: this.$store.state.user.name,
serialNumber: 'toolReceiptToolId',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "partNo",
headerAlign: "center",
align: "left",
columnLabel: "工具编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120,
},
{
userId: this.$store.state.user.name,
serialNumber: 'toolReceiptToolDescription',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "toolDescription",
headerAlign: "center",
align: "left",
columnLabel: "工具名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 150,
},
{
userId: this.$store.state.user.name,
serialNumber: 'toolOITransSupplierId',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "supplierId",
headerAlign: "center",
align: "left",
columnLabel: "供应商编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
serialNumber: 'toolOITransSupplierName',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "supplierName",
headerAlign: "center",
align: "left",
columnLabel: "供应商名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200,
},
{
userId: this.$store.state.user.name,
serialNumber: 'toolReceiptTransPrice',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "invoicePrice",
headerAlign: "center",
align: "right",
columnLabel: "入库价格",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
serialNumber: 'toolReceiptTransQty',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "arriveQty",
headerAlign: "center",
align: "right",
columnLabel: "接收数量",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
serialNumber: 'toolReceiptRemark',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "invoiceQty",
headerAlign: "center",
align: "right",
columnLabel: "对账数量",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},
{
userId: this.$store.state.user.name,
serialNumber: 'toolReceiptUserId',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "status",
headerAlign: "center",
align: "left",
columnLabel: "状态",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
serialNumber: 'toolReceiptUserId',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "inspector",
headerAlign: "center",
align: "left",
columnLabel: "对账人",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
serialNumber: 'toolReceiptTransDate',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "inspectionTime",
headerAlign: "center",
align: "left",
columnLabel: "对账日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140,
},
{
userId: this.$store.state.user.name,
serialNumber: 'toolReceiptUserId',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "receiver",
headerAlign: "center",
align: "left",
columnLabel: "接收人",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
serialNumber: 'toolReceiptTransDate',
tableId: "toolReceipt",
tableName: "toolReceipt",
columnProp: "receiveDate",
headerAlign: "center",
align: "left",
columnLabel: "接收日期",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140,
},
],
// table
userColumnList: [],
//
buttons: {
search: '查询',
download: '导出',
settingTable: '设置列表',
defaultTable: '设置默认配置',
receiveList: '批量对账',
},
//
buttonList: [
{
functionId: this.$route.meta.menuId,
languageValue: '查询',
objectId: 'search',
objectType: "button",
tableId: "toolReceipt"
},
{
functionId: this.$route.meta.menuId,
languageValue: '导出',
objectId: 'download',
objectType: "button",
tableId: "toolReceipt"
},
{
functionId: this.$route.meta.menuId,
languageValue: '设置列表',
objectId: 'settingTable',
objectType: "button",
tableId: "toolReceipt"
},
{
functionId: this.$route.meta.menuId,
languageValue: '设置默认配置',
objectId: 'defaultTable',
objectType: "button",
tableId: "toolReceipt"
},
],
// ------------ end ----------
// start
exportData: [],
exportName: this.$route.meta.title,
exportDataList: []
// end
}
},
activated() {
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 220;
})
},
methods: {
// --------------- -------------------
//
getDataList() {
this.dataListLoading = true
this.queryTool.limit = this.pageSize
this.queryTool.page = this.pageIndex
getPoReceiptList(this.queryTool).then(({data}) => {
if (data.code == 0) {
this.dataList = data.data.list
this.pageIndex = data.data.currPage
this.pageSize = data.data.pageSize
this.totalPage = data.data.totalCount
}
this.dataListLoading = false
})
},
//
async getExportDataList() {
this.dataListLoading = true
let queryTool = {
limit: 999999,
page: 1,
supplierId: this.queryTool.supplierId,
toolId: this.queryTool.toolId,
toolInstanceId: this.queryTool.toolInstanceId,
locationId: this.queryTool.locationId,
toolDescription: this.queryTool.toolDescription,
startDate: this.queryTool.startDate,
endDate: this.queryTool.endDate,
transNo: this.queryTool.transNo,
transTypes: this.queryTool.transTypes
}
await getPoReceiptList(queryTool).then(({data}) => {
if (data.code == 0) {
this.exportDataList = data.data.list
}
this.dataListLoading = false
})
},
getBaseData(val) {
if (this.tagNo === 3) {
this.queryTool.supplierId = val.SupplierID
}
},
//
getBaseList(val, number) {
this.tagNo = val
this.$nextTick(() => {
let strVal = "";
if (val === 3) {
strVal = this.queryTool.supplierId
}
this.$refs.baseList.init(val, strVal)
})
},
//
handleSelectionChange(val) {
this.selectReceipts = val;
},
//
editPoReceiptList(){
if (!this.selectReceipts){
this.$message.warning(`请选择勾选需要对账的信息`)
}
this.$confirm(`确定完成对账`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updatePoReceiptList(this.selectReceipts).then(({data}) =>{
if (data && data.code == 0){
this.$message.success(data.msg)
this.getDataList()
}else {
this.$message.warning(data.msg)
}
})
})
},
//
editPoReceipt(val){
let dto = val ? [val]:[];
this.$confirm(`确定完成对账`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updatePoReceiptList(dto).then(({data}) =>{
if (data && data.code == 0){
this.$message.success(data.msg)
this.getDataList()
}else {
this.$message.warning(data.msg)
}
})
})
},
//
editPoReceiptR(val){
let dto = val ? [val]:[];
this.$confirm(`确定取消对账`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updatePoReceiptListR(dto).then(({data}) =>{
if (data && data.code == 0){
this.$message.success(data.msg)
this.getDataList()
}else {
this.$message.warning(data.msg)
}
})
})
},
// --------------- end -----------------
// --------- ----------
//
userSetting() {
this.visible = true;
let queryTable = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: "common1001",
languageCode: this.$i18n.locale
}
this.$nextTick(() => {
this.$refs.column.init(queryTable);
});
},
//
async saveColumnList() {
//
if (this.userColumnList) {
// user
await removerUser(this.queryTable)
}
//
await removerDefault(this.queryTable)
// table
let sumColumnList = this.columnList
sumColumnList = sumColumnList.map(item => {
return item = {
tableId: item.tableId,
tableName: item.tableName,
columnProp: item.columnProp,
columnLabel: item.columnLabel,
columnHidden: false,
columnImage: false,
columnSortable: false,
columnWidth: item.columnWidth,
headerAlign: item.headerAlign,
format: item.format,
functionId: this.$route.meta.menuId,
sortLv: item.sortLv,
status: true,
fixed: item.fixed,
serialNumber: item.serialNumber,
columnType: item.columnType,
align: item.align
}
})
await saveTableDefaultList(sumColumnList)
// button label title
let buttons = this.buttonList.map(item => {
return item = {
functionId: this.$route.meta.menuId,
languageValue: item.languageValue,
objectId: item.objectId,
objectType: item.objectType,
tableId: item.tableId
}
})
await saveButtonList(buttons)
this.getFunctionButtonList()
this.getColumnList()
},
//
getTableUserColumn() {
getTableUserListLanguage(this.queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
//this.columnList = []
this.columnList = data.rows
} else {
this.getColumnList()
}
})
},
// tableDefault
getColumnList() {
getTableDefaultListLanguage(this.queryTable).then(({data}) => {
if (!data.rows.length == 0) {
// this.showDefault = false
this.columnList = data.rows
} else {
// this.showDefault = true
}
})
},
// button
getFunctionButtonList() {
searchFunctionButtonList(this.queryButton).then(({data}) => {
if (JSON.stringify(data.data) != '{}') {
this.buttons = data.data
} else {
// saveButtonList(this.buttonList).then(({data}) => {
// })
}
})
},
// --------- end ----------
// --------- ----------
//
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
// --------- end ----------
// --------- ----------
fields() {
let json = "{"
this.columnList.forEach((item, index) => {
if (index == this.columnList.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
async createExportData() {
await this.getExportDataList()
// ,,
return this.exportDataList;
},
startDownload() {
},
finishDownload() {
}
// --------- end ----------
},
created() {
// this.getTableUserColumn()
this.getFunctionButtonList()
}
}
</script>
<style>
</style>
Loading…
Cancel
Save