Browse Source

发货流程

master
常熟吴彦祖 1 week ago
parent
commit
9fcf427184
  1. 42
      src/views/modules/order/com_inspectionDetailList.vue
  2. 198
      src/views/modules/qc/IQCResultEntry.vue

42
src/views/modules/order/com_inspectionDetailList.vue

@ -22,6 +22,22 @@
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
label="操作"
min-width="100">
<template slot-scope="scope">
<el-link
v-if="scope.row.inspectNo"
type="primary"
@click="jumpToInspection(scope.row)">
跳转
</el-link>
<span v-else>-</span>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
@ -70,6 +86,17 @@ export default {
showOverflowTooltip: true,
fixed: false
},
{
columnProp: 'inspectNo',
headerAlign: 'center',
align: 'center',
columnLabel: '检验单号',
columnWidth: '140',
columnHidden: false,
columnSortable: false,
showOverflowTooltip: true,
fixed: false
},
{
columnProp: 'partNo',
headerAlign: 'center',
@ -186,6 +213,21 @@ export default {
currentChangeHandle(val) {
this.pageIndex = val
this.searchTable()
},
jumpToInspection(row) {
const inspectionNo = row && row.inspectNo ? String(row.inspectNo).trim() : ''
if (!inspectionNo) {
this.$message.warning('未找到检验单号')
return
}
this.$router.push({
name: 'qc-IQCResultEntry',
query: {
inspectionNo,
jumpMode: 'single'
}
})
}
}
}

198
src/views/modules/qc/IQCResultEntry.vue

@ -829,20 +829,7 @@
watch: {
'$route.query.inspectionNo': {
handler (newVal) {
if (newVal) {
if (!this.searchData.site) {
this.searchData.site = this.$store.state.user.site
}
if (!this.searchData.userName) {
this.searchData.userName = this.$store.state.user.name
}
this.searchData.inspectionNo = newVal
//
this.$nextTick(() => {
this.getDataList()
})
}
this.handleRouteInspectionNo(newVal)
},
immediate: false // created
},
@ -2035,57 +2022,117 @@
// this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
// this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
if (this.$route.query.inspectionNo) {
this.searchData.inspectionNo= this.$route.query.inspectionNo
}
// inspectionNo
// if (this.$route.query.inspectionNo) {
// // searchData inspectionNo
// this.searchData = {
// site: '',
// userName: this.$store.state.user.name,
// inspectionNo: this.$route.query.inspectionNo,
// inspectionTypeNo: '105',
// isQualified: '',
// buNo: '',
// startDate: '',
// endDate: '',
// startDate2: '',
// endDate2: '',
// partNo: '',
// partDesc: '',
// cinvSourceCode: '',
// sku: '',
// state: '',
// inspectionResult: '',
// supplierDesc: '',
// disposalMeasures: '',
// inspectorName: '',
// page: 1,
// limit: 10,
// poOrderNo: '',
// poItemNo: '',
// orderType: '',
// states: ['', ''],
// submissionType: '',
// invdefinetype: ''
// }
// }
const routeInspectionNo = this.resolveRouteInspectionNo()
const singleJumpMode = this.isSingleInspectionJumpRoute()
if (routeInspectionNo && !singleJumpMode) {
this.searchData.inspectionNo = routeInspectionNo
}
if (!this.authSearch) {
if (routeInspectionNo && singleJumpMode) {
this.pageIndex = 1
this.getDataList({
useTemporaryInspectionNo: true,
inspectionNo: routeInspectionNo,
clearRouteQueryAfterLoad: true
})
} else {
//
this.getDataList()
}
}
//
this.getUserRoleList()
},
methods: {
resolveRouteInspectionNo () {
const inspectionNo = this.$route && this.$route.query ? this.$route.query.inspectionNo : ''
return inspectionNo ? String(inspectionNo).trim() : ''
},
isSingleInspectionJumpRoute () {
const jumpMode = this.$route && this.$route.query ? this.$route.query.jumpMode : ''
return String(jumpMode || '').trim() === 'single'
},
clearJumpQueryFromRoute () {
const routeQuery = this.$route && this.$route.query ? this.$route.query : {}
if (!routeQuery.inspectionNo && !routeQuery.jumpMode) {
return
}
const nextQuery = { ...routeQuery }
delete nextQuery.inspectionNo
delete nextQuery.jumpMode
const replaceTarget = this.$route && this.$route.name
? { name: this.$route.name, params: this.$route.params, query: nextQuery }
: { path: this.$route.path, query: nextQuery }
this.$router.replace(replaceTarget).catch(() => {})
},
buildSingleInspectionSearchParams (inspectionNo) {
const targetInspectionNo = inspectionNo ? String(inspectionNo).trim() : ''
return {
site: this.searchData.site || this.$store.state.user.site,
userName: this.searchData.userName || this.$store.state.user.name,
inspectionNo: targetInspectionNo,
inspectionTypeNo: this.searchData.inspectionTypeNo || '105',
isQualified: '',
buNo: this.searchData.buNo || '',
startDate: '',
endDate: '',
startDate2: '',
endDate2: '',
partNo: '',
item: '',
partDesc: '',
cinvSourceCode: '',
sku: '',
state: '',
inspectionResult: '',
supplierDesc: '',
disposalMeasures: '',
inspectorName: '',
page: this.pageIndex,
limit: this.pageSize,
poOrderNo: '',
poItemNo: '',
orderType: '',
states: [],
submissionType: '',
invdefinetype: ''
}
},
handleRouteInspectionNo (inspectionNoValue) {
const inspectionNo = inspectionNoValue ? String(inspectionNoValue).trim() : ''
if (!inspectionNo) {
return
}
if (!this.searchData.site) {
this.searchData.site = this.$store.state.user.site
}
if (!this.searchData.userName) {
this.searchData.userName = this.$store.state.user.name
}
this.pageIndex = 1
if (this.isSingleInspectionJumpRoute()) {
this.$nextTick(() => {
this.getDataList({
useTemporaryInspectionNo: true,
inspectionNo,
clearRouteQueryAfterLoad: true
})
})
return
}
this.searchData.inspectionNo = inspectionNo
this.$nextTick(() => {
this.getDataList()
})
},
// bu
getSiteAndBuByUserName2 () {
let tempData = {
@ -2636,22 +2683,55 @@
},
//
getDataList () {
getDataList (options = {}) {
const useTemporaryInspectionNo = !!options.useTemporaryInspectionNo
const temporaryInspectionNo = options.inspectionNo ? String(options.inspectionNo).trim() : ''
const clearRouteQueryAfterLoad = !!options.clearRouteQueryAfterLoad
this.searchLoading = true
let queryParams = null
if (useTemporaryInspectionNo) {
queryParams = this.buildSingleInspectionSearchParams(temporaryInspectionNo)
queryParams.limit = this.pageSize
queryParams.page = this.pageIndex
} else {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
qcIQCInspectionSearch(this.searchData).then(({data}) => {
queryParams = this.searchData
}
qcIQCInspectionSearch(queryParams).then(({data}) => {
if (data.code === 0) {
if (useTemporaryInspectionNo) {
const rows = (data.page && data.page.list) || []
const targetNo = temporaryInspectionNo
const exactMatchedRows = rows.filter(item => {
const rowInspectionNo = item && item.inspectionNo ? String(item.inspectionNo).trim() : ''
return rowInspectionNo === targetNo
})
this.dataList = exactMatchedRows.length > 0 ? [exactMatchedRows[0]] : []
this.pageIndex = 1
this.totalPage = this.dataList.length
} else {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
this.searchLoading = false
} else {
this.searchLoading = false
}
} else if (useTemporaryInspectionNo) {
this.dataList = []
this.pageIndex = 1
this.totalPage = 0
}
}).catch(() => {
if (useTemporaryInspectionNo) {
this.dataList = []
this.pageIndex = 1
this.totalPage = 0
}
}).finally(() => {
this.searchLoading = false
if (useTemporaryInspectionNo && clearRouteQueryAfterLoad) {
this.clearJumpQueryFromRoute()
}
})
},

Loading…
Cancel
Save